- Notifications
You must be signed in to change notification settings - Fork4
An opinionated C# .editorconfig
License
NotificationsYou must be signed in to change notification settings
dimitrietataru/csharp-coding-standards
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An opinionated C# .editorconfig
Compatible with Visual Studio 2022, and 2019*.
- Visual Studio options
- Microsoft.CodeAnalysis.NetAnalyzers
Description _________________________________________________________________________ | Value |
---|---|
PlaceSystem directives first when sorting usings | ☐ |
Separate using directive groups | ☐ |
.editorconfig
dotnet_sort_system_directives_first =falsedotnet_separate_import_directive_groups =false
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Qualify field access withthis. | IDE0003 | Do not preferthis | ⚠ Warning |
Qualify property access withthis. | IDE0003 | Do not preferthis | ⚠ Warning |
Qualify method access withthis. | IDE0003 | Do not preferthis | ⚠ Warning |
Qualify event access withthis. | IDE0003 | Do not preferthis | ⚠ Warning |
.editorconfig
dotnet_style_qualification_for_event =false:warningdotnet_style_qualification_for_field =false:warningdotnet_style_qualification_for_method =false:warningdotnet_style_qualification_for_property =false:warning
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
For locals, parameters, and members | IDE0049 | Prefer predefined type | ⚠ Warning |
For member access expressions | IDE0049 | Prefer predefined type | ⚠ Warning |
.editorconfig
dotnet_style_predefined_type_for_locals_parameters_members =true:warningdotnet_style_predefined_type_for_member_access =true:warning
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
For built-in types | IDE0008 | Prefer explicit type | 🛈 Suggestion |
When variable type is apparent | IDE0007 | Prefervar | ⚠ Warning |
Elsewhere | IDE0007 | Prefervar | 🛈 Suggestion |
.editorconfig
csharp_style_var_for_built_in_types =false:suggestioncsharp_style_var_when_type_is_apparent =true:warningcsharp_style_var_elsewhere =true:suggestion
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Prefer braces | IDE0011 | Yes | ⚠ Warning |
Prefer auto properties | IDE0032 | Yes | 🞅 Refactoring |
Prefer simpleusing statement | IDE0063 | Yes | 🛈 Suggestion |
PreferSystem.HashCode in 'GetHashCode' | IDE0070 | Yes | 🛈 Suggestion |
Namespace declarations | IDE0161 | File scoped | 🛈 Suggestion |
Prefer method group conversion | IDE0200 | Yes | 🛈 Suggestion |
Prefer top-level statements | IDE0210 | Yes | 🛈 Suggestion |
Prefer primary constructors | IDE0290 | No | ⚠ Warning |
.editorconfig
csharp_prefer_braces =true:warningdotnet_style_prefer_auto_properties =true:silentcsharp_prefer_simple_using_statement =true:suggestion# Missing: Prefer _System.HashCode_ in 'GetHashCode'csharp_style_namespace_declarations =file_scoped:suggestioncsharp_style_prefer_method_group_conversion =true:suggestioncsharp_style_prefer_top_level_statements =true:suggestioncsharp_style_prefer_primary_constructors =false:warning
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
In arithmetic operators:*/%+-<<>>&^ | IDE0048 | Always for clarity | 🛈 Suggestion |
In other binary operators:&&??andor | IDE0048 | Always for clarity | 🛈 Suggestion |
In relational operators:<><=>=isas==!= | IDE0048 | Always for clarity | 🛈 Suggestion |
In other operators | IDE0047 | Never if unnecessary | ⚠ Warning |
.editorconfig
dotnet_style_parentheses_in_arithmetic_binary_operators =always_for_clarity:suggestiondotnet_style_parentheses_in_relational_binary_operators =always_for_clarity:suggestiondotnet_style_parentheses_in_other_binary_operators =always_for_clarity:suggestiondotnet_style_parentheses_in_other_operators =never_if_unnecessary:warning
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Prefer object initializer | IDE0017 | Yes | 🛈 Suggestion |
Prefer collection initializer | IDE0028 | Yes | 🛈 Suggestion |
Prefer explicit tuple name | IDE0033 | Yes | 🛈 Suggestion |
Prefer simpledefault expression | IDE0034 | Yes | ⚠ Warning |
Prefer inferred tuple element names | IDE0037 | No | 🛈 Suggestion |
Prefer inferred anonymous type member names | IDE0037 | Yes | 🞅 Refactoring |
Prefer local function over anonymous function | IDE0039 | Yes | ⚠ Warning |
Prefer conditional expression overif with assignments | IDE0045 | Yes | 🞅 Refactoring |
Prefer conditional expression overif with returns | IDE0046 | No | 🞅 Refactoring |
Prefer compound assignments | IDE0054 | Yes | ⚠ Warning |
Prefer index operator | IDE0056 | Yes | 🛈 Suggestion |
Prefer range operator | IDE0057 | Yes | 🛈 Suggestion |
Avoid expression statements that implicitly ignore value | IDE0058 | Discard | 🞅 Refactoring |
Avoid unused value assignments | IDE0059 | Discard | 🞅 Refactoring |
Prefer switch expression | IDE0066 | Yes | 🛈 Suggestion |
Prefer simplified interpolation | IDE0071 | Yes | ⚠ Warning |
Prefer simplified boolean expressions | IDE0075 | Yes | ⚠ Warning |
Prefer implicit object creation when type is aparent | IDE0090 | Yes | 🛈 Suggestion |
Prefer namespace and folder match structure | IDE0130 | Yes | 🛈 Suggestion |
Prefer tuple swap | IDE0180 | Yes | 🛈 Suggestion |
Prefer UTF-8 string literals | IDE0230 | Yes | 🛈 Suggestion |
Prefer collection expression | IDE0300 | Yes | 🛈 Suggestion |
Operator placement when wrapping | Beginning of line |
.editorconfig
dotnet_style_object_initializer =true:suggestiondotnet_style_collection_initializer =true:suggestiondotnet_style_explicit_tuple_names =true:suggestioncsharp_prefer_simple_default_expression =true:warningdotnet_style_prefer_inferred_tuple_names =false:suggestiondotnet_style_prefer_inferred_anonymous_type_member_names =false:suggestioncsharp_style_prefer_local_over_anonymous_function =true:warningdotnet_style_prefer_conditional_expression_over_assignment =true:silentdotnet_style_prefer_conditional_expression_over_return =false:silentdotnet_style_prefer_compound_assignment =true:warningcsharp_style_prefer_index_operator =true:suggestioncsharp_style_prefer_range_operator =true:suggestioncsharp_style_unused_value_expression_statement_preference =discard_variable:silentcsharp_style_unused_value_assignment_preference =discard_variable:silentcsharp_style_prefer_switch_expression =true:suggestiondotnet_style_prefer_simplified_interpolation =true:warningdotnet_style_prefer_simplified_boolean_expressions =true:warningcsharp_style_implicit_object_creation_when_type_is_apparent =true:suggestiondotnet_style_namespace_match_folder =true:suggestioncsharp_style_prefer_tuple_swap =true:suggestioncsharp_style_prefer_utf8_string_literals =true:suggestiondotnet_style_prefer_collection_expression =true:suggestiondotnet_style_operator_placement_when_wrapping =beginning_of_line
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Use expression body for constructors | IDE0021 | Never | 🞅 Refactoring |
Use expression body for methods | IDE0022 | Never | 🞅 Refactoring |
Use expression body for operators | IDE0024 | Never | 🞅 Refactoring |
Use expression body for properties | IDE0025 | When possible | 🛈 Suggestion |
Use expression body for indexers | IDE0026 | When possible | 🛈 Suggestion |
Use expression body for accessors | IDE0027 | When possible | 🛈 Suggestion |
Use expression body for lambdas | IDE0053 | When possible | 🞅 Refactoring |
Use expression body for local functions | IDE0061 | Never | 🛈 Suggestion |
.editorconfig
csharp_style_expression_bodied_constructors =false:silentcsharp_style_expression_bodied_methods =false:silentcsharp_style_expression_bodied_operators =false:silentcsharp_style_expression_bodied_properties =true:suggestioncsharp_style_expression_bodied_indexers =true:suggestioncsharp_style_expression_bodied_accessors =true:suggestioncsharp_style_expression_bodied_lambdas =true:silentcsharp_style_expression_bodied_local_functions =false:suggestion
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Prefer pattern matching | IDE0078 | Yes | 🛈 Suggestion |
Prefer pattern matching overas withnull check | IDE0019 | Yes | ⚠ Warning |
Prefer pattern matching overis withcast check | IDE0020 | Yes | ⚠ Warning |
Prefer pattern matching over mixed type check | IDE0083 | Yes | ⚠ Warning |
Prefer extended property pattern | IDE0170 | Yes | ⚠ Warning |
.editorconfig
csharp_style_prefer_pattern_matching =true:suggestioncsharp_style_pattern_matching_over_as_with_null_check =true:warningcsharp_style_pattern_matching_over_is_with_cast_check =true:warningcsharp_style_prefer_not_pattern =true:warningcsharp_style_prefer_extended_property_pattern =true:warning
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Prefer inlined variable declaration | IDE0018 | Yes | ⚠ Warning |
Prefer deconstructed variable declaration | IDE0042 | Yes | 🛈 Suggestion |
.editorconfig
csharp_style_inlined_variable_declaration =true:warningcsharp_style_deconstructed_variable_declaration =true:suggestion
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Prefer throw-expression | IDE0016 | Yes | 🛈 Suggestion |
Prefer coalesce expression | IDE0029 | Yes | ⚠ Warning |
Prefer null propagation | IDE0031 | Yes | ⚠ Warning |
Preferis null for reference equality checks | IDE0041 | Yes | ⚠ Warning |
Prefernull check over type check | IDE0150 | Yes | 🛈 Suggestion |
Prefer conditional delegate call | IDE1005 | Yes | 🛈 Suggestion |
.editorconfig
csharp_style_throw_expression =true:suggestiondotnet_style_coalesce_expression =true:warningdotnet_style_null_propagation =true:warningdotnet_style_prefer_is_null_check_over_reference_equality_method =true:warningcsharp_style_prefer_null_check_over_type_check =true:suggestioncsharp_style_conditional_delegate_call =true:suggestion
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Preferredusing directive placement | IDE0065 | Outside namespace | ⛔ Error |
.editorconfig
csharp_using_directive_placement =outside_namespace:error
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Require accesibility modifiers | IDE0040 | Yes | ⚠ Warning |
Prefer readonly fields | IDE0044 | Yes | ⚠ Warning |
Prefer static local functions | IDE0062 | Yes | ⚠ Warning |
Prefer readonly struct | IDE0250 | Yes | 🛈 Suggestion |
Prefer readonly struct member | IDE0251 | Yes | 🛈 Suggestion |
.editorconfig
dotnet_style_require_accessibility_modifiers =true:warningdotnet_style_readonly_field =true:warningcsharp_prefer_static_local_function =true:warningcsharp_style_prefer_readonly_struct =true:suggestioncsharp_style_prefer_readonly_struct_member =true:suggestion
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Avoid unused parameters | IDE0060 | Non-public methods | ⚠ Warning |
.editorconfig
dotnet_code_quality_unused_parameters =non_public:warning
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Use collection expression for empty | IDE0301 | Yes | ⚠ Warning |
Use collection expression for stackalloc | IDE0302 | Yes | 🛈 Suggestion |
Use collection expression forCreate() | IDE0303 | Yes | ⚠ Warning |
Use collection expression forbuilder | IDE0304 | Yes | ⚠ Warning |
Use collection expression forfluent | IDE0305 | Yes | ⚠ Warning |
Make anonymous function static | IDE0320 | Yes | 🛈 Suggestion |
PreferSystem.Threading.Lock | IDE0330 | Yes | ⛔ Error |
.editorconfig
dotnet_diagnostic.IDE0301.severity =warningdotnet_diagnostic.IDE0302.severity =suggestiondotnet_diagnostic.IDE0303.severity =warningdotnet_diagnostic.IDE0304.severity =warningdotnet_diagnostic.IDE0305.severity =warningdotnet_diagnostic.IDE0320.severity =suggestiondotnet_diagnostic.IDE0330.severity =error
Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
---|---|---|---|
Allow multiple blank lines | IDE2000 | No | ⚠ Warning |
Allow embeded statements on same line | IDE2001 | No | ⚠ Warning |
Allow blank lines between consecutive braces | IDE2002 | No | ⚠ Warning |
Allow statement immediately after block | IDE2003 | No | ⚠ Warning |
Allow blank line after colon in constructor initializer | IDE2004 | No | ⛔ Error |
Allow blank line after token in conditional expression | IDE2005 | No | ⛔ Error |
Allow blank line after token in arrow expression clause | IDE2006 | Yes | 🛈 Suggestion |
.editorconfig
dotnet_style_allow_multiple_blank_lines_experimental =false:warningcsharp_style_allow_embedded_statements_on_same_line_experimental =false:warningcsharp_style_allow_blank_lines_between_consecutive_braces_experimental =false:warningdotnet_style_allow_statement_immediately_after_block_experimental =false:warningcsharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental =false:errorcsharp_style_allow_blank_line_after_token_in_conditional_expression_experimental =false:errorcsharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental =true:suggestion
Description _________________________________________________________________________ | Value |
---|---|
Automatically format when typing | 🗹 |
Automatically format statement on; | 🗹 |
Automatically format block on} | 🗹 |
Automatically format on return | 🗹 |
Automatically format on paste | 🗹 |
.editorconfig
# Configurable at VS level
Description _________________________________________________________________________ | Value |
---|---|
Indent code blocks | 🗹 |
Indent open and close braces | ☐ |
Indent case contents | 🗹 |
Indent case contents (when block) | ☐ |
Indent case labels | 🗹 |
.editorconfig
csharp_indent_block_contents =truecsharp_indent_braces =falsecsharp_indent_case_contents =truecsharp_indent_case_contents_when_block =falsecsharp_indent_switch_labels =true
Description _________________________________________________________________________ | Value |
---|---|
Placegoto labels in leftmost column | ☐ |
Indent labels normally | ☐ |
Placegoto labels one indent less than content | 🗹 |
.editorconfig
csharp_indent_labels =one_less_than_current
Description _________________________________________________________________________ | Value |
---|---|
Place open brace on new line for types | 🗹 |
Place open brace on new line for methods and local functions | 🗹 |
Place open brace on new line for properties, indexers, and events | 🗹 |
Place open brace on new line for property, indexer, and event accessors | 🗹 |
Place open brace on new line for anonymous methods | 🗹 |
Place open brace on new line for control blocks | 🗹 |
Place open brace on new line for anonymous types | 🗹 |
Place open brace on new line for object, collection, array, and with initializers | 🗹 |
Place open brace on new line for lambda expression | 🗹 |
.editorconfig
csharp_new_line_before_open_brace =all
Description _________________________________________________________________________ | Value |
---|---|
Placeelse on new line | 🗹 |
Placecatch on new line | 🗹 |
Placefinally on new line | 🗹 |
.editorconfig
csharp_new_line_before_else =truecsharp_new_line_before_catch =truecsharp_new_line_before_finally =true
Description _________________________________________________________________________ | Value |
---|---|
Place members in object initializers on new line | 🗹 |
Place members in anonymous types on new line | 🗹 |
Place query expression clauses on new line | 🗹 |
.editorconfig
csharp_new_line_before_members_in_object_initializers =truecsharp_new_line_before_members_in_anonymous_types =truecsharp_new_line_between_query_expression_clauses =true
Description _________________________________________________________________________ | Value |
---|---|
Insert space between method name and its opening parenthesis | ☐ |
Insert space within parameter list parentheses | ☐ |
Insert space within empty parameter list parentheses | ☐ |
.editorconfig
csharp_space_between_method_declaration_name_and_open_parenthesis =falsecsharp_space_between_method_declaration_parameter_list_parentheses =falsecsharp_space_between_method_declaration_empty_parameter_list_parentheses =false
Description _________________________________________________________________________ | Value |
---|---|
Insert space between method name and its opening parenthesis | ☐ |
Insert space within argument list parentheses | ☐ |
Insert space within empty argument list parentheses | ☐ |
.editorconfig
csharp_space_between_method_call_name_and_opening_parenthesis =falsecsharp_space_between_method_call_parameter_list_parentheses =falsecsharp_space_between_method_call_empty_parameter_list_parentheses =false
Description _________________________________________________________________________ | Value |
---|---|
Insert space after keywords in control flow statements | 🗹 |
Insert space within parentheses of expressions | ☐ |
Insert space within parentheses of type casts | ☐ |
Insert space within parentheses of control flow statements | ☐ |
Insert space after cast | ☐ |
Insert space in declaration statements | ☐ |
.editorconfig
csharp_space_after_keywords_in_control_flow_statements =truecsharp_space_between_parentheses =falsecsharp_space_after_cast =falsecsharp_space_around_declaration_statements =false
Description _________________________________________________________________________ | Value |
---|---|
Insert space before open square bracket | ☐ |
Insert space within empty square brackets | ☐ |
Insert space within square brackets | ☐ |
.editorconfig
csharp_space_before_open_square_brackets =falsecsharp_space_between_square_brackets =falsecsharp_space_between_empty_square_brackets =false
Description _________________________________________________________________________ | Value |
---|---|
Insert space before colon for base or interface in type declarations | 🗹 |
Insert space after colon for base or interface in type declarations | 🗹 |
Insert space before comma | ☐ |
Insert space after comma | 🗹 |
Insert space before dot | ☐ |
Insert space after dot | ☐ |
Insert space before semicolon infor statement | ☐ |
Insert space after semicolon infor statement | 🗹 |
.editorconfig
csharp_space_before_colon_in_inheritance_clause =truecsharp_space_after_colon_in_inheritance_clause =truecsharp_space_before_comma =falsecsharp_space_after_comma =truecsharp_space_before_dot =falsecsharp_space_after_dot =falsecsharp_space_before_semicolon_in_for_statement =falsecsharp_space_after_semicolon_in_for_statement =true
Description _________________________________________________________________________ | Value |
---|---|
Ignore spaces around binary operators | ☐ |
Remove spaces before and after binary operators | ☐ |
Insert space before and after binary operators | 🗹 |
.editorconfig
csharp_space_around_binary_operators =before_and_after
Description _________________________________________________________________________ | Value |
---|---|
Leave block on single line | 🗹 |
Leave statements and member declarations on the same line | ☐ |
.editorconfig
csharp_preserve_single_line_blocks =truecsharp_preserve_single_line_statements =false
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1000 | Do not declare static members on generic types | ⚠ Warning |
CA1001 | Types that own disposable fields should be disposable | ⚠ Warning |
CA1002 | Do not expose generic lists | ⚠ Warning |
CA1003 | Use generic event handler instances | 🞅 None |
CA1005 | Avoid excessive parameters on generic types | ⚠ Warning |
CA1008 | Enums should have zero value | ⚠ Warning |
CA1010 | Collections should implement generic interface | 🛈 Suggestion |
CA1012 | Abstract types should not have public constructors | ⚠ Warning |
CA1014 | Mark assemblies with CLSCompliantAttribute | 🞅 None |
CA1016 | Mark assemblies with AssemblyVersionAttribute | 🞅 None |
CA1017 | Mark assemblies with ComVisibleAttribute | 🞅 None |
CA1018 | Mark attributes with AttributeUsageAttribute | ⚠ Warning |
CA1019 | Define accessors for attribute arguments | 🛈 Suggestion |
CA1021 | Avoid out parameters | 🛈 Suggestion |
CA1024 | Use properties where appropriate | 🛈 Suggestion |
CA1027 | Mark enums with FlagsAttribute | 🛈 Suggestion |
CA1028 | Enum storage should be Int32 | ⚠ Warning |
CA1030 | Use events where appropriate | 🞅 None |
CA1031 | Do not catch general exception types | 🛈 Suggestion |
CA1032 | Implement standard exception constructors | ⚠ Warning |
CA1033 | Interface methods should be callable by child types | ⚠ Warning |
CA1034 | Nested types should not be visible | ⚠ Warning |
CA1036 | Override methods on comparable types | 🛈 Suggestion |
CA1040 | Avoid empty interfaces | 🞅 None |
CA1041 | Provide ObsoleteAttribute message | ⛔ Error |
CA1043 | Use integral or string argument for indexers | ⚠ Warning |
CA1044 | Properties should not be write only | 🞅 None |
CA1045 | Do not pass types by reference | ⚠ Warning |
CA1046 | Do not overload operator equals on reference types | ⚠ Warning |
CA1047 | Do not declare protected members in sealed types | 🞅 None |
CA1050 | Declare types in namespaces | ⚠ Warning |
CA1051 | Do not declare visible instance fields | 🞅 None |
CA1052 | Static holder types should be Static or NotInheritable | ⛔ Error |
CA1053 | Static holder types should not have default constructors | - |
CA1054 | URI parameters should not be strings | ⚠ Warning |
CA1055 | URI return values should not be strings | ⚠ Warning |
CA1056 | URI properties should not be strings | ⚠ Warning |
CA1058 | Types should not extend certain base types | ⚠ Warning |
CA1060 | Move P/Invokes to NativeMethods class | 🞅 None |
CA1061 | Do not hide base class methods | ⚠ Warning |
CA1062 | Validate arguments of public methods | 🞅 None |
CA1063 | Implement IDisposable correctly | ⚠ Warning |
CA1064 | Exceptions should be public | ⛔ Error |
CA1065 | Do not raise exceptions in unexpected locations | ⛔ Error |
CA1066 | Implement IEquatable when overriding Equals | ⚠ Warning |
CA1067 | Override Equals when implementing IEquatable | ⚠ Warning |
CA1068 | CancellationToken parameters must come last | ⚠ Warning |
CA1069 | Enums should not have duplicate values | ⚠ Warning |
CA1070 | Do not declare event fields as virtual | 🛈 Suggestion |
.editorconfig
dotnet_diagnostic.CA1000.severity =warningdotnet_diagnostic.CA1001.severity =warningdotnet_diagnostic.CA1002.severity =warningdotnet_diagnostic.CA1003.severity =nonedotnet_diagnostic.CA1005.severity =warningdotnet_diagnostic.CA1008.severity =warningdotnet_diagnostic.CA1010.severity =suggestiondotnet_diagnostic.CA1012.severity =warningdotnet_diagnostic.CA1014.severity =nonedotnet_diagnostic.CA1016.severity =nonedotnet_diagnostic.CA1017.severity =nonedotnet_diagnostic.CA1018.severity =warningdotnet_diagnostic.CA1019.severity =suggestiondotnet_diagnostic.CA1021.severity =suggestiondotnet_diagnostic.CA1024.severity =suggestiondotnet_diagnostic.CA1027.severity =suggestiondotnet_diagnostic.CA1028.severity =warningdotnet_diagnostic.CA1030.severity =nonedotnet_diagnostic.CA1031.severity =suggestiondotnet_diagnostic.CA1032.severity =warningdotnet_diagnostic.CA1033.severity =warningdotnet_diagnostic.CA1034.severity =warningdotnet_diagnostic.CA1036.severity =suggestiondotnet_diagnostic.CA1040.severity =nonedotnet_diagnostic.CA1041.severity =errordotnet_diagnostic.CA1043.severity =warningdotnet_diagnostic.CA1044.severity =nonedotnet_diagnostic.CA1045.severity =warningdotnet_diagnostic.CA1046.severity =warningdotnet_diagnostic.CA1047.severity =nonedotnet_diagnostic.CA1050.severity =warningdotnet_diagnostic.CA1051.severity =errordotnet_diagnostic.CA1052.severity =error#dotnet_diagnostic.CA1053.severity = warningdotnet_diagnostic.CA1054.severity =warningdotnet_diagnostic.CA1055.severity =warningdotnet_diagnostic.CA1056.severity =warningdotnet_diagnostic.CA1058.severity =warningdotnet_diagnostic.CA1060.severity =nonedotnet_diagnostic.CA1061.severity =warningdotnet_diagnostic.CA1062.severity =nonedotnet_diagnostic.CA1063.severity =warningdotnet_diagnostic.CA1064.severity =errordotnet_diagnostic.CA1065.severity =errordotnet_diagnostic.CA1066.severity =warningdotnet_diagnostic.CA1067.severity =warningdotnet_diagnostic.CA1068.severity =warningdotnet_diagnostic.CA1069.severity =warningdotnet_diagnostic.CA1070.severity =suggestion
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1200 | Avoid using cref tags with a prefix | 🞅 None |
.editorconfig
dotnet_diagnostic.CA1200.severity =none
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1303 | Do not pass literals as localized parameters | ⚠ Warning |
CA1304 | Specify CultureInfo | ⚠ Warning |
CA1305 | Specify IFormatProvider | ⚠ Warning |
CA1307 | Specify StringComparison for clarity | ⚠ Warning |
CA1308 | Normalize strings to uppercase | 🛈 Suggestion |
CA1309 | Use ordinal StringComparison | ⚠ Warning |
CA1310 | Specify StringComparison for correctness | ⚠ Warning |
CA1311 | Specify a culture or use an invariant version | ⚠ Warning |
CA2101 | Specify marshalling for P/Invoke string arguments | 🛈 Suggestion |
.editorconfig
dotnet_diagnostic.CA1303.severity =warningdotnet_diagnostic.CA1304.severity =warningdotnet_diagnostic.CA1305.severity =warningdotnet_diagnostic.CA1307.severity =warningdotnet_diagnostic.CA1308.severity =suggestiondotnet_diagnostic.CA1309.severity =warningdotnet_diagnostic.CA1310.severity =warningdotnet_diagnostic.CA1311.severity =warningdotnet_diagnostic.CA2101.severity =suggestion
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1401 | P/Invokes should not be visible | 🛈 Suggestion |
CA1416 | Validate platform compatibility | ⚠ Warning |
CA1417 | Do not useOutAttribute on string parameters for P/Invokes | ⚠ Warning |
CA1418 | Validate platform compatibility | ⚠ Warning |
CA1419 | Provide a parameterless ctor for types derived from System.Runtime.InteropServices.SafeHandle | 🛈 Suggestion |
CA1420 | Property, type, or attribute requires runtime marshalling | ⚠ Warning |
CA1421 | Method uses runtime marshalling whenDisableRuntimeMarshalling is applied | 🛈 Suggestion |
CA1422 | Validate platform compatibility - Obsoleted APIs | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA1401.severity =suggestiondotnet_diagnostic.CA1416.severity =warningdotnet_diagnostic.CA1417.severity =warningdotnet_diagnostic.CA1418.severity =warningdotnet_diagnostic.CA1419.severity =suggestiondotnet_diagnostic.CA1420.severity =warningdotnet_diagnostic.CA1421.severity =suggestiondotnet_diagnostic.CA1422.severity =warning
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1501 | Avoid excessive inheritance | ⚠ Warning |
CA1502 | Avoid excessive complexity | ⚠ Warning |
CA1505 | Avoid unmaintainable code | ⚠ Warning |
CA1506 | Avoid excessive class coupling | ⚠ Warning |
CA1507 | Usenameof in place of string | ⚠ Warning |
CA1508 | Avoid dead conditional code | ⚠ Warning |
CA1509 | Invalid entry in code metrics configuration file | ⛔ Error |
CA1510 | UseArgumentNullException throw helper | ⚠ Warning |
CA1511 | UseArgumentException throw helper | ⚠ Warning |
CA1512 | UseArgumentOutOfRangeException throw helper | ⚠ Warning |
CA1513 | UseObjectDisposedException throw helper | ⚠ Warning |
CA1514 | Avoid redundant length argument | ⚠ Warning |
CA1515 | Consider making public types internal | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA1501.severity =warningdotnet_diagnostic.CA1502.severity =warningdotnet_diagnostic.CA1505.severity =warningdotnet_diagnostic.CA1506.severity =warningdotnet_diagnostic.CA1507.severity =warningdotnet_diagnostic.CA1508.severity =warningdotnet_diagnostic.CA1509.severity =errordotnet_diagnostic.CA1510.severity =warningdotnet_diagnostic.CA1511.severity =warningdotnet_diagnostic.CA1512.severity =warningdotnet_diagnostic.CA1513.severity =warningdotnet_diagnostic.CA1514.severity =warningdotnet_diagnostic.CA1515.severity =warning
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1700 | Do not name enum valuesReserved | 🛈 Suggestion |
CA1707 | Identifiers should not contain underscores | ⛔ Error |
CA1708 | Identifiers should differ by more than case | 🛈 Suggestion |
CA1710 | Identifiers should have correct suffix | ⚠ Warning |
CA1711 | Identifiers should not have incorrect suffix | ⚠ Warning |
CA1712 | Do not prefix enum values with type name | ⛔ Error |
CA1713 | Events should not have before or after prefix | ⚠ Warning |
CA1714 | Flags enums should have plural names | ⚠ Warning |
CA1715 | Identifiers should have correct prefix | ⚠ Warning |
CA1716 | Identifiers should not match keywords | ⚠ Warning |
CA1717 | OnlyFlagsAttribute enums should have plural names | 🛈 Suggestion |
CA1721 | Property names should not match get methods | ⚠ Warning |
CA1720 | Identifiers should not contain type names | ⚠ Warning |
CA1724 | Type names should not match namespaces | ⚠ Warning |
CA1725 | Parameter names should match base declaration | ⚠ Warning |
CA1727 | Use PascalCase for named placeholders | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA1700.severity =suggestiondotnet_diagnostic.CA1707.severity =errordotnet_diagnostic.CA1708.severity =suggestiondotnet_diagnostic.CA1710.severity =warningdotnet_diagnostic.CA1711.severity =warningdotnet_diagnostic.CA1712.severity =errordotnet_diagnostic.CA1713.severity =warningdotnet_diagnostic.CA1714.severity =warningdotnet_diagnostic.CA1715.severity =warningdotnet_diagnostic.CA1716.severity =warningdotnet_diagnostic.CA1717.severity =suggestiondotnet_diagnostic.CA1720.severity =warningdotnet_diagnostic.CA1721.severity =warningdotnet_diagnostic.CA1724.severity =warningdotnet_diagnostic.CA1725.severity =warningdotnet_diagnostic.CA1727.severity =warning
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1802 | Use literals where appropriate | ⚠ Warning |
CA1805 | Do not initialize unnecessarily | ⚠ Warning |
CA1806 | Do not ignore method results | ⚠ Warning |
CA1810 | Initialize reference type static fields inline | ⚠ Warning |
CA1812 | Avoid uninstantiated internal classes | ⚠ Warning |
CA1813 | Avoid unsealed attributes | ⛔ Error |
CA1814 | Prefer jagged arrays over multidimensional | 🛈 Suggestion |
CA1815 | Override equals and operator equals on value types | ⚠ Warning |
CA1819 | Properties should not return arrays | ⚠ Warning |
CA1820 | Test for empty strings using string length | ⚠ Warning |
CA1821 | Remove empty finalizers | ⚠ Warning |
CA1822 | Mark members as static | ⚠ Warning |
CA1823 | Avoid unused private fields | ⚠ Warning |
CA1824 | Mark assemblies withNeutralResourcesLanguageAttribute | 🞅 None |
CA1825 | Avoid zero-length array allocations | ⚠ Warning |
CA1826 | Use property instead of Linq Enumerable method | ⚠ Warning |
CA1827 | Do not useCount/LongCount whenAny can be used | ⚠ Warning |
CA1828 | Do not useCountAsync/LongCountAsync whenAnyAsync can be used | ⚠ Warning |
CA1829 | UseLength/Count property instead ofEnumerable.Count method | ⚠ Warning |
CA1830 | Prefer strongly-typedAppend andInsert method overloads onStringBuilder | ⚠ Warning |
CA1831 | UseAsSpan instead of Range-based indexers for string when appropriate | 🛈 Suggestion |
CA1832 | UseAsSpan orAsMemory instead of Range-based indexers for getting ReadOnlySpan or ReadOnlyMemory [..] | 🛈 Suggestion |
CA1833 | UseAsSpan orAsMemory instead of Range-based indexers for getting Span or Memory [..] | 🛈 Suggestion |
CA1834 | UseStringBuilder.Append(char) for single character strings | ⚠ Warning |
CA1835 | Prefer the memory-based overloads ofReadAsync/WriteAsync methods [..] | 🛈 Suggestion |
CA1836 | PreferIsEmpty overCount when available | ⚠ Warning |
CA1837 | UseEnvironment.ProcessId instead ofProcess.GetCurrentProcess().Id | 🛈 Suggestion |
CA1838 | Avoid StringBuilder parameters for P/Invokes | 🛈 Suggestion |
CA1839 | UseEnvironment.ProcessPath [..] | 🛈 Suggestion |
CA1840 | UseEnvironment.CurrentManagedThreadId [..] | 🛈 Suggestion |
CA1841 | Prefer Dictionary Contains methods | ⚠ Warning |
CA1842 | Do not useWhenAll with a single task | ⛔ Error |
CA1843 | Do not useWaitAll with a single task | ⛔ Error |
CA1844 | Provide memory-based overrides of async methods when subclassingStream | ⚠ Warning |
CA1845 | Use span-basedstring.Concat | ⚠ Warning |
CA1846 | PreferAsSpan overSubstring | ⚠ Warning |
CA1847 | Usestring.Contains(char) instead ofstring.Contains(string) with single chars | ⚠ Warning |
CA1848 | Use the LoggerMessage delegates | 🛈 Suggestion |
CA1849 | Call async methods when in an async method | ⚠ Warning |
CA1850 | Prefer staticHashData method overComputeHash | 🞅 None |
CA1851 | Possible multiple enumerations of IEnumerable collection | ⚠ Warning |
CA1852 | Seal internal types | ⚠ Warning |
CA1853 | Unnecessary call toDictionary.ContainsKey(key) | ⚠ Warning |
CA1854 | Prefer theIDictionary.TryGetValue(TKey, out TValue) method | 🛈 Suggestion |
CA1855 | UseSpan[T].Clear() instead ofSpan[T].Fill() | 🛈 Suggestion |
CA1856 | Incorrect usage ofConstantExpected attribute | ⛔ Error |
CA1857 | The parameter expects a constant for optimal performance | ⚠ Warning |
CA1858 | UseStartsWith instead ofIndexOf | ⚠ Warning |
CA1859 | Use concrete types when possible for improved performance | 🛈 Suggestion |
CA1860 | Avoid usingEnumerable.Any() extension method | ⚠ Warning |
CA1861 | Avoid constant arrays as arguments | ⚠ Warning |
CA1862 | Use theStringComparison method overloads for case-insensitive comparisons | ⚠ Warning |
CA1863 | UseCompositeFormat | 🛈 Suggestion |
CA1864 | Prefer theIDictionary.TryAdd(TKey, TValue) method | ⚠ Warning |
CA1865 | Usestring.Method(char) instead ofstring.Method(string) for string with one char | ⚠ Warning |
CA1866 | Usestring.Method(char) instead ofstring.Method(string) for string with one char | ⚠ Warning |
CA1867 | Usestring.Method(char) instead ofstring.Method(string) for string with one char | 🛈 Suggestion |
CA1868 | Unnecessary call toContains for sets | ⚠ Warning |
CA1869 | Cache and reuseJsonSerializerOptions instances | ⚠ Warning |
CA1870 | Use a cachedSearchValues instance | ⚠ Warning |
CA1871 | Do not pass a nullable struct toArgumentNullException.ThrowIfNull | ⚠ Warning |
CA1872 | PreferConvert.ToHexString andConvert.ToHexStringLower over call chains based onBitConverter.ToString | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA1802.severity =warningdotnet_diagnostic.CA1805.severity =warningdotnet_diagnostic.CA1806.severity =warningdotnet_diagnostic.CA1810.severity =warningdotnet_diagnostic.CA1812.severity =warningdotnet_diagnostic.CA1813.severity =errordotnet_diagnostic.CA1814.severity =suggestiondotnet_diagnostic.CA1815.severity =warningdotnet_diagnostic.CA1819.severity =warningdotnet_diagnostic.CA1820.severity =warningdotnet_diagnostic.CA1821.severity =warningdotnet_diagnostic.CA1822.severity =warningdotnet_diagnostic.CA1823.severity =warningdotnet_diagnostic.CA1824.severity =nonedotnet_diagnostic.CA1825.severity =warningdotnet_diagnostic.CA1826.severity =warningdotnet_diagnostic.CA1827.severity =warningdotnet_diagnostic.CA1828.severity =warningdotnet_diagnostic.CA1829.severity =warningdotnet_diagnostic.CA1830.severity =warningdotnet_diagnostic.CA1831.severity =suggestiondotnet_diagnostic.CA1832.severity =suggestiondotnet_diagnostic.CA1833.severity =suggestiondotnet_diagnostic.CA1834.severity =warningdotnet_diagnostic.CA1835.severity =suggestiondotnet_diagnostic.CA1836.severity =warningdotnet_diagnostic.CA1837.severity =suggestiondotnet_diagnostic.CA1838.severity =suggestiondotnet_diagnostic.CA1839.severity =suggestiondotnet_diagnostic.CA1840.severity =suggestiondotnet_diagnostic.CA1841.severity =warningdotnet_diagnostic.CA1842.severity =errordotnet_diagnostic.CA1843.severity =errordotnet_diagnostic.CA1844.severity =warningdotnet_diagnostic.CA1845.severity =warningdotnet_diagnostic.CA1846.severity =warningdotnet_diagnostic.CA1847.severity =warningdotnet_diagnostic.CA1848.severity =suggestiondotnet_diagnostic.CA1849.severity =warningdotnet_diagnostic.CA1850.severity =nonedotnet_diagnostic.CA1851.severity =warningdotnet_diagnostic.CA1852.severity =warningdotnet_diagnostic.CA1853.severity =warningdotnet_diagnostic.CA1854.severity =suggestiondotnet_diagnostic.CA1855.severity =suggestiondotnet_diagnostic.CA1856.severity =errordotnet_diagnostic.CA1857.severity =warningdotnet_diagnostic.CA1858.severity =warningdotnet_diagnostic.CA1859.severity =suggestiondotnet_diagnostic.CA1860.severity =warningdotnet_diagnostic.CA1861.severity =warningdotnet_diagnostic.CA1862.severity =warningdotnet_diagnostic.CA1863.severity =suggestiondotnet_diagnostic.CA1864.severity =warningdotnet_diagnostic.CA1865.severity =warningdotnet_diagnostic.CA1866.severity =warningdotnet_diagnostic.CA1867.severity =suggestiondotnet_diagnostic.CA1868.severity =warningdotnet_diagnostic.CA1869.severity =warningdotnet_diagnostic.CA1870.severity =warningdotnet_diagnostic.CA1871.severity =warningdotnet_diagnostic.CA1872.severity =warning
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA2000 | Dispose objects before losing scope | 🛈 Suggestion |
CA2002 | Do not lock on objects with weak identity | ⛔ Error |
CA2007 | Do not directly await a Task | 🞅 None |
CA2008 | Do not create tasks without passing aTaskScheduler | 🛈 Suggestion |
CA2009 | Do not callToImmutableCollection on anImmutableCollection value | ⚠ Warning |
CA2011 | Do not assign property within its setter | ⛔ Error |
CA2012 | UseValueTasks correctly | 🛈 Suggestion |
CA2013 | Do not useReferenceEquals with value types | ⚠ Warning |
CA2014 | Do not usestackalloc in loops | ⚠ Warning |
CA2015 | Do not define finalizers for types derived fromMemoryManager | ⚠ Warning |
CA2016 | Forward theCancellationToken parameter to methods that take one | ⚠ Warning |
CA2017 | Parameter count mismatch | ⚠ Warning |
CA2018 | The count argument toBuffer.BlockCopy should specify the number of bytes [..] | ⚠ Warning |
CA2019 | ThreadStatic fields should not use inline initialization | 🛈 Suggestion |
CA2020 | Prevent behavioral change caused by built-in operators ofIntPtr/UIntPtr | 🛈 Suggestion |
CA2021 | Don't callEnumerable.Cast orEnumerable.OfType with incompatible types | ⚠ Warning |
CA2022 | Avoid inexact read withStream.Read | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA2000.severity =suggestiondotnet_diagnostic.CA2002.severity =errordotnet_diagnostic.CA2007.severity =nonedotnet_diagnostic.CA2008.severity =suggestiondotnet_diagnostic.CA2009.severity =warningdotnet_diagnostic.CA2011.severity =errordotnet_diagnostic.CA2012.severity =suggestiondotnet_diagnostic.CA2013.severity =warningdotnet_diagnostic.CA2014.severity =warningdotnet_diagnostic.CA2015.severity =warningdotnet_diagnostic.CA2016.severity =warningdotnet_diagnostic.CA2017.severity =warningdotnet_diagnostic.CA2018.severity =warningdotnet_diagnostic.CA2019.severity =suggestiondotnet_diagnostic.CA2020.severity =suggestiondotnet_diagnostic.CA2021.severity =warningdotnet_diagnostic.CA2022.severity =warning
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA2100 | Review SQL queries for security vulnerabilities | ⚠ Warning |
CA2109 | Review visible event handlers | ⚠ Warning |
CA2119 | Seal methods that satisfy private interfaces | ⚠ Warning |
CA2153 | Avoid handling Corrupted State Exceptions | ⚠ Warning |
CA2300 | Do not use insecure deserializer BinaryFormatter | ⛔ Error |
CA2301 | Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder | 🞅 None |
CA2302 | Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize | 🞅 None |
CA2305 | Do not use insecure deserializer LosFormatter | ⛔ Error |
CA2310 | Do not use insecure deserializer NetDataContractSerializer | ⛔ Error |
CA2311 | Do not deserialize without first setting NetDataContractSerializer.Binder | 🞅 None |
CA2312 | Ensure NetDataContractSerializer.Binder is set before deserializing | 🞅 None |
CA2315 | Do not use insecure deserializer ObjectStateFormatter | ⛔ Error |
CA2321 | Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver | ⚠ Warning |
CA2322 | Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver [..] | ⚠ Warning |
CA2326 | Do not use TypeNameHandling values other than None | ⚠ Warning |
CA2327 | Do not use insecure JsonSerializerSettings | ⚠ Warning |
CA2328 | Ensure that JsonSerializerSettings are secure | ⚠ Warning |
CA2329 | Do not deserialize with JsonSerializer using an insecure configuration | ⚠ Warning |
CA2330 | Ensure that JsonSerializer has a secure configuration when deserializing | ⚠ Warning |
CA2350 | Ensure DataTable.ReadXml()'s input is trusted | ⚠ Warning |
CA2351 | Ensure DataSet.ReadXml()'s input is trusted | ⚠ Warning |
CA2352 | Unsafe DataSet or DataTable in serializable type can be vulnerable to RCEA | ⚠ Warning |
CA2353 | Unsafe DataSet or DataTable in serializable type | ⚠ Warning |
CA2354 | Unsafe DataSet or DataTable in deserialized object graph can be vulnerable to RCEA | ⚠ Warning |
CA2355 | Unsafe DataSet or DataTable in deserialized object graph | ⚠ Warning |
CA2356 | Unsafe DataSet or DataTable type in web deserialized object graph | ⚠ Warning |
CA2361 | Ensure autogen class with DataSet.ReadXml() is not used with untrusted data | ⚠ Warning |
CA2362 | Unsafe DataSet or DataTable in autogen serializable type can be vulnerable to RCEA | ⚠ Warning |
CA3001 | Review code for SQL injection vulnerabilities | ⚠ Warning |
CA3002 | Review code for XSS vulnerabilities | ⚠ Warning |
CA3003 | Review code for file path injection vulnerabilities | ⚠ Warning |
CA3004 | Review code for information disclosure vulnerabilities | ⚠ Warning |
CA3005 | Review code for LDAP injection vulnerabilities | ⚠ Warning |
CA3006 | Review code for process command injection vulnerabilities | ⚠ Warning |
CA3007 | Review code for open redirect vulnerabilities | ⚠ Warning |
CA3008 | Review code for XPath injection vulnerabilities | ⚠ Warning |
CA3009 | Review code for XML injection vulnerabilities | ⚠ Warning |
CA3010 | Review code for XAML injection vulnerabilities | ⚠ Warning |
CA3011 | Review code for DLL injection vulnerabilities | ⚠ Warning |
CA3012 | Review code for regex injection vulnerabilities | ⚠ Warning |
CA3061 | Do not add schema by URL | ⚠ Warning |
CA3075 | Insecure DTD Processing | ⚠ Warning |
CA3076 | Insecure XSLT Script Execution | ⚠ Warning |
CA3077 | Insecure Processing in API Design, XML Document and XML Text Reader | ⚠ Warning |
CA3147 | Mark verb handlers with ValidateAntiForgeryToken | ⚠ Warning |
CA5350 | Do Not Use Weak Cryptographic Algorithms | ⚠ Warning |
CA5351 | Do Not Use Broken Cryptographic Algorithms | ⚠ Warning |
CA5358 | Do Not Use Unsafe Cipher Modes | ⚠ Warning |
CA5359 | Do not disable certificate validation | ⚠ Warning |
CA5360 | Do not call dangerous methods in deserialization | ⚠ Warning |
CA5361 | Do not disable SChannel use of strong crypto | ⚠ Warning |
CA5362 | Potential reference cycle in deserialized object graph | 🛈 Suggestion |
CA5363 | Do not disable request validation | ⚠ Warning |
CA5364 | Do not use deprecated security protocols | ⚠ Warning |
CA5365 | Do Not Disable HTTP Header Checking | ⚠ Warning |
CA5366 | Use XmlReader For DataSet Read XML | ⚠ Warning |
CA5367 | Do not serialize types with pointer fields | ⛔ Error |
CA5368 | Set ViewStateUserKey For Classes Derived From Page | ⚠ Warning |
CA5369 | Use XmlReader for Deserialize | ⚠ Warning |
CA5370 | Use XmlReader for validating reader | ⚠ Warning |
CA5371 | Use XmlReader for schema read | ⚠ Warning |
CA5372 | Use XmlReader for XPathDocument | ⚠ Warning |
CA5373 | Do not use obsolete key derivation function | ⚠ Warning |
CA5374 | Do not use XslTransform | ⚠ Warning |
CA5375 | Do not use account shared access signature | ⚠ Warning |
CA5376 | Use SharedAccessProtocol HttpsOnly | ⚠ Warning |
CA5377 | Use container level access policy | ⚠ Warning |
CA5378 | Do not disable ServicePointManagerSecurityProtocols | ⚠ Warning |
CA5379 | Ensure key derivation function algorithm is sufficiently strong | ⚠ Warning |
CA5380 | Do not add certificates to root store | ⚠ Warning |
CA5381 | Ensure certificates are not added to root store | ⚠ Warning |
CA5382 | Use secure cookies in ASP.NET Core | ⚠ Warning |
CA5383 | Ensure use secure cookies in ASP.NET Core | ⚠ Warning |
CA5384 | Do not use digital signature algorithm (DSA) | ⚠ Warning |
CA5385 | Use Rivest–Shamir–Adleman (RSA) algorithm with sufficient key size | ⚠ Warning |
CA5386 | Avoid hardcoding SecurityProtocolType value | ⚠ Warning |
CA5387 | Do not use weak key derivation function with insufficient iteration count | ⚠ Warning |
CA5388 | Ensure sufficient iteration count when using weak key derivation function | ⚠ Warning |
CA5389 | Do not add archive item's path to the target file system path | ⚠ Warning |
CA5390 | Do not hard-code encryption key | ⚠ Warning |
CA5391 | Use antiforgery tokens in ASP.NET Core MVC controllers | ⚠ Warning |
CA5392 | Use DefaultDllImportSearchPaths attribute for P/Invokes | 🞅 None |
CA5393 | Do not use unsafe DllImportSearchPath value | 🞅 None |
CA5394 | Do not use insecure randomness | ⚠ Warning |
CA5395 | Miss HttpVerb attribute for action methods | ⛔ Error |
CA5396 | Set HttpOnly to true for HttpCookie | ⚠ Warning |
CA5397 | Do not use deprecated SslProtocols values | ⚠ Warning |
CA5398 | Avoid hardcoded SslProtocols values | ⛔ Error |
CA5399 | Enable HttpClient certificate revocation list check | ⚠ Warning |
CA5400 | Ensure HttpClient certificate revocation list check is not disabled | ⚠ Warning |
CA5401 | Do not use CreateEncryptor with non-default IV | ⚠ Warning |
CA5402 | Use CreateEncryptor with the default IV | ⚠ Warning |
CA5403 | Do not hard-code certificate | ⛔ Error |
CA5404 | Do not disable token validation checks | ⚠ Warning |
CA5405 | Do not always skip token validation in delegates | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA2100.severity =warningdotnet_diagnostic.CA2109.severity =warningdotnet_diagnostic.CA2119.severity =warningdotnet_diagnostic.CA2153.severity =warningdotnet_diagnostic.CA2300.severity =errordotnet_diagnostic.CA2301.severity =nonedotnet_diagnostic.CA2302.severity =nonedotnet_diagnostic.CA2305.severity =errordotnet_diagnostic.CA2310.severity =errordotnet_diagnostic.CA2311.severity =nonedotnet_diagnostic.CA2312.severity =nonedotnet_diagnostic.CA2315.severity =errordotnet_diagnostic.CA2321.severity =warningdotnet_diagnostic.CA2322.severity =warningdotnet_diagnostic.CA2326.severity =warningdotnet_diagnostic.CA2327.severity =warningdotnet_diagnostic.CA2328.severity =warningdotnet_diagnostic.CA2329.severity =warningdotnet_diagnostic.CA2330.severity =warningdotnet_diagnostic.CA2350.severity =warningdotnet_diagnostic.CA2351.severity =warningdotnet_diagnostic.CA2352.severity =warningdotnet_diagnostic.CA2353.severity =warningdotnet_diagnostic.CA2354.severity =warningdotnet_diagnostic.CA2355.severity =warningdotnet_diagnostic.CA2356.severity =warningdotnet_diagnostic.CA2361.severity =warningdotnet_diagnostic.CA2362.severity =warningdotnet_diagnostic.CA3001.severity =warningdotnet_diagnostic.CA3002.severity =warningdotnet_diagnostic.CA3003.severity =warningdotnet_diagnostic.CA3004.severity =warningdotnet_diagnostic.CA3005.severity =warningdotnet_diagnostic.CA3006.severity =warningdotnet_diagnostic.CA3007.severity =warningdotnet_diagnostic.CA3008.severity =warningdotnet_diagnostic.CA3009.severity =warningdotnet_diagnostic.CA3010.severity =warningdotnet_diagnostic.CA3011.severity =warningdotnet_diagnostic.CA3012.severity =warningdotnet_diagnostic.CA3061.severity =warningdotnet_diagnostic.CA3075.severity =warningdotnet_diagnostic.CA3076.severity =warningdotnet_diagnostic.CA3077.severity =warningdotnet_diagnostic.CA3147.severity =warningdotnet_diagnostic.CA5350.severity =warningdotnet_diagnostic.CA5351.severity =warningdotnet_diagnostic.CA5358.severity =warningdotnet_diagnostic.CA5359.severity =warningdotnet_diagnostic.CA5360.severity =warningdotnet_diagnostic.CA5361.severity =warningdotnet_diagnostic.CA5362.severity =suggestiondotnet_diagnostic.CA5363.severity =warningdotnet_diagnostic.CA5364.severity =warningdotnet_diagnostic.CA5365.severity =warningdotnet_diagnostic.CA5366.severity =warningdotnet_diagnostic.CA5367.severity =errordotnet_diagnostic.CA5368.severity =warningdotnet_diagnostic.CA5369.severity =warningdotnet_diagnostic.CA5370.severity =warningdotnet_diagnostic.CA5371.severity =warningdotnet_diagnostic.CA5372.severity =warningdotnet_diagnostic.CA5373.severity =warningdotnet_diagnostic.CA5374.severity =warningdotnet_diagnostic.CA5375.severity =warningdotnet_diagnostic.CA5376.severity =warningdotnet_diagnostic.CA5377.severity =warningdotnet_diagnostic.CA5378.severity =warningdotnet_diagnostic.CA5379.severity =warningdotnet_diagnostic.CA5380.severity =warningdotnet_diagnostic.CA5381.severity =warningdotnet_diagnostic.CA5382.severity =warningdotnet_diagnostic.CA5383.severity =warningdotnet_diagnostic.CA5384.severity =warningdotnet_diagnostic.CA5385.severity =warningdotnet_diagnostic.CA5386.severity =warningdotnet_diagnostic.CA5387.severity =warningdotnet_diagnostic.CA5388.severity =warningdotnet_diagnostic.CA5389.severity =warningdotnet_diagnostic.CA5390.severity =warningdotnet_diagnostic.CA5391.severity =warningdotnet_diagnostic.CA5392.severity =nonedotnet_diagnostic.CA5393.severity =nonedotnet_diagnostic.CA5394.severity =suggestiondotnet_diagnostic.CA5395.severity =errordotnet_diagnostic.CA5396.severity =warningdotnet_diagnostic.CA5397.severity =warningdotnet_diagnostic.CA5398.severity =errordotnet_diagnostic.CA5399.severity =warningdotnet_diagnostic.CA5400.severity =warningdotnet_diagnostic.CA5401.severity =warningdotnet_diagnostic.CA5402.severity =warningdotnet_diagnostic.CA5403.severity =errordotnet_diagnostic.CA5404.severity =warningdotnet_diagnostic.CA5405.severity =warning
Code | Description ___________________________________________________________________________ | !! Severity !! |
---|---|---|
CA1801 | Review unused parameters | ⚠ Warning |
CA1816 | Call GC.SuppressFinalize correctly | 🛈 Suggestion |
CA2200 | Rethrow to preserve stack details | ⚠ Warning |
CA2201 | Do not raise reserved exception types | ⚠ Warning |
CA2207 | Initialize value type static fields inline | ⚠ Warning |
CA2208 | Instantiate argument exceptions correctly | ⚠ Warning |
CA2211 | Non-constant fields should not be visible | ⚠ Warning |
CA2213 | Disposable fields should be disposed | ⚠ Warning |
CA2214 | Do not call overridable methods in constructors | ⚠ Warning |
CA2215 | Dispose methods should call base class dispose | ⚠ Warning |
CA2216 | Disposable types should declare finalizer | ⚠ Warning |
CA2217 | Do not mark enums with FlagsAttribute | ⛔ Error |
CA2218 | Override GetHashCode on overriding Equals | ⚠ Warning |
CA2219 | Do not raise exceptions in exception clauses | ⛔ Error |
CA2224 | Override Equals on overloading operator equals | 🞅 None |
CA2225 | Operator overloads have named alternates | 🞅 None |
CA2226 | Operators should have symmetrical overloads | 🞅 None |
CA2227 | Collection properties should be read only | ⚠ Warning |
CA2229 | Implement serialization constructors | 🞅 None |
CA2231 | Overload operator equals on overriding ValueType.Equals | ⚠ Warning |
CA2234 | PassSystem.Uri objects instead of strings | ⚠ Warning |
CA2235 | Mark all non-serializable fields | ⚠ Warning |
CA2237 | Mark ISerializable types with SerializableAttribute | ⚠ Warning |
CA2241 | Provide correct arguments to formatting methods | ⛔ Error |
CA2242 | Test for NaN correctly | ⛔ Error |
CA2243 | Attribute string literals should parse correctly | ⛔ Error |
CA2244 | Do not duplicate indexed element initializations | ⛔ Error |
CA2245 | Do not assign a property to itself | ⛔ Error |
CA2246 | Do not assign a symbol and its member in the same statement | ⛔ Error |
CA2247 | Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum | ⚠ Warning |
CA2248 | Provide correct enum argument to Enum.HasFlag | ⛔ Error |
CA2249 | Consider using String.Contains instead of String.IndexOf | ⚠ Warning |
CA2250 | UseThrowIfCancellationRequested | ⚠ Warning |
CA2251 | UseString.Equals overString.Compare | ⚠ Warning |
CA2252 | Opt in to preview features before using them | ⛔ Error |
CA2253 | Named placeholders should not be numeric values | ⚠ Warning |
CA2254 | Template should be a static expression | ⚠ Warning |
CA2255 | TheModuleInitializer attribute should not be used in libraries | ⚠ Warning |
CA2256 | All members declared in parent interfaces must implementDICI-attributed interface | ⚠ Warning |
CA2257 | Members defined on an interface with theDICIAttribute should bestatic | ⚠ Warning |
CA2258 | Providing aDICI interface in Visual Basic is unsupported | ⚠ Warning |
CA2259 | EnsureThreadStatic is only used with static fields | ⚠ Warning |
CA2260 | Implement generic math interfaces correctly | ⚠ Warning |
CA2261 | Do not useConfigureAwaitOptions.SuppressThrowing withTask | ⚠ Warning |
CA2262 | SetMaxResponseHeadersLength properly | ⚠ Warning |
CA2263 | Prefer generic overload when type is known | ⚠ Warning |
CA2264 | Do not pass a non-nullable value toArgumentNullException.ThrowIfNull | ⚠ Warning |
CA2265 | Do not compareSpan tonull ordefault | ⚠ Warning |
.editorconfig
dotnet_diagnostic.CA1801.severity =warningdotnet_diagnostic.CA1816.severity =suggestiondotnet_diagnostic.CA2200.severity =warningdotnet_diagnostic.CA2201.severity =warningdotnet_diagnostic.CA2207.severity =warningdotnet_diagnostic.CA2208.severity =warningdotnet_diagnostic.CA2211.severity =warningdotnet_diagnostic.CA2213.severity =warningdotnet_diagnostic.CA2214.severity =warningdotnet_diagnostic.CA2215.severity =warningdotnet_diagnostic.CA2216.severity =warningdotnet_diagnostic.CA2217.severity =errordotnet_diagnostic.CA2218.severity =warningdotnet_diagnostic.CA2219.severity =errordotnet_diagnostic.CA2224.severity =nonedotnet_diagnostic.CA2225.severity =nonedotnet_diagnostic.CA2226.severity =nonedotnet_diagnostic.CA2227.severity =warningdotnet_diagnostic.CA2229.severity =nonedotnet_diagnostic.CA2231.severity =warningdotnet_diagnostic.CA2234.severity =warningdotnet_diagnostic.CA2235.severity =warningdotnet_diagnostic.CA2237.severity =warningdotnet_diagnostic.CA2241.severity =errordotnet_diagnostic.CA2242.severity =errordotnet_diagnostic.CA2243.severity =errordotnet_diagnostic.CA2244.severity =errordotnet_diagnostic.CA2245.severity =errordotnet_diagnostic.CA2246.severity =errordotnet_diagnostic.CA2247.severity =warningdotnet_diagnostic.CA2248.severity =errordotnet_diagnostic.CA2249.severity =warningdotnet_diagnostic.CA2250.severity =warningdotnet_diagnostic.CA2251.severity =warningdotnet_diagnostic.CA2252.severity =errordotnet_diagnostic.CA2253.severity =warningdotnet_diagnostic.CA2254.severity =warningdotnet_diagnostic.CA2255.severity =warningdotnet_diagnostic.CA2256.severity =warningdotnet_diagnostic.CA2257.severity =warningdotnet_diagnostic.CA2258.severity =warningdotnet_diagnostic.CA2259.severity =warningdotnet_diagnostic.CA2260.severity =warningdotnet_diagnostic.CA2261.severity =warningdotnet_diagnostic.CA2262.severity =warningdotnet_diagnostic.CA2263.severity =warningdotnet_diagnostic.CA2264.severity =warningdotnet_diagnostic.CA2265.severity =warning
.editorconfig
dotnet_diagnostic.IDE0055.severity =warning
About
An opinionated C# .editorconfig
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Uh oh!
There was an error while loading.Please reload this page.