https://github.com/dimitrietataru/csharp-coding-standards
An opinionated C# .editorconfig
https://github.com/dimitrietataru/csharp-coding-standards
coding-guidelines coding-standards coding-style csharp
Last synced: 10 months ago
JSON representation
An opinionated C# .editorconfig
- Host: GitHub
- URL: https://github.com/dimitrietataru/csharp-coding-standards
- Owner: dimitrietataru
- License: mit
- Created: 2022-04-08T15:49:21.000Z (about 4 years ago)
- Default Branch: ace
- Last Pushed: 2024-08-26T14:38:56.000Z (over 1 year ago)
- Last Synced: 2024-08-26T17:12:09.514Z (over 1 year ago)
- Topics: coding-guidelines, coding-standards, coding-style, csharp
- Language: C#
- Homepage:
- Size: 204 KB
- Stars: 16
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# C# Coding Standards
An opinionated C# .editorconfig
Compatible with Visual Studio 2022, and 2019*.
## Table of contents
* [Visual Studio options](#visual-studio-options)
* Advanced
* [Using directives](#advanced--using-directives)
* Code style
* General
* [this. preferences](#code-style--general--this-preferences)
* [Predefined type preferences](#code-style--general--predefined-type-preferences)
* [var preferences](#code-style--general--var-preferences)
* [Code block preferences](#code-style--general--code-block-preferences)
* [Parentheses preferences](#code-style--general--parentheses-preferences)
* [Expression preferences](#code-style--general--expression-preferences)
* [Expression-bodied members](#code-style--general--expression-bodied-members)
* [Pattern matching preferences](#code-style--general--pattern-matching-preferences)
* [Variable preferences](#code-style--general--variable-preferences)
* [null checking](#code-style--general--null-checking)
* [using preferences](#code-style--general--using-preferences)
* [Modifier preferences](#code-style--general--modifier-preferences)
* [Parameter preferences](#code-style--general--parameter-preferences)
* [Style](#code-style--general--style)
* [New line preferences](#code-style--general--new-line-preferences)
* Formatting
* [General](#code-style--formatting--general)
* Indentation
* [General](code-style--formatting--indentation--general)
* [Label indentation](#code-style--formatting--indentation--label-indentation)
* New lines
* [New line options for braces](#code-style--formatting--new-lines--new-line-options-for-braces)
* [New line options for keywords](#code-style--formatting--new-lines--new-line-options-for-keywords)
* [New line options for expressions](#code-style--formatting--new-lines--new-line-options-for-expressions)
* Spacing
* [Set spacing for method declarations](#code-style--formatting--spacing--set-spacing-for-method-declarations)
* [Set spacing for method calls](#code-style--formatting--spacing--set-spacing-for-method-calls)
* [Set other spacing options](#code-style--formatting--spacing--set-other-spacing-options)
* [Set spacing for brackets](#code-style--formatting--spacing--set-spacing-for-brackets)
* [Set spacing for delimiters](#code-style--formatting--spacing--set-spacing-for-delimiters)
* [Set spacing for operators](#code-style--formatting--spacing--set-spacing-for-operators)
* [Wrapping](#code-style--formatting--wrapping)
* [Microsoft.CodeAnalysis.NetAnalyzers](#microsoftcodeanalysisnetanalyzers)
* [Design](#microsoftcodeanalysisnetanalyzers--design)
* [Documentation](#microsoftcodeanalysisnetanalyzers--documentation)
* [Globalization](#microsoftcodeanalysisnetanalyzers--globalization)
* [Interoperability](#microsoftcodeanalysisnetanalyzers--interoperability)
* [Maintainability](#microsoftcodeanalysisnetanalyzers--maintainability)
* [Naming](#microsoftcodeanalysisnetanalyzers--naming)
* [Performance](#microsoftcodeanalysisnetanalyzers--performance)
* [Reliability](#microsoftcodeanalysisnetanalyzers--reliability)
* [Security](#microsoftcodeanalysisnetanalyzers--security)
* [Usage](#microsoftcodeanalysisnetanalyzers--usage)
## Visual Studio options
### Advanced | Using directives
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Place _System_ directives first when sorting usings | ☐ |
| Separate using directive groups | ☐ |
.editorconfig
``` EditorConfig
dotnet_sort_system_directives_first = false
dotnet_separate_import_directive_groups = false
```
### Code Style | General | _this._ preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Qualify field access with _this._ | IDE0003 | Do not prefer _this_ | ⚠ Warning |
| Qualify property access with _this._ | IDE0003 | Do not prefer _this_ | ⚠ Warning |
| Qualify method access with _this._ | IDE0003 | Do not prefer _this_ | ⚠ Warning |
| Qualify event access with _this._ | IDE0003 | Do not prefer _this_ | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_property = false:warning
```
### Code Style | General | Predefined type preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| For locals, parameters, and members | IDE0049 | Prefer predefined type | ⚠ Warning |
| For member access expressions | IDE0049 | Prefer predefined type | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
```
### Code Style | General | _var_ preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| For built-in types | IDE0008 | Prefer explicit type | 🛈 Suggestion |
| When variable type is apparent | IDE0007 | Prefer _var_ | ⚠ Warning |
| Elsewhere | IDE0007 | Prefer _var_ | 🛈 Suggestion |
.editorconfig
``` EditorConfig
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = true:suggestion
```
### Code Style | General | Code block preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Prefer braces | IDE0011 | Yes | ⚠ Warning |
| Prefer auto properties | IDE0032 | Yes | 🞅 Refactoring |
| Prefer simple _using_ statement | IDE0063 | Yes | 🛈 Suggestion |
| Prefer _System.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
``` EditorConfig
csharp_prefer_braces = true:warning
dotnet_style_prefer_auto_properties = true:silent
csharp_prefer_simple_using_statement = true:suggestion
# Missing: Prefer _System.HashCode_ in 'GetHashCode'
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:suggestion
csharp_style_prefer_top_level_statements = true:suggestion
csharp_style_prefer_primary_constructors = false:warning
```
### Code Style | General | Parentheses preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| In arithmetic operators: _*_ _/_ _%_ _+_ _-_ _<<_ _>>_ _&_ _^_ | IDE0048 | Always for clarity | 🛈 Suggestion |
| In other binary operators: _&&_ _??_ _and_ _or_ | IDE0048 | Always for clarity | 🛈 Suggestion |
| In relational operators: _<_ _>_ _<=_ _>=_ _is_ _as_ _==_ _!=_ | IDE0048 | Always for clarity | 🛈 Suggestion |
| In other operators | IDE0047 | Never if unnecessary | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
```
### Code Style | General | Expression preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Prefer object initializer | IDE0017 | Yes | 🛈 Suggestion |
| Prefer collection initializer | IDE0028 | Yes | 🛈 Suggestion |
| Prefer explicit tuple name | IDE0033 | Yes | 🛈 Suggestion |
| Prefer simple _default_ 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 over _if_ with assignments | IDE0045 | Yes | 🞅 Refactoring |
| Prefer conditional expression over _if_ 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
``` EditorConfig
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
csharp_prefer_simple_default_expression = true:warning
dotnet_style_prefer_inferred_tuple_names = false:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
csharp_style_prefer_local_over_anonymous_function = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = false:silent
dotnet_style_prefer_compound_assignment = true:warning
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_unused_value_assignment_preference = discard_variable:silent
csharp_style_prefer_switch_expression = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
dotnet_style_prefer_collection_expression = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
```
### Code Style | General | Expression-bodied members
| 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
``` EditorConfig
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:suggestion
```
### Code Style | General | Pattern matching preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Prefer pattern matching | IDE0078 | Yes | 🛈 Suggestion |
| Prefer pattern matching over _as_ with _null_ check | IDE0019 | Yes | ⚠ Warning |
| Prefer pattern matching over _is_ with _cast_ check | IDE0020 | Yes | ⚠ Warning |
| Prefer pattern matching over mixed type check | IDE0083 | Yes | ⚠ Warning |
| Prefer extended property pattern | IDE0170 | Yes | ⚠ Warning |
.editorconfig
``` EditorConfig
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_prefer_not_pattern = true:warning
csharp_style_prefer_extended_property_pattern = true:warning
```
### Code Style | General | Variable preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Prefer inlined variable declaration | IDE0018 | Yes | ⚠ Warning |
| Prefer deconstructed variable declaration | IDE0042 | Yes | 🛈 Suggestion |
.editorconfig
``` EditorConfig
csharp_style_inlined_variable_declaration = true:warning
csharp_style_deconstructed_variable_declaration = true:suggestion
```
### Code Style | General | _null_ checking
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Prefer throw-expression | IDE0016 | Yes | 🛈 Suggestion |
| Prefer coalesce expression | IDE0029 | Yes | ⚠ Warning |
| Prefer null propagation | IDE0031 | Yes | ⚠ Warning |
| Prefer _is null_ for reference equality checks | IDE0041 | Yes | ⚠ Warning |
| Prefer _null_ check over type check | IDE0150 | Yes | 🛈 Suggestion |
| Prefer conditional delegate call | IDE1005 | Yes | 🛈 Suggestion |
.editorconfig
``` EditorConfig
csharp_style_throw_expression = true:suggestion
dotnet_style_coalesce_expression = true:warning
dotnet_style_null_propagation = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
```
### Code Style | General | _using_ preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Preferred _using_ directive placement | IDE0065 | Outside namespace | ⛔ Error |
.editorconfig
``` EditorConfig
csharp_using_directive_placement = outside_namespace:error
```
### Code Style | General | Modifier preferences
| 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
``` EditorConfig
dotnet_style_require_accessibility_modifiers = true:warning
dotnet_style_readonly_field = true:warning
csharp_prefer_static_local_function = true:warning
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion
```
### Code Style | General | Parameter preferences
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Avoid unused parameters | IDE0060 | Non-public methods | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_code_quality_unused_parameters = non_public:warning
```
### Code Style | General | Style
| Description _______________________________________________ | Code | Preference ____________ | !! Severity !! |
| :---------------------------------------------------------- | :-----: | :---------------------- | :-----------: |
| Use collection expression for empty | IDE0301 | Yes | ⚠ Warning |
| Use collection expression for stackalloc | IDE0302 | Yes | 🛈 Suggestion |
| Use collection expression for _Create()_ | IDE0303 | Yes | ⚠ Warning |
| Use collection expression for _builder_ | IDE0304 | Yes | ⚠ Warning |
| Use collection expression for _fluent_ | IDE0305 | Yes | ⚠ Warning |
| Make anonymous function static | IDE0320 | Yes | 🛈 Suggestion |
| Prefer _System.Threading.Lock_ | IDE0330 | Yes | ⛔ Error |
.editorconfig
``` EditorConfig
dotnet_diagnostic.IDE0301.severity = warning
dotnet_diagnostic.IDE0302.severity = suggestion
dotnet_diagnostic.IDE0303.severity = warning
dotnet_diagnostic.IDE0304.severity = warning
dotnet_diagnostic.IDE0305.severity = warning
dotnet_diagnostic.IDE0320.severity = suggestion
dotnet_diagnostic.IDE0330.severity = error
```
### Code Style | General | New line preferences
| 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
``` EditorConfig
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
csharp_style_allow_embedded_statements_on_same_line_experimental = false:warning
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:warning
dotnet_style_allow_statement_immediately_after_block_experimental = false:warning
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false:error
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false:error
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:suggestion
```
### Code Style | Formatting | General
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Automatically format when typing | 🗹 |
| Automatically format statement on _;_ | 🗹 |
| Automatically format block on _}_ | 🗹 |
| Automatically format on return | 🗹 |
| Automatically format on paste | 🗹 |
.editorconfig
``` EditorConfig
# Configurable at VS level
```
### Code Style | Formatting | Indentation | General
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Indent code blocks | 🗹 |
| Indent open and close braces | ☐ |
| Indent case contents | 🗹 |
| Indent case contents (when block) | ☐ |
| Indent case labels | 🗹 |
.editorconfig
``` EditorConfig
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
```
### Code Style | Formatting | Indentation | Label Indentation
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Place _goto_ labels in leftmost column | ☐ |
| Indent labels normally | ☐ |
| Place _goto_ labels one indent less than content | 🗹 |
.editorconfig
``` EditorConfig
csharp_indent_labels = one_less_than_current
```
### Code Style | Formatting | New Lines | New line options for braces
| 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
``` EditorConfig
csharp_new_line_before_open_brace = all
```
### Code Style | Formatting | New Lines | New line options for keywords
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Place _else_ on new line | 🗹 |
| Place _catch_ on new line | 🗹 |
| Place _finally_ on new line | 🗹 |
.editorconfig
``` EditorConfig
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
```
### Code Style | Formatting | New Lines | New line options for expressions
| 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
``` EditorConfig
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
```
### Code Style | Formatting | Spacing | Set spacing for method declarations
| 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
``` EditorConfig
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
```
### Code Style | Formatting | Spacing | Set spacing for method calls
| 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
``` EditorConfig
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
```
### Code Style | Formatting | Spacing | Set other spacing options
| 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
``` EditorConfig
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_parentheses = false
csharp_space_after_cast = false
csharp_space_around_declaration_statements = false
```
### Code Style | Formatting | Spacing | Set spacing for brackets
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Insert space before open square bracket | ☐ |
| Insert space within empty square brackets | ☐ |
| Insert space within square brackets | ☐ |
.editorconfig
``` EditorConfig
csharp_space_before_open_square_brackets = false
csharp_space_between_square_brackets = false
csharp_space_between_empty_square_brackets = false
```
### Code Style | Formatting | Spacing | Set spacing for delimiters
| 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 in _for_ statement | ☐ |
| Insert space after semicolon in _for_ statement | 🗹 |
.editorconfig
``` EditorConfig
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_after_comma = true
csharp_space_before_dot = false
csharp_space_after_dot = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_after_semicolon_in_for_statement = true
```
### Code Style | Formatting | Spacing | Set spacing for operators
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Ignore spaces around binary operators | ☐ |
| Remove spaces before and after binary operators | ☐ |
| Insert space before and after binary operators | 🗹 |
.editorconfig
``` EditorConfig
csharp_space_around_binary_operators = before_and_after
```
### Code Style | Formatting | Wrapping
| Description _________________________________________________________________________ | Value |
| :------------------------------------------------------------------------------------ | :---: |
| Leave block on single line | 🗹 |
| Leave statements and member declarations on the same line | ☐ |
.editorconfig
``` EditorConfig
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
```
## Microsoft.CodeAnalysis.NetAnalyzers
### Microsoft.CodeAnalysis.NetAnalyzers | Design
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :-----------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1000](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1000) | Do not declare static members on generic types | ⚠ Warning |
| [CA1001](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1001) | Types that own disposable fields should be disposable | ⚠ Warning |
| [CA1002](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1002) | Do not expose generic lists | ⚠ Warning |
| [CA1003](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1003) | Use generic event handler instances | 🞅 None |
| [CA1005](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1005) | Avoid excessive parameters on generic types | ⚠ Warning |
| [CA1008](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1008) | Enums should have zero value | ⚠ Warning |
| [CA1010](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1010) | Collections should implement generic interface | 🛈 Suggestion |
| [CA1012](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1012) | Abstract types should not have public constructors | ⚠ Warning |
| [CA1014](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1014) | Mark assemblies with CLSCompliantAttribute | 🞅 None |
| [CA1016](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1016) | Mark assemblies with AssemblyVersionAttribute | 🞅 None |
| [CA1017](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1017) | Mark assemblies with ComVisibleAttribute | 🞅 None |
| [CA1018](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1018) | Mark attributes with AttributeUsageAttribute | ⚠ Warning |
| [CA1019](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1019) | Define accessors for attribute arguments | 🛈 Suggestion |
| [CA1021](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1021) | Avoid out parameters | 🛈 Suggestion |
| [CA1024](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1024) | Use properties where appropriate | 🛈 Suggestion |
| [CA1027](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1027) | Mark enums with FlagsAttribute | 🛈 Suggestion |
| [CA1028](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1028) | Enum storage should be Int32 | ⚠ Warning |
| [CA1030](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1030) | Use events where appropriate | 🞅 None |
| [CA1031](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1031) | Do not catch general exception types | 🛈 Suggestion |
| [CA1032](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1032) | Implement standard exception constructors | ⚠ Warning |
| [CA1033](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1033) | Interface methods should be callable by child types | ⚠ Warning |
| [CA1034](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1034) | Nested types should not be visible | ⚠ Warning |
| [CA1036](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1036) | Override methods on comparable types | 🛈 Suggestion |
| [CA1040](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1040) | Avoid empty interfaces | 🞅 None |
| [CA1041](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1041) | Provide ObsoleteAttribute message | ⛔ Error |
| [CA1043](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1043) | Use integral or string argument for indexers | ⚠ Warning |
| [CA1044](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1044) | Properties should not be write only | 🞅 None |
| [CA1045](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1045) | Do not pass types by reference | ⚠ Warning |
| [CA1046](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1046) | Do not overload operator equals on reference types | ⚠ Warning |
| [CA1047](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1047) | Do not declare protected members in sealed types | 🞅 None |
| [CA1050](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1050) | Declare types in namespaces | ⚠ Warning |
| [CA1051](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1051) | Do not declare visible instance fields | 🞅 None |
| [CA1052](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1052) | Static holder types should be Static or NotInheritable | ⛔ Error |
| [CA1053](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1053) | Static holder types should not have default constructors | - |CA
| [CA1054](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1054) | URI parameters should not be strings | ⚠ Warning |
| [CA1055](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1055) | URI return values should not be strings | ⚠ Warning |
| [CA1056](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1056) | URI properties should not be strings | ⚠ Warning |
| [CA1058](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1058) | Types should not extend certain base types | ⚠ Warning |
| [CA1060](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1060) | Move P/Invokes to NativeMethods class | 🞅 None |
| [CA1061](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1061) | Do not hide base class methods | ⚠ Warning |
| [CA1062](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1062) | Validate arguments of public methods | 🞅 None |
| [CA1063](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1063) | Implement IDisposable correctly | ⚠ Warning |
| [CA1064](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1064) | Exceptions should be public | ⛔ Error |
| [CA1065](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1065) | Do not raise exceptions in unexpected locations | ⛔ Error |
| [CA1066](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1066) | Implement IEquatable when overriding Equals | ⚠ Warning |
| [CA1067](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1067) | Override Equals when implementing IEquatable | ⚠ Warning |
| [CA1068](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1068) | CancellationToken parameters must come last | ⚠ Warning |
| [CA1069](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1069) | Enums should not have duplicate values | ⚠ Warning |
| [CA1070](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1070) | Do not declare event fields as virtual | 🛈 Suggestion |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1000.severity = warning
dotnet_diagnostic.CA1001.severity = warning
dotnet_diagnostic.CA1002.severity = warning
dotnet_diagnostic.CA1003.severity = none
dotnet_diagnostic.CA1005.severity = warning
dotnet_diagnostic.CA1008.severity = warning
dotnet_diagnostic.CA1010.severity = suggestion
dotnet_diagnostic.CA1012.severity = warning
dotnet_diagnostic.CA1014.severity = none
dotnet_diagnostic.CA1016.severity = none
dotnet_diagnostic.CA1017.severity = none
dotnet_diagnostic.CA1018.severity = warning
dotnet_diagnostic.CA1019.severity = suggestion
dotnet_diagnostic.CA1021.severity = suggestion
dotnet_diagnostic.CA1024.severity = suggestion
dotnet_diagnostic.CA1027.severity = suggestion
dotnet_diagnostic.CA1028.severity = warning
dotnet_diagnostic.CA1030.severity = none
dotnet_diagnostic.CA1031.severity = suggestion
dotnet_diagnostic.CA1032.severity = warning
dotnet_diagnostic.CA1033.severity = warning
dotnet_diagnostic.CA1034.severity = warning
dotnet_diagnostic.CA1036.severity = suggestion
dotnet_diagnostic.CA1040.severity = none
dotnet_diagnostic.CA1041.severity = error
dotnet_diagnostic.CA1043.severity = warning
dotnet_diagnostic.CA1044.severity = none
dotnet_diagnostic.CA1045.severity = warning
dotnet_diagnostic.CA1046.severity = warning
dotnet_diagnostic.CA1047.severity = none
dotnet_diagnostic.CA1050.severity = warning
dotnet_diagnostic.CA1051.severity = error
dotnet_diagnostic.CA1052.severity = error
#dotnet_diagnostic.CA1053.severity = warning
dotnet_diagnostic.CA1054.severity = warning
dotnet_diagnostic.CA1055.severity = warning
dotnet_diagnostic.CA1056.severity = warning
dotnet_diagnostic.CA1058.severity = warning
dotnet_diagnostic.CA1060.severity = none
dotnet_diagnostic.CA1061.severity = warning
dotnet_diagnostic.CA1062.severity = none
dotnet_diagnostic.CA1063.severity = warning
dotnet_diagnostic.CA1064.severity = error
dotnet_diagnostic.CA1065.severity = error
dotnet_diagnostic.CA1066.severity = warning
dotnet_diagnostic.CA1067.severity = warning
dotnet_diagnostic.CA1068.severity = warning
dotnet_diagnostic.CA1069.severity = warning
dotnet_diagnostic.CA1070.severity = suggestion
```
### Microsoft.CodeAnalysis.NetAnalyzers | Documentation
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :-----------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1200](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1200) | Avoid using cref tags with a prefix | 🞅 None |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1200.severity = none
```
### Microsoft.CodeAnalysis.NetAnalyzers | Globalization
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :-----------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1303](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1303) | Do not pass literals as localized parameters | ⚠ Warning |
| [CA1304](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1304) | Specify CultureInfo | ⚠ Warning |
| [CA1305](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1305) | Specify IFormatProvider | ⚠ Warning |
| [CA1307](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1307) | Specify StringComparison for clarity | ⚠ Warning |
| [CA1308](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1308) | Normalize strings to uppercase | 🛈 Suggestion |
| [CA1309](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1309) | Use ordinal StringComparison | ⚠ Warning |
| [CA1310](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1310) | Specify StringComparison for correctness | ⚠ Warning |
| [CA1311](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1311) | Specify a culture or use an invariant version | ⚠ Warning |
| [CA2101](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2101) | Specify marshalling for P/Invoke string arguments | 🛈 Suggestion |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1303.severity = warning
dotnet_diagnostic.CA1304.severity = warning
dotnet_diagnostic.CA1305.severity = warning
dotnet_diagnostic.CA1307.severity = warning
dotnet_diagnostic.CA1308.severity = suggestion
dotnet_diagnostic.CA1309.severity = warning
dotnet_diagnostic.CA1310.severity = warning
dotnet_diagnostic.CA1311.severity = warning
dotnet_diagnostic.CA2101.severity = suggestion
```
### Microsoft.CodeAnalysis.NetAnalyzers | Interoperability
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1401](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1401) | P/Invokes should not be visible | 🛈 Suggestion |
| [CA1416](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1416) | Validate platform compatibility | ⚠ Warning |
| [CA1417](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1417) | Do not use _OutAttribute_ on string parameters for P/Invokes | ⚠ Warning |
| [CA1418](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1418) | Validate platform compatibility | ⚠ Warning |
| [CA1419](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1419) | Provide a parameterless ctor for types derived from
_System.Runtime.InteropServices.SafeHandle_| 🛈 Suggestion |
| [CA1420](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1420) | Property, type, or attribute requires runtime marshalling | ⚠ Warning |
| [CA1421](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1421) | Method uses runtime marshalling when *DisableRuntimeMarshalling* is applied | 🛈 Suggestion |
| [CA1422](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1422) | Validate platform compatibility - Obsoleted APIs | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1401.severity = suggestion
dotnet_diagnostic.CA1416.severity = warning
dotnet_diagnostic.CA1417.severity = warning
dotnet_diagnostic.CA1418.severity = warning
dotnet_diagnostic.CA1419.severity = suggestion
dotnet_diagnostic.CA1420.severity = warning
dotnet_diagnostic.CA1421.severity = suggestion
dotnet_diagnostic.CA1422.severity = warning
```
### Microsoft.CodeAnalysis.NetAnalyzers | Maintainability
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1501](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1501) | Avoid excessive inheritance | ⚠ Warning |
| [CA1502](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1502) | Avoid excessive complexity | ⚠ Warning |
| [CA1505](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1505) | Avoid unmaintainable code | ⚠ Warning |
| [CA1506](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1506) | Avoid excessive class coupling | ⚠ Warning |
| [CA1507](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1507) | Use _nameof_ in place of string | ⚠ Warning |
| [CA1508](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1508) | Avoid dead conditional code | ⚠ Warning |
| [CA1509](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1509) | Invalid entry in code metrics configuration file | ⛔ Error |
| [CA1510](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1510) | Use _ArgumentNullException_ throw helper | ⚠ Warning |
| [CA1511](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1511) | Use _ArgumentException_ throw helper | ⚠ Warning |
| [CA1512](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1512) | Use _ArgumentOutOfRangeException_ throw helper | ⚠ Warning |
| [CA1513](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1513) | Use _ObjectDisposedException_ throw helper | ⚠ Warning |
| [CA1514](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1514) | Avoid redundant length argument | ⚠ Warning |
| [CA1515](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1515) | Consider making public types internal | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1501.severity = warning
dotnet_diagnostic.CA1502.severity = warning
dotnet_diagnostic.CA1505.severity = warning
dotnet_diagnostic.CA1506.severity = warning
dotnet_diagnostic.CA1507.severity = warning
dotnet_diagnostic.CA1508.severity = warning
dotnet_diagnostic.CA1509.severity = error
dotnet_diagnostic.CA1510.severity = warning
dotnet_diagnostic.CA1511.severity = warning
dotnet_diagnostic.CA1512.severity = warning
dotnet_diagnostic.CA1513.severity = warning
dotnet_diagnostic.CA1514.severity = warning
dotnet_diagnostic.CA1515.severity = warning
```
### Microsoft.CodeAnalysis.NetAnalyzers | Naming
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :-----------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1700](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1700) | Do not name enum values _Reserved_ | 🛈 Suggestion |
| [CA1707](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1707) | Identifiers should not contain underscores | ⛔ Error |
| [CA1708](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1708) | Identifiers should differ by more than case | 🛈 Suggestion |
| [CA1710](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1710) | Identifiers should have correct suffix | ⚠ Warning |
| [CA1711](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1711) | Identifiers should not have incorrect suffix | ⚠ Warning |
| [CA1712](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1712) | Do not prefix enum values with type name | ⛔ Error |
| [CA1713](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1713) | Events should not have before or after prefix | ⚠ Warning |
| [CA1714](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1714) | Flags enums should have plural names | ⚠ Warning |
| [CA1715](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1715) | Identifiers should have correct prefix | ⚠ Warning |
| [CA1716](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1716) | Identifiers should not match keywords | ⚠ Warning |
| [CA1717](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1717) | Only _FlagsAttribute_ enums should have plural names | 🛈 Suggestion |
| [CA1721](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1721) | Property names should not match get methods | ⚠ Warning |
| [CA1720](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1720) | Identifiers should not contain type names | ⚠ Warning |
| [CA1724](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1724) | Type names should not match namespaces | ⚠ Warning |
| [CA1725](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1725) | Parameter names should match base declaration | ⚠ Warning |
| [CA1727](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1727) | Use PascalCase for named placeholders | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1700.severity = suggestion
dotnet_diagnostic.CA1707.severity = error
dotnet_diagnostic.CA1708.severity = suggestion
dotnet_diagnostic.CA1710.severity = warning
dotnet_diagnostic.CA1711.severity = warning
dotnet_diagnostic.CA1712.severity = error
dotnet_diagnostic.CA1713.severity = warning
dotnet_diagnostic.CA1714.severity = warning
dotnet_diagnostic.CA1715.severity = warning
dotnet_diagnostic.CA1716.severity = warning
dotnet_diagnostic.CA1717.severity = suggestion
dotnet_diagnostic.CA1720.severity = warning
dotnet_diagnostic.CA1721.severity = warning
dotnet_diagnostic.CA1724.severity = warning
dotnet_diagnostic.CA1725.severity = warning
dotnet_diagnostic.CA1727.severity = warning
```
### Microsoft.CodeAnalysis.NetAnalyzers | Performance
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA1802](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1802) | Use literals where appropriate | ⚠ Warning |
| [CA1805](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1805) | Do not initialize unnecessarily | ⚠ Warning |
| [CA1806](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1806) | Do not ignore method results | ⚠ Warning |
| [CA1810](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1810) | Initialize reference type static fields inline | ⚠ Warning |
| [CA1812](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1812) | Avoid uninstantiated internal classes | ⚠ Warning |
| [CA1813](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1813) | Avoid unsealed attributes | ⛔ Error |
| [CA1814](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1814) | Prefer jagged arrays over multidimensional | 🛈 Suggestion |
| [CA1815](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1815) | Override equals and operator equals on value types | ⚠ Warning |
| [CA1819](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1819) | Properties should not return arrays | ⚠ Warning |
| [CA1820](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1820) | Test for empty strings using string length | ⚠ Warning |
| [CA1821](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1821) | Remove empty finalizers | ⚠ Warning |
| [CA1822](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822) | Mark members as static | ⚠ Warning |
| [CA1823](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1823) | Avoid unused private fields | ⚠ Warning |
| [CA1824](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1824) | Mark assemblies with _NeutralResourcesLanguageAttribute_ | 🞅 None |
| [CA1825](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825) | Avoid zero-length array allocations | ⚠ Warning |
| [CA1826](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1826) | Use property instead of Linq Enumerable method | ⚠ Warning |
| [CA1827](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1827) | Do not use _Count_/_LongCount_ when _Any_ can be used | ⚠ Warning |
| [CA1828](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1828) | Do not use _CountAsync_/_LongCountAsync_ when _AnyAsync_ can be used | ⚠ Warning |
| [CA1829](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1829) | Use _Length_/_Count_ property instead of _Enumerable.Count_ method | ⚠ Warning |
| [CA1830](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1830) | Prefer strongly-typed _Append_ and _Insert_ method overloads on _StringBuilder_ | ⚠ Warning |
| [CA1831](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1831) | Use _AsSpan_ instead of Range-based indexers for string when appropriate | 🛈 Suggestion |
| [CA1832](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1832) | Use _AsSpan_ or _AsMemory_ instead of Range-based indexers for getting
ReadOnlySpan or ReadOnlyMemory [..] | 🛈 Suggestion |
| [CA1833](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1833) | Use _AsSpan_ or _AsMemory_ instead of Range-based indexers for getting
Span or Memory [..] | 🛈 Suggestion |
| [CA1834](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1834) | Use _StringBuilder.Append(char)_ for single character strings | ⚠ Warning |
| [CA1835](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1835) | Prefer the memory-based overloads of _ReadAsync_/_WriteAsync_ methods [..] | 🛈 Suggestion |
| [CA1836](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1836) | Prefer _IsEmpty_ over _Count_ when available | ⚠ Warning |
| [CA1837](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1837) | Use _Environment.ProcessId_ instead of _Process.GetCurrentProcess().Id_ | 🛈 Suggestion |
| [CA1838](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1838) | Avoid StringBuilder parameters for P/Invokes | 🛈 Suggestion |
| [CA1839](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1839) | Use _Environment.ProcessPath_ [..] | 🛈 Suggestion |
| [CA1840](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1840) | Use _Environment.CurrentManagedThreadId_ [..] | 🛈 Suggestion |
| [CA1841](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1841) | Prefer Dictionary Contains methods | ⚠ Warning |
| [CA1842](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1842) | Do not use _WhenAll_ with a single task | ⛔ Error |
| [CA1843](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1843) | Do not use _WaitAll_ with a single task | ⛔ Error |
| [CA1844](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1844) | Provide memory-based overrides of async methods when subclassing _Stream_ | ⚠ Warning |
| [CA1845](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1845) | Use span-based _string.Concat_ | ⚠ Warning |
| [CA1846](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1846) | Prefer _AsSpan_ over _Substring_ | ⚠ Warning |
| [CA1847](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1847) | Use _string.Contains(char)_ instead of _string.Contains(string)_ with single chars | ⚠ Warning |
| [CA1848](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1848) | Use the LoggerMessage delegates | 🛈 Suggestion |
| [CA1849](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1849) | Call async methods when in an async method | ⚠ Warning |
| [CA1850](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1850) | Prefer static _HashData_ method over _ComputeHash_ | 🞅 None |
| [CA1851](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1851) | Possible multiple enumerations of IEnumerable collection | ⚠ Warning |
| [CA1852](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1852) | Seal internal types | ⚠ Warning |
| [CA1853](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1853) | Unnecessary call to *Dictionary.ContainsKey(key)* | ⚠ Warning |
| [CA1854](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1854) | Prefer the *IDictionary.TryGetValue(TKey, out TValue)* method | 🛈 Suggestion |
| [CA1855](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1855) | Use *Span[T].Clear()* instead of *Span[T].Fill()* | 🛈 Suggestion |
| [CA1856](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1856) | Incorrect usage of _ConstantExpected_ attribute | ⛔ Error |
| [CA1857](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1857) | The parameter expects a constant for optimal performance | ⚠ Warning |
| [CA1858](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1858) | Use _StartsWith_ instead of _IndexOf_ | ⚠ Warning |
| [CA1859](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1859) | Use concrete types when possible for improved performance | 🛈 Suggestion |
| [CA1860](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1860) | Avoid using _Enumerable.Any()_ extension method | ⚠ Warning |
| [CA1861](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1861) | Avoid constant arrays as arguments | ⚠ Warning |
| [CA1862](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1862) | Use the _StringComparison_ method overloads for case-insensitive comparisons | ⚠ Warning |
| [CA1863](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1863) | Use _CompositeFormat_ | 🛈 Suggestion |
| [CA1864](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1864) | Prefer the _IDictionary.TryAdd(TKey, TValue)_ method | ⚠ Warning |
| [CA1865](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1865) | Use _string.Method(char)_ instead of _string.Method(string)_ for string with one char | ⚠ Warning |
| [CA1866](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1866) | Use _string.Method(char)_ instead of _string.Method(string)_ for string with one char | ⚠ Warning |
| [CA1867](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1867) | Use _string.Method(char)_ instead of _string.Method(string)_ for string with one char | 🛈 Suggestion |
| [CA1868](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1868) | Unnecessary call to _Contains_ for sets | ⚠ Warning |
| [CA1869](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1869) | Cache and reuse _JsonSerializerOptions_ instances | ⚠ Warning |
| [CA1870](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1870) | Use a cached _SearchValues_ instance | ⚠ Warning |
| [CA1871](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1871) | Do not pass a nullable struct to _ArgumentNullException.ThrowIfNull_ | ⚠ Warning |
| [CA1872](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1872) | Prefer *Convert.ToHexString* and *Convert.ToHexStringLower* over call chains based on _BitConverter.ToString_ | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA1802.severity = warning
dotnet_diagnostic.CA1805.severity = warning
dotnet_diagnostic.CA1806.severity = warning
dotnet_diagnostic.CA1810.severity = warning
dotnet_diagnostic.CA1812.severity = warning
dotnet_diagnostic.CA1813.severity = error
dotnet_diagnostic.CA1814.severity = suggestion
dotnet_diagnostic.CA1815.severity = warning
dotnet_diagnostic.CA1819.severity = warning
dotnet_diagnostic.CA1820.severity = warning
dotnet_diagnostic.CA1821.severity = warning
dotnet_diagnostic.CA1822.severity = warning
dotnet_diagnostic.CA1823.severity = warning
dotnet_diagnostic.CA1824.severity = none
dotnet_diagnostic.CA1825.severity = warning
dotnet_diagnostic.CA1826.severity = warning
dotnet_diagnostic.CA1827.severity = warning
dotnet_diagnostic.CA1828.severity = warning
dotnet_diagnostic.CA1829.severity = warning
dotnet_diagnostic.CA1830.severity = warning
dotnet_diagnostic.CA1831.severity = suggestion
dotnet_diagnostic.CA1832.severity = suggestion
dotnet_diagnostic.CA1833.severity = suggestion
dotnet_diagnostic.CA1834.severity = warning
dotnet_diagnostic.CA1835.severity = suggestion
dotnet_diagnostic.CA1836.severity = warning
dotnet_diagnostic.CA1837.severity = suggestion
dotnet_diagnostic.CA1838.severity = suggestion
dotnet_diagnostic.CA1839.severity = suggestion
dotnet_diagnostic.CA1840.severity = suggestion
dotnet_diagnostic.CA1841.severity = warning
dotnet_diagnostic.CA1842.severity = error
dotnet_diagnostic.CA1843.severity = error
dotnet_diagnostic.CA1844.severity = warning
dotnet_diagnostic.CA1845.severity = warning
dotnet_diagnostic.CA1846.severity = warning
dotnet_diagnostic.CA1847.severity = warning
dotnet_diagnostic.CA1848.severity = suggestion
dotnet_diagnostic.CA1849.severity = warning
dotnet_diagnostic.CA1850.severity = none
dotnet_diagnostic.CA1851.severity = warning
dotnet_diagnostic.CA1852.severity = warning
dotnet_diagnostic.CA1853.severity = warning
dotnet_diagnostic.CA1854.severity = suggestion
dotnet_diagnostic.CA1855.severity = suggestion
dotnet_diagnostic.CA1856.severity = error
dotnet_diagnostic.CA1857.severity = warning
dotnet_diagnostic.CA1858.severity = warning
dotnet_diagnostic.CA1859.severity = suggestion
dotnet_diagnostic.CA1860.severity = warning
dotnet_diagnostic.CA1861.severity = warning
dotnet_diagnostic.CA1862.severity = warning
dotnet_diagnostic.CA1863.severity = suggestion
dotnet_diagnostic.CA1864.severity = warning
dotnet_diagnostic.CA1865.severity = warning
dotnet_diagnostic.CA1866.severity = warning
dotnet_diagnostic.CA1867.severity = suggestion
dotnet_diagnostic.CA1868.severity = warning
dotnet_diagnostic.CA1869.severity = warning
dotnet_diagnostic.CA1870.severity = warning
dotnet_diagnostic.CA1871.severity = warning
dotnet_diagnostic.CA1872.severity = warning
```
### Microsoft.CodeAnalysis.NetAnalyzers | Reliability
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA2000](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2000) | Dispose objects before losing scope | 🛈 Suggestion |
| [CA2002](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2002) | Do not lock on objects with weak identity | ⛔ Error |
| [CA2007](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2007) | Do not directly await a Task | 🞅 None |
| [CA2008](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2008) | Do not create tasks without passing a _TaskScheduler_ | 🛈 Suggestion |
| [CA2009](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2009) | Do not call _ToImmutableCollection_ on an _ImmutableCollection_ value | ⚠ Warning |
| [CA2011](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2011) | Do not assign property within its setter | ⛔ Error |
| [CA2012](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2012) | Use _ValueTasks_ correctly | 🛈 Suggestion |
| [CA2013](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2013) | Do not use _ReferenceEquals_ with value types | ⚠ Warning |
| [CA2014](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2014) | Do not use _stackalloc_ in loops | ⚠ Warning |
| [CA2015](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2015) | Do not define finalizers for types derived from _MemoryManager_ | ⚠ Warning |
| [CA2016](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2016) | Forward the _CancellationToken_ parameter to methods that take one | ⚠ Warning |
| [CA2017](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2017) | Parameter count mismatch | ⚠ Warning |
| [CA2018](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2018) | The count argument to _Buffer.BlockCopy_ should specify the number of bytes [..] | ⚠ Warning |
| [CA2019](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2019) | *ThreadStatic* fields should not use inline initialization | 🛈 Suggestion |
| [CA2020](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2020) | Prevent behavioral change caused by built-in operators of *IntPtr/UIntPtr* | 🛈 Suggestion |
| [CA2021](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2021) | Don't call _Enumerable.Cast_ or _Enumerable.OfType_ with incompatible types | ⚠ Warning |
| [CA2022](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2022) | Avoid inexact read with *Stream.Read* | ⚠ Warning |
.editorconfig
``` EditorConfig
dotnet_diagnostic.CA2000.severity = suggestion
dotnet_diagnostic.CA2002.severity = error
dotnet_diagnostic.CA2007.severity = none
dotnet_diagnostic.CA2008.severity = suggestion
dotnet_diagnostic.CA2009.severity = warning
dotnet_diagnostic.CA2011.severity = error
dotnet_diagnostic.CA2012.severity = suggestion
dotnet_diagnostic.CA2013.severity = warning
dotnet_diagnostic.CA2014.severity = warning
dotnet_diagnostic.CA2015.severity = warning
dotnet_diagnostic.CA2016.severity = warning
dotnet_diagnostic.CA2017.severity = warning
dotnet_diagnostic.CA2018.severity = warning
dotnet_diagnostic.CA2019.severity = suggestion
dotnet_diagnostic.CA2020.severity = suggestion
dotnet_diagnostic.CA2021.severity = warning
dotnet_diagnostic.CA2022.severity = warning
```
### Microsoft.CodeAnalysis.NetAnalyzers | Security
| Code | Description ___________________________________________________________________________ | !! Severity !! |
| :-----------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------- | :------------: |
| [CA2100](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2100) | Review SQL queries for security vulnerabilities | ⚠ Warning |
| [CA2109](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2109) | Review visible event handlers | ⚠ Warning |
| [CA2119](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2119) | Seal methods that satisfy private interfaces | ⚠ Warning |
| [CA2153](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2153) | Avoid handling Corrupted State Exceptions | ⚠ Warning |
| [CA2300](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2300) | Do not use insecure deserializer BinaryFormatter | ⛔ Error |
| [CA2301](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2301) | Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder | 🞅 None |
| [CA2302](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2302) | Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize | 🞅 None |
| [CA2305](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2305) | Do not use insecure deserializer LosFormatter | ⛔ Error |
| [CA2310](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2310) | Do not use insecure deserializer NetDataContractSerializer | ⛔ Error |
| [CA2311](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2311) | Do not deserialize without first setting NetDataContractSerializer.Binder | 🞅 None |
| [CA2312](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2312) | Ensure NetDataContractSerializer.Binder is set before deserializing | 🞅 None |
| [CA2315](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2315) | Do not use insecure deserializer ObjectStateFormatter | ⛔ Error |
| [CA2321](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2321) | Do not deserialize with JavaScriptSerializer using a SimpleTypeResolver | ⚠ Warning |
| [CA2322](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2322) | Ensure JavaScriptSerializer is not initialized with SimpleTypeResolver [..] | ⚠ Warning |
| [CA2326](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2326) | Do not use TypeNameHandling values other than None | ⚠ Warning |
| [CA2327](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2327) | Do not use insecure JsonSerializerSettings