JetBrains Fleet 1.36 Help

List of code inspections in C#

This topic lists code inspections available in C#. Under each inspection, you can see the EditorConfig property that you can use to configure that inspection.

Inspection settings in .editorconfig files are configured similarly to other properties — by adding the corresponding lines:

[inspection_property]=[error | warning | suggestion | hint | none]

For example, you can change the severity level of the Possible 'System.NullReferenceException' inspection to Error with the following line:

resharper_possible_null_reference_exception_highlighting=error

or you can disable the Redundant argument with default value inspection with the following line:

resharper_redundant_argument_default_value_highlighting=none

Code Notification (2 inspections)

This category groups code inspections with minor severity levels.

Inspection


EditorConfig property

Default severity

Method invocation is skipped


resharper_invocation_is_skipped_highlighting

Hint

Part of the code cannot be parsed


resharper_non_parsable_element_highlighting

Warning

Common Practices and Code Improvements (165 inspections)

This category groups inspections that hunt for medium severity issues that mainly affect code readability.

Inspection


EditorConfig property

Default severity

Access to a static member of a type via a derived type


resharper_access_to_static_member_via_derived_type_highlighting

Warning

Add explicit 'return' or 'continue' before local functions


resharper_separate_local_functions_with_jump_statement_highlighting

Hint

Annotation duplicate in hierarchy


resharper_annotation_redundancy_in_hierarchy_highlighting

Warning

Auto-property can be made get-only (non-private accessibility)


resharper_auto_property_can_be_made_get_only_global_highlighting

Suggestion

Auto-property can be made get-only (private accessibility)


resharper_auto_property_can_be_made_get_only_local_highlighting

Suggestion

Base member has 'params' parameter, but the overrider does not have it


resharper_base_member_has_params_highlighting

Warning

Can simplify 'Contains' before 'Add'


resharper_can_simplify_set_adding_with_single_call_highlighting

Suggestion

Check for reference equality instead


resharper_check_for_reference_equality_instead_1_highlighting

Suggestion

Check for reference equality instead


resharper_check_for_reference_equality_instead_3_highlighting

Suggestion

Check for reference equality instead


resharper_check_for_reference_equality_instead_2_highlighting

Suggestion

Check for reference equality instead


resharper_check_for_reference_equality_instead_4_highlighting

Suggestion

Class can be made sealed (non-inheritable) (non-private accessibility)


resharper_class_can_be_sealed_global_highlighting

Disabled

Class can be made sealed (non-inheritable) (private accessibility)


resharper_class_can_be_sealed_local_highlighting

Disabled

Container nullability attribute usage with declaration of non-container type


resharper_container_annotation_redundancy_highlighting

Warning

Convert 'if do while' into 'while'


resharper_convert_if_do_to_while_highlighting

Suggestion

Convert 'if' into '||'


resharper_convert_if_to_or_expression_highlighting

Suggestion

Convert local variable or field into constant (non-private accessibility)


resharper_convert_to_constant_global_highlighting

Hint

Convert local variable or field into constant (private accessibility)


resharper_convert_to_constant_local_highlighting

Hint

Declaration nullability inferred (parameter is inferred to be not null)


resharper_annotate_not_null_parameter_highlighting

Disabled

Declaration nullability inferred (parameter is inferred to be nullable)


resharper_annotate_can_be_null_parameter_highlighting

Disabled

Declaration nullability inferred (type member is inferred to be not null)


resharper_annotate_not_null_type_member_highlighting

Disabled

Declaration nullability inferred (type member is inferred to be nullable)


resharper_annotate_can_be_null_type_member_highlighting

Disabled

Dictionary item removal can be simplified with single 'Remove'


resharper_can_simplify_dictionary_removing_with_single_call_highlighting

Suggestion

Dictionary lookup can be simplified with 'GetValueOrDefault'


resharper_can_simplify_dictionary_try_get_value_with_get_value_or_default_highlighting

Suggestion

Dictionary lookup can be simplified with 'TryAdd'


resharper_can_simplify_dictionary_lookup_with_try_add_highlighting

Suggestion

Dictionary lookup can be simplified with 'TryGetValue'


resharper_can_simplify_dictionary_lookup_with_try_get_value_highlighting

Suggestion

Empty control statement body


resharper_empty_embedded_statement_highlighting

Warning

Empty statement is redundant


resharper_empty_statement_highlighting

Warning

Extract common property pattern


resharper_extract_common_property_pattern_highlighting

Hint

Field can be made readonly (non-private accessibility)


resharper_field_can_be_made_read_only_global_highlighting

Suggestion

Field can be made readonly (private accessibility)


resharper_field_can_be_made_read_only_local_highlighting

Suggestion

Get-only auto-property is never assigned


resharper_unassigned_get_only_auto_property_highlighting

Warning

Invert condition


resharper_invert_condition_1_highlighting

Hint

Iteration variable can be declared with a more specific type


resharper_more_specific_foreach_variable_type_available_highlighting

Suggestion

Join local variable declaration and assignment


resharper_join_declaration_and_initializer_highlighting

Suggestion

Local function can be made static


resharper_local_function_can_be_made_static_highlighting

Disabled

Local variable has too wide declaration scope


resharper_too_wide_local_variable_scope_highlighting

Suggestion

Make constructor in abstract class protected


resharper_public_constructor_in_abstract_class_highlighting

Suggestion

Member can be made private (non-private accessibility)


resharper_member_can_be_private_global_highlighting

Suggestion

Member can be made private (private accessibility)


resharper_member_can_be_private_local_highlighting

Suggestion

Member can be made protected (non-private accessibility)


resharper_member_can_be_protected_global_highlighting

Suggestion

Member can be made protected (private accessibility)


resharper_member_can_be_protected_local_highlighting

Suggestion

Member can be made static (shared) (non-private accessibility)


resharper_member_can_be_made_static_global_highlighting

Hint

Member can be made static (shared) (private accessibility)


resharper_member_can_be_made_static_local_highlighting

Hint

Member or type can be made internal (friend)


resharper_member_can_be_internal_highlighting

Disabled

Method has async overload


resharper_method_has_async_overload_highlighting

Suggestion

Method has async overload with cancellation support


resharper_method_has_async_overload_with_cancellation_highlighting

Suggestion

Method supports cancellation


resharper_method_supports_cancellation_highlighting

Suggestion

Missing XML comment for private or internal type or member


resharper_internal_or_private_member_not_documented_highlighting

Disabled

Multiple nullable attributes usage


resharper_multiple_nullable_attributes_usage_highlighting

Warning

Nested string interpolation can be inlined


resharper_nested_string_interpolation_highlighting

Suggestion

Nullability attribute usage with declaration of void or value type


resharper_annotation_redundancy_at_value_type_highlighting

Warning

Nullability attribute used with declaration that cannot be directly referenced from other code


resharper_not_observable_annotation_redundancy_highlighting

Warning

Parameter can be declared with the base type


resharper_suggest_base_type_for_parameter_highlighting

Hint

Parameter of the constructor can be declared with the base type


resharper_suggest_base_type_for_parameter_in_constructor_highlighting

Hint

Parameter type can be IEnumerable<T> (non-private accessibility)


resharper_parameter_type_can_be_enumerable_global_highlighting

Hint

Parameter type can be IEnumerable<T> (private accessibility)


resharper_parameter_type_can_be_enumerable_local_highlighting

Hint

Possible mistaken argument


resharper_possible_mistaken_argument_highlighting

Warning

Possible mistaken call to GetType()


resharper_possible_mistaken_call_to_get_type_1_highlighting

Warning

Possible mistaken call to GetType()


resharper_possible_mistaken_call_to_get_type_2_highlighting

Warning

Property can be made init-only (non-private accessibility)


resharper_property_can_be_made_init_only_global_highlighting

Suggestion

Property can be made init-only (private accessibility)


resharper_property_can_be_made_init_only_local_highlighting

Suggestion

Put local function after 'return' or 'continue'


resharper_move_local_function_after_jump_statement_highlighting

Hint

Redundant 'is'


resharper_redundant_is_before_relational_pattern_highlighting

Suggestion

Remove constructor invocation


resharper_remove_constructor_invocation_highlighting

Disabled

Remove redundant statement


resharper_remove_redundant_or_statement_false_highlighting

Suggestion

Remove redundant statement


resharper_remove_redundant_or_statement_true_highlighting

Suggestion

Remove ToList()


resharper_remove_to_list_1_highlighting

Suggestion

Remove ToList()


resharper_remove_to_list_2_highlighting

Suggestion

Replace 'async' code with 'Task'-return


resharper_replace_async_with_task_return_highlighting

Disabled

Replace with FirstOrDefault($args$)


resharper_replace_with_first_or_default_1_highlighting

Suggestion

Replace with FirstOrDefault($args$)


resharper_replace_with_first_or_default_2_highlighting

Suggestion

Replace with FirstOrDefault($args$)


resharper_replace_with_first_or_default_3_highlighting

Suggestion

Replace with FirstOrDefault($args$)


resharper_replace_with_first_or_default_4_highlighting

Suggestion

Replace with LastOrDefault($args$)


resharper_replace_with_last_or_default_1_highlighting

Suggestion

Replace with LastOrDefault($args$)


resharper_replace_with_last_or_default_2_highlighting

Suggestion

Replace with LastOrDefault($args$)


resharper_replace_with_last_or_default_3_highlighting

Suggestion

Replace with LastOrDefault($args$)


resharper_replace_with_last_or_default_4_highlighting

Suggestion

Replace with OfType<T>()


resharper_replace_with_of_type_1_highlighting

Suggestion

Replace with OfType<T>()


resharper_replace_with_of_type_2_highlighting

Suggestion

Replace with OfType<T>()


resharper_replace_with_of_type_3_highlighting

Suggestion

Replace with OfType<T>().Any()


resharper_replace_with_of_type_any_1_highlighting

Suggestion

Replace with OfType<T>().Any() (replace with OfType<T>().Any(..))


resharper_replace_with_of_type_any_2_highlighting

Suggestion

Replace with OfType<T>().Count()


resharper_replace_with_of_type_count_1_highlighting

Suggestion

Replace with OfType<T>().Count() (replace with OfType<T>().Count(..))


resharper_replace_with_of_type_count_2_highlighting

Suggestion

Replace with OfType<T>().First()


resharper_replace_with_of_type_first_1_highlighting

Suggestion

Replace with OfType<T>().First() (replace with OfType<T>().First(..))


resharper_replace_with_of_type_first_2_highlighting

Suggestion

Replace with OfType<T>().FirstOrDefault()


resharper_replace_with_of_type_first_or_default_1_highlighting

Suggestion

Replace with OfType<T>().FirstOrDefault() (replace with OfType<T>().FirstOrDefault(..))


resharper_replace_with_of_type_first_or_default_2_highlighting

Suggestion

Replace with OfType<T>().Last()


resharper_replace_with_of_type_last_1_highlighting

Suggestion

Replace with OfType<T>().Last() (replace with OfType<T>().Last(..))


resharper_replace_with_of_type_last_2_highlighting

Suggestion

Replace with OfType<T>().LastOrDefault()


resharper_replace_with_of_type_last_or_default_1_highlighting

Suggestion

Replace with OfType<T>().LastOrDefault() (replace with OfType<T>().LastOrDefault(..))


resharper_replace_with_of_type_last_or_default_2_highlighting

Suggestion

Replace with OfType<T>().LongCount()


resharper_replace_with_of_type_long_count_highlighting

Suggestion

Replace with OfType<T>().Single()


resharper_replace_with_of_type_single_1_highlighting

Suggestion

Replace with OfType<T>().Single() (replace with OfType<T>().Single(..))


resharper_replace_with_of_type_single_2_highlighting

Suggestion

Replace with OfType<T>().SingleOrDefault()


resharper_replace_with_of_type_single_or_default_1_highlighting

Suggestion

Replace with OfType<T>().SingleOrDefault() (replace with OfType<T>().SingleOrDefault(..))


resharper_replace_with_of_type_single_or_default_2_highlighting

Suggestion

Replace with OfType<T>().Where() (replace with OfType<T>().Where(..))


resharper_replace_with_of_type_where_highlighting

Suggestion

Replace with simple assignment


resharper_replace_with_simple_assignment_true_highlighting

Suggestion

Replace with simple assignment


resharper_replace_with_simple_assignment_false_highlighting

Suggestion

Replace with single assignment


resharper_replace_with_single_assignment_false_highlighting

Suggestion

Replace with single assignment


resharper_replace_with_single_assignment_true_highlighting

Suggestion

Replace with single call to Any(..)


resharper_replace_with_single_call_to_any_highlighting

Suggestion

Replace with single call to Count(..)


resharper_replace_with_single_call_to_count_highlighting

Suggestion

Replace with single call to First(..)


resharper_replace_with_single_call_to_first_highlighting

Suggestion

Replace with single call to FirstOrDefault(..)


resharper_replace_with_single_call_to_first_or_default_highlighting

Suggestion

Replace with single call to Last(..)


resharper_replace_with_single_call_to_last_highlighting

Suggestion

Replace with single call to LastOrDefault(..)


resharper_replace_with_single_call_to_last_or_default_highlighting

Suggestion

Replace with single call to Single(..)


resharper_replace_with_single_call_to_single_highlighting

Suggestion

Replace with single call to SingleOrDefault(..)


resharper_replace_with_single_call_to_single_or_default_highlighting

Suggestion

Replace with SingleOrDefault($args$)


resharper_replace_with_single_or_default_1_highlighting

Suggestion

Replace with SingleOrDefault($args$)


resharper_replace_with_single_or_default_2_highlighting

Suggestion

Replace with SingleOrDefault($args$)


resharper_replace_with_single_or_default_3_highlighting

Suggestion

Replace with SingleOrDefault($args$)


resharper_replace_with_single_or_default_4_highlighting

Suggestion

Return type can be IEnumerable<T> (non-private accessibility)


resharper_return_type_can_be_enumerable_global_highlighting

Hint

Return type can be IEnumerable<T> (private accessibility)


resharper_return_type_can_be_enumerable_local_highlighting

Hint

Simplify conditional ternary expression


resharper_simplify_conditional_ternary_expression_highlighting

Suggestion

Simplify LINQ expression (use 'All')


resharper_simplify_linq_expression_use_all_highlighting

Suggestion

Simplify LINQ expression (use 'Any')


resharper_simplify_linq_expression_use_any_highlighting

Suggestion

Simplify negated pattern


resharper_double_negation_in_pattern_highlighting

Suggestion

Simplify negated relational pattern


resharper_negation_of_relational_pattern_highlighting

Suggestion

Simplify negative equality expression


resharper_negative_equality_expression_highlighting

Suggestion

Specify string comparison explicitly


resharper_specify_string_comparison_highlighting

Hint

Specify string culture explicitly


resharper_specify_a_culture_in_string_conversion_explicitly_highlighting

Warning

String literal can be inlined


resharper_string_literal_as_interpolation_argument_highlighting

Suggestion

String.Compare is culture-specific (string.Compare(string, int, string, int) is culture-specific)


resharper_string_compare_is_culture_specific_4_highlighting

Warning

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific)


resharper_string_compare_is_culture_specific_5_highlighting

Warning

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific)


resharper_string_compare_is_culture_specific_6_highlighting

Warning

String.Compare is culture-specific (string.Compare(string, string) is culture-specific)


resharper_string_compare_is_culture_specific_1_highlighting

Warning

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific)


resharper_string_compare_is_culture_specific_2_highlighting

Warning

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific)


resharper_string_compare_is_culture_specific_3_highlighting

Warning

String.CompareTo is culture-specific


resharper_string_compare_to_is_culture_specific_highlighting

Warning

String.EndsWith is culture-specific (string.EndsWith(string) is culture-specific)


resharper_string_ends_with_is_culture_specific_highlighting

Disabled

String.IndexOf is culture-specific (string.IndexOf(string) is culture-specific)


resharper_string_index_of_is_culture_specific_1_highlighting

Warning

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific)


resharper_string_index_of_is_culture_specific_2_highlighting

Warning

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific)


resharper_string_index_of_is_culture_specific_3_highlighting

Warning

String.LastIndexOf is culture-specific (string.LastIndexOf(string) is culture-specific)


resharper_string_last_index_of_is_culture_specific_1_highlighting

Warning

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific)


resharper_string_last_index_of_is_culture_specific_2_highlighting

Warning

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific)


resharper_string_last_index_of_is_culture_specific_3_highlighting

Warning

String.StartsWith is culture-specific (string.StartsWith(string) is culture-specific)


resharper_string_starts_with_is_culture_specific_highlighting

Disabled

Struct can be made readonly


resharper_struct_can_be_made_read_only_highlighting

Suggestion

Struct member can be made readonly


resharper_struct_member_can_be_made_read_only_highlighting

Disabled

try-catch and try-finally statements can be merged


resharper_try_statements_can_be_merged_highlighting

Hint

Type can be made file-local


resharper_member_can_be_file_local_highlighting

Disabled

Type parameter could be declared as covariant or contravariant


resharper_type_parameter_can_be_variant_highlighting

Suggestion

Use 'ArgumentNullException.ThrowIfNull'


resharper_use_throw_if_null_method_highlighting

Disabled

Use array creation expression


resharper_use_array_creation_expression_1_highlighting

Suggestion

Use array creation expression


resharper_use_array_creation_expression_2_highlighting

Suggestion

Use 'Array.Empty<T>()'


resharper_use_array_empty_method_highlighting

Suggestion

Use cancellation token


resharper_use_cancellation_token_for_i_async_enumerable_highlighting

Suggestion

Use compiler-supported nullable attributes


resharper_use_nullable_attributes_supported_by_compiler_highlighting

Suggestion

Use 'EventArgs.Empty'


resharper_use_event_args_empty_field_highlighting

Suggestion

Use indexed property


resharper_use_indexed_property_highlighting

Suggestion

Use 'is' operator


resharper_use_is_operator_1_highlighting

Suggestion

Use 'is' operator


resharper_use_is_operator_2_highlighting

Suggestion

Use method Any()


resharper_use_method_any_0_highlighting

Suggestion

Use method Any()


resharper_use_method_any_1_highlighting

Suggestion

Use method Any()


resharper_use_method_any_2_highlighting

Suggestion

Use method Any()


resharper_use_method_any_3_highlighting

Suggestion

Use method Any()


resharper_use_method_any_4_highlighting

Suggestion

Use method IsInstanceOfType(..)


resharper_use_method_is_instance_of_type_highlighting

Suggestion

Use 'MinBy' or 'MaxBy' instead of ordering and taking 'First' or 'Last'


resharper_simplify_linq_expression_use_min_by_and_max_by_highlighting

Suggestion

Use 'String.IsNullOrEmpty'


resharper_replace_with_string_is_null_or_empty_highlighting

Suggestion

Use 'Type.EmptyTypes'


resharper_use_empty_types_field_highlighting

Suggestion

Compiler Warnings (194 inspections)

Inspections in this category detect compiler warnings before you compile.

Inspection


EditorConfig property

Default severity

'#warning' directive


resharper_c_sharp_warnings_cs1030_highlighting

Warning

[InterpolatedStringHandlerArgument] has no effect when applied to lambda parameters and will be ignored at the call site.


resharper_c_sharp_warnings_cs8971_highlighting

Warning

A default value is specified for 'ref readonly' parameter, but 'ref readonly' should be used only for references. Consider declaring the parameter as 'in'.


resharper_c_sharp_warnings_cs9200_highlighting

Warning

A local variable is returned by reference but was initialized to a value that cannot be returned by reference.


resharper_c_sharp_warnings_cs9082_highlighting

Warning

A member of a variable is returned by reference but was initialized to a value that cannot be returned by reference


resharper_c_sharp_warnings_cs9083_highlighting

Warning

A method marked [DoesNotReturn] should not return.


resharper_c_sharp_warnings_cs8763_highlighting

Warning

A possible null value may not be used for a type marked with [NotNull] or [DisallowNull].


resharper_c_sharp_warnings_cs8607_highlighting

Warning

A previous catch clause already catches all exceptions


resharper_c_sharp_warnings_cs1058_highlighting

Warning

A result of a stackalloc expression in this context may be exposed outside of the containing method.


resharper_c_sharp_warnings_cs9081_highlighting

Warning

Access to a member through 'base' keyword from anonymous method, lambda expression, query expression or iterator results in unverifiable code


resharper_c_sharp_warnings_cs1911_highlighting

Warning

Alignment value 'value' has a magnitude greater than 'magnitude limit' and may result in a large formatted string.


resharper_c_sharp_warnings_cs8094_highlighting

Warning

Ambiguous reference in XML comment


resharper_c_sharp_warnings_cs1574_highlighting

Warning

Argument cannot be used as an output for parameter due to differences in the nullability of reference types.


resharper_c_sharp_warnings_cs8624_highlighting

Warning

Argument cannot be used for corresponding parameter due to differences in the nullability of reference types.


resharper_c_sharp_warnings_cs8620_highlighting

Warning

Argument should be a variable because it is passed to a 'ref readonly' parameter.


resharper_c_sharp_warnings_cs9193_highlighting

Warning

Argument should be passed with the 'in' keyword.


resharper_c_sharp_warnings_cs9195_highlighting

Warning

Assignment in conditional expression


resharper_c_sharp_warnings_cs0665_highlighting

Warning

Assignment made to same variable


resharper_c_sharp_warnings_cs1717_highlighting

Warning

Async function without await expression


resharper_c_sharp_warnings_cs1998_highlighting

Warning

Async method invocation without await expression


resharper_c_sharp_warnings_cs4014_highlighting

Warning

Asynchronous 'Main' method will not be used as an entry point because a synchronous entry point was found.


resharper_c_sharp_warnings_cs8892_highlighting

Warning

Async-iterator has one or more parameters of type 'CancellationToken' but none of them is annotated with the 'EnumeratorCancellation' attribute.


resharper_c_sharp_warnings_cs8425_highlighting

Warning

'attribute modifier' is not a recognized attribute location. All attributes in this block will be ignored


resharper_c_sharp_warnings_cs0658_highlighting

Warning

'attribute modifier' is not a valid attribute location for this declaration. All attributes in this block will be ignored


resharper_c_sharp_warnings_cs0657_highlighting

Warning

Badly formed XML in included comments file


resharper_c_sharp_warnings_cs1592_highlighting

Warning

Bitwise-or operator used on a sign-extended operand.


resharper_c_sharp_warnings_cs0675_highlighting

Warning

Call to a non-readonly member from a 'readonly' member results in an implicit copy of 'this'


resharper_c_sharp_warnings_cs8656_highlighting

Warning

Cannot convert null literal to non-nullable reference type.


resharper_c_sharp_warnings_cs8625_highlighting

Warning

Cannot resolve reference in XML comment


resharper_c_sharp_warnings_cs1574_cs1584_cs1581_cs1580_highlighting

Warning

Class overrides Object.Equals(object o) but not Object.GetHashCode()


resharper_c_sharp_warnings_cs0659_highlighting

Warning

Code is unreachable


resharper_c_sharp_warnings_cs0162_highlighting

Warning

Collection expression may incur unexpected heap allocations


resharper_c_sharp_warnings_cs9208_highlighting

Warning

Collection expression may incur unexpected heap allocations due to the use of '..' spreads


resharper_c_sharp_warnings_cs9209_highlighting

Warning

Comparing with null of nullable value type always produces 'false'


resharper_c_sharp_warnings_cs0464_highlighting

Warning

Comparison to integral constant is useless; the constant is outside the range of type 'type'.


resharper_c_sharp_warnings_cs0652_highlighting

Warning

Converting method group to non-delegate type 'object'.


resharper_c_sharp_warnings_cs8974_highlighting

Warning

Converting null literal or possible null value to non-nullable type.


resharper_c_sharp_warnings_cs8600_highlighting

Warning

Declaring new protected member in sealed class is the same as declaring it as private


resharper_c_sharp_warnings_cs0628_highlighting

Warning

Default value specified for parameter will have no effect because it applies to a member that is used in contexts that do not allow optional arguments


resharper_c_sharp_warnings_cs1066_highlighting

Warning

Dereference of a possibly null reference.


resharper_c_sharp_warnings_cs8602_highlighting

Warning

Duplicate param tag in XML comment


resharper_c_sharp_warnings_cs1571_highlighting

Warning

Duplicate typeparam tag in XML comment


resharper_c_sharp_warnings_cs1710_highlighting

Warning

Empty switch block


resharper_c_sharp_warnings_cs1522_highlighting

Warning

Field is never used


resharper_unused_field_compiler_highlighting

Warning

Filter expression is a constant, consider removing the filter


resharper_c_sharp_warnings_cs7095_highlighting

Warning

Given expression always matches the provided pattern


resharper_c_sharp_warnings_cs8794_highlighting

Warning

Given expression is always of the provided type


resharper_c_sharp_warnings_cs0183_highlighting

Warning

Given expression is never of the provided type


resharper_c_sharp_warnings_cs0184_highlighting

Warning

'goto case' value is not implicitly convertible to required type


resharper_c_sharp_warnings_cs0469_highlighting

Warning

Incorrect signature in XML comment


resharper_c_sharp_warnings_cs1580_highlighting

Warning

Inline array conversion operator will not be used for conversion from expression of the declaring type.


resharper_c_sharp_warnings_cs9183_highlighting

Warning

Inline array indexer will not be used for element access expression.


resharper_c_sharp_warnings_cs9181_highlighting

Warning

Inline array 'Slice' method will not be used for element access expression.


resharper_c_sharp_warnings_cs9182_highlighting

Warning

'Inline arrays' language feature is not supported for inline array types with element field which is either a 'ref' field, or has type that is not valid as a type argument.


resharper_c_sharp_warnings_cs9184_highlighting

Warning

Introducing a 'Finalize' method can interfere with destructor invocation


resharper_c_sharp_warnings_cs0465_highlighting

Warning

Invalid XML in XML comment


resharper_c_sharp_warnings_cs1570_highlighting

Warning

Invalid XML include element


resharper_c_sharp_warnings_cs1590_highlighting

Warning

Keyword 'new' is redundant


resharper_c_sharp_warnings_cs0109_highlighting

Warning

Keyword 'new' is required


resharper_c_sharp_warnings_cs0108_cs0114_highlighting

Warning

Member cannot be used in this attribute.


resharper_c_sharp_warnings_cs8776_highlighting

Warning

Member must conditionally have a non-null value when exiting a function.


resharper_c_sharp_warnings_cs8775_highlighting

Warning

Member must have a non-null value when exiting.


resharper_c_sharp_warnings_cs8774_highlighting

Warning

Member overrides obsolete member


resharper_c_sharp_warnings_cs0672_highlighting

Warning

Method lacks '[DoesNotReturn]' annotation in order to match implemented or overridden member.


resharper_c_sharp_warnings_cs8770_highlighting

Warning

Missing XML comment for publicly visible type or member


resharper_c_sharp_warnings_cs1591_highlighting

Warning

Multiple override candidates at run-time


resharper_c_sharp_warnings_cs1957_highlighting

Warning

Namespace should be default namespace of this project


resharper_c_sharp_warnings_wme006_highlighting

Warning

Non-accessed field


resharper_not_accessed_field_compiler_highlighting

Warning

Non-accessed local variable


resharper_not_accessed_variable_compiler_highlighting

Warning

Non-nullable member is uninitialized.


resharper_c_sharp_warnings_cs8618_highlighting

Warning

Nullability mismatch in constraints for type parameter.


resharper_c_sharp_warnings_cs8633_highlighting

Warning

Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.


resharper_c_sharp_warnings_cs8643_highlighting

Warning

Nullability of reference types in interface implemented by the base type doesn't match.


resharper_c_sharp_warnings_cs8644_highlighting

Warning

Nullability of reference types in return type doesn't match implemented member.


resharper_c_sharp_warnings_cs8616_highlighting

Warning

Nullability of reference types in return type doesn't match implicitly implemented member.


resharper_c_sharp_warnings_cs8613_highlighting

Warning

Nullability of reference types in return type doesn't match overridden member.


resharper_c_sharp_warnings_cs8609_highlighting

Warning

Nullability of reference types in return type doesn't match partial method declaration.


resharper_c_sharp_warnings_cs8819_highlighting

Warning

Nullability of reference types in return type doesn't match the target delegate (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8621_highlighting

Warning

Nullability of reference types in return type in interceptor method doesn't match interceptable method'


resharper_c_sharp_warnings_cs9159_highlighting

Warning

Nullability of reference types in source type doesn't match target type.


resharper_c_sharp_warnings_cs8619_highlighting

Warning

Nullability of reference types in type doesn't match implemented member.


resharper_c_sharp_warnings_cs8615_highlighting

Warning

Nullability of reference types in type doesn't match implicitly implemented member.


resharper_c_sharp_warnings_cs8612_highlighting

Warning

Nullability of reference types in type doesn't match overridden member.


resharper_c_sharp_warnings_cs8608_highlighting

Warning

Nullability of reference types in type of a parameter doesn't match the target delegate (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8622_highlighting

Warning

Nullability of reference types in type of parameter doesn't match implemented member.


resharper_c_sharp_warnings_cs8617_highlighting

Warning

Nullability of reference types in type of parameter doesn't match implicitly implemented member.


resharper_c_sharp_warnings_cs8614_highlighting

Warning

Nullability of reference types in type of parameter doesn't match interceptable method


resharper_c_sharp_warnings_cs9158_highlighting

Warning

Nullability of reference types in type of parameter doesn't match overridden member.


resharper_c_sharp_warnings_cs8610_highlighting

Warning

Nullability of reference types in type of parameter doesn't match partial method declaration.


resharper_c_sharp_warnings_cs8611_highlighting

Warning

Nullability of return type doesn't match implemented member (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8768_highlighting

Warning

Nullability of return type doesn't match implicitly implemented member (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8766_highlighting

Warning

Nullability of return type doesn't match overridden member (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8764_highlighting

Warning

Nullability of type argument doesn't match 'class' constraint.


resharper_c_sharp_warnings_cs8634_highlighting

Warning

Nullability of type argument doesn't match constraint type.


resharper_c_sharp_warnings_cs8631_highlighting

Warning

Nullability of type argument doesn't match 'notnull' constraint.


resharper_c_sharp_warnings_cs8714_highlighting

Warning

Nullability of type of parameter doesn't match implemented member (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8769_highlighting

Warning

Nullability of type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8767_highlighting

Warning

Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).


resharper_c_sharp_warnings_cs8765_highlighting

Warning

Nullable value type may be null.


resharper_c_sharp_warnings_cs8629_highlighting

Warning

Object or collection initializer implicitly dereferences possibly null member.


resharper_c_sharp_warnings_cs8670_highlighting

Warning

Obsolete member overrides non-obsolete member


resharper_c_sharp_warnings_cs0809_highlighting

Warning

Obsolete members should not be required.


resharper_c_sharp_warnings_cs9042_highlighting

Warning

Operator '==' or operator '!=' with 'Object.Equals(object o)' and 'Object.GetHashCode()' not overridden


resharper_c_sharp_warnings_cs0660_cs0661_highlighting

Warning

Opt in to preview features before using them.


resharper_c_sharp_warnings_ca2252_highlighting

Error

Parameter has no matching param tag in the XML comment


resharper_c_sharp_warnings_cs1573_highlighting

Warning

Parameter has params modifier in lambda but not in target delegate type.


resharper_c_sharp_warnings_cs9100_highlighting

Warning

Parameter is captured into the state of the enclosing type and its value is also passed to the base constructor. The value might be captured by the base class as well.


resharper_c_sharp_warnings_cs9107_highlighting

Warning

Parameter is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.


resharper_c_sharp_warnings_cs9124_highlighting

Warning

Parameter must conditionally have a non-null value when exiting a function.


resharper_c_sharp_warnings_cs8762_highlighting

Warning

Parameter must have a non-null value when exiting because parameter mentioned in [NotNullIfNotNull] annotation is non-null.


resharper_c_sharp_warnings_cs8824_highlighting

Warning

Parameter must have a non-null value when exiting.


resharper_c_sharp_warnings_cs8777_highlighting

Warning

Parameter occurs after interpolated string handler parameter in the parameter list.


resharper_c_sharp_warnings_cs8947_highlighting

Warning

Partial method declarations have inconsistent nullability for type parameter.


resharper_c_sharp_warnings_cs8667_highlighting

Warning

Possible mistaken empty statement


resharper_c_sharp_warnings_cs0642_highlighting

Warning

Possible null reference argument for a parameter.


resharper_c_sharp_warnings_cs8604_highlighting

Warning

Possible null reference assignment.


resharper_c_sharp_warnings_cs8601_highlighting

Warning

Possible null reference return.


resharper_c_sharp_warnings_cs8603_highlighting

Warning

Possible unintended reference comparison


resharper_c_sharp_warnings_cs0252_cs0253_highlighting

Warning

Possibly incorrect assignment to local which is the argument to a 'using' or 'lock' statement


resharper_c_sharp_warnings_cs0728_highlighting

Warning

Primary constructor parameter is shadowed by a member from base type.


resharper_c_sharp_warnings_cs9179_highlighting

Warning

Record defined 'Equals' but not 'GetHashCode'


resharper_c_sharp_warnings_cs8851_highlighting

Warning

Reference kind modifier of parameter doesn't match the corresponding parameter in hidden member.


resharper_c_sharp_warnings_cs9197_highlighting

Warning

Reference kind modifier of parameter doesn't match the corresponding parameter in overridden or implemented member.


resharper_c_sharp_warnings_cs9196_highlighting

Warning

Reference kind modifier of parameter doesn't match the corresponding parameter in target.


resharper_c_sharp_warnings_cs9198_highlighting

Warning

Reference to a volatile field will not be treated as volatile


resharper_c_sharp_warnings_cs0420_highlighting

Warning

Return value must be non-null because parameter mentioned in [NotNullIfNotNull] annotation is non-null.


resharper_c_sharp_warnings_cs8825_highlighting

Warning

Signatures of interceptable and interceptor methods do not match


resharper_c_sharp_warnings_cs9154_highlighting

Warning

Static type in 'is' or 'as' operator.


resharper_c_sharp_warnings_cs7023_highlighting

Warning

Struct member returns 'this' or other instance members by reference.


resharper_c_sharp_warnings_cs9084_highlighting

Warning

Syntax error in XML comment


resharper_c_sharp_warnings_cs1584_highlighting

Warning

Taking address of marshal-by-reference class field


resharper_c_sharp_warnings_cs0197_highlighting

Warning

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.


resharper_c_sharp_warnings_cs8632_highlighting

Warning

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.


resharper_c_sharp_warnings_cs8669_highlighting

Warning

The branches of the ref conditional operator refer to variables with incompatible declaration scopes.


resharper_c_sharp_warnings_cs9086_highlighting

Warning

The CallerArgumentExpressionAttribute applied to parameter will have no effect because it's self-referential


resharper_c_sharp_warnings_cs8965_highlighting

Warning

The CallerArgumentExpressionAttribute is applied with an invalid parameter name.


resharper_c_sharp_warnings_cs8963_highlighting

Warning

The CallerArgumentExpressionAttribute will have no effect because it applies to a member that is used in contexts that do not allow optional arguments


resharper_c_sharp_warnings_cs8966_highlighting

Warning

The CallerArgumentExpressionAttribute will have no effect; it is overridden by the CallerFilePathAttribute


resharper_c_sharp_warnings_cs8961_highlighting

Warning

The CallerArgumentExpressionAttribute will have no effect; it is overridden by the CallerLineNumberAttribute


resharper_c_sharp_warnings_cs8960_highlighting

Warning

The CallerArgumentExpressionAttribute will have no effect; it is overridden by the CallerMemberNameAttribute


resharper_c_sharp_warnings_cs8962_highlighting

Warning

The default parameter value does not match in the target delegate type.


resharper_c_sharp_warnings_cs9099_highlighting

Warning

The 'EnumeratorCancellation' attribute is only effective on a parameter of type 'CancellationToken' in an async-iterator method returning 'IAsyncEnumerable<>'.


resharper_c_sharp_warnings_cs8424_highlighting

Warning

The given expression always matches the provided constant.


resharper_c_sharp_warnings_cs8520_highlighting

Warning

The given expression never matches the provided pattern.


resharper_c_sharp_warnings_cs8519_highlighting

Warning

The 'l' suffix is easily confused with the digit '1'


resharper_c_sharp_warnings_cs0078_highlighting

Warning

The 'Main' method will not be used as an entry point because compilation unit with top-level statements was found.


resharper_c_sharp_warnings_cs7022_highlighting

Warning

The 'ref' modifier for an argument corresponding to 'in' parameter is equivalent to 'in'. Consider using 'in' instead.


resharper_c_sharp_warnings_cs9191_highlighting

Warning

The 'ref' modifier for an argument corresponding to 'in' parameter is equivalent to 'in'. Consider using 'in' instead.


resharper_c_sharp_warnings_cs9192_highlighting

Warning

The result of the expression is always 'null' of nullable type


resharper_c_sharp_warnings_cs0458_highlighting

Warning

The result of the expression is always 'true' or 'false' since a value of value type is never equal to 'null'


resharper_c_sharp_warnings_cs0472_highlighting

Warning

The result of the expression is always 'true' or 'false' since a value of value type is never equal to 'null'


resharper_c_sharp_warnings_cs8073_highlighting

Warning

The 'scoped' modifier of a parameter doesn't match target delegate.


resharper_c_sharp_warnings_cs9073_highlighting

Warning

The 'scoped' modifier of parameter doesn't match overridden or implemented member.


resharper_c_sharp_warnings_cs9074_highlighting

Warning

The switch expression does not handle all possible inputs (it is not exhaustive).


resharper_c_sharp_warnings_cs8509_highlighting

Warning

The switch expression does not handle all possible values of its input type (it is not exhaustive). However, a pattern with a 'when' clause might successfully match this value.


resharper_c_sharp_warnings_cs8846_highlighting

Warning

The switch expression does not handle some null inputs (it is not exhaustive).


resharper_c_sharp_warnings_cs8655_highlighting

Warning

The switch expression does not handle some null inputs (it is not exhaustive). However, a pattern with a 'when' clause might successfully match this value.


resharper_c_sharp_warnings_cs8847_highlighting

Warning

The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value.


resharper_c_sharp_warnings_cs8524_highlighting

Warning

The tuple element name is ignored because a different name or no name is specified by the target type.


resharper_c_sharp_warnings_cs8123_highlighting

Warning

The tuple element name is ignored because a different name or no name is specified on the other side of the tuple == or != operator.


resharper_c_sharp_warnings_cs8383_highlighting

Warning

The type name only contains lower-cased ASCII characters. Such names may become reserved for the language


resharper_c_sharp_warnings_cs8981_highlighting

Warning

There is no defined ordering between fields in multiple declarations of partial struct. To specify an ordering, all instance fields must be in the same declaration.


resharper_c_sharp_warnings_cs0282_highlighting

Warning

This ref-assigns a value that can only escape the current method through a return statement.


resharper_c_sharp_warnings_cs9093_highlighting

Warning

This ref-assigns a value that has a wider value escape scope than the target allowing assignment through the target of values with narrower escapes scopes.


resharper_c_sharp_warnings_cs9097_highlighting

Warning

This ref-assigns an expression to a variable with a narrower escape scope.


resharper_c_sharp_warnings_cs9085_highlighting

Warning

This returns a member of local by reference but it is not a ref local.


resharper_c_sharp_warnings_cs9092_highlighting

Warning

This returns a parameter by reference but it is not a ref parameter.


resharper_c_sharp_warnings_cs9087_highlighting

Warning

This returns a parameter by reference but it is scoped to the current method.


resharper_c_sharp_warnings_cs9088_highlighting

Warning

This returns a parameter by reference through a ref parameter; but it can only safely be returned in a return statement.


resharper_c_sharp_warnings_cs9094_highlighting

Warning

This returns by reference a member of parameter that is not a ref or out parameter.


resharper_c_sharp_warnings_cs9089_highlighting

Warning

This returns by reference a member of parameter that is scoped to the current method.


resharper_c_sharp_warnings_cs9090_highlighting

Warning

This returns by reference a member of parameter through a ref parameter; but it can only safely be returned in a return statement.


resharper_c_sharp_warnings_cs9095_highlighting

Warning

This returns local by reference but it is not a ref local.


resharper_c_sharp_warnings_cs9091_highlighting

Warning

This takes the address of, gets the size of, or declares a pointer to a managed type.


resharper_c_sharp_warnings_cs8500_highlighting

Warning

Thrown value may be null.


resharper_c_sharp_warnings_cs8597_highlighting

Warning

Type is already listed in the interface list with different nullability of reference types.


resharper_c_sharp_warnings_cs8645_highlighting

Warning

Type is for evaluation purposes only and is subject to change or removal in future updates.


resharper_c_sharp_warnings_cs8305_highlighting

Warning

Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.


resharper_c_sharp_warnings_cs9204_highlighting

Warning

Type parameter has no matching typeparam tag in the XML comment


resharper_c_sharp_warnings_cs1712_highlighting

Warning

Type parameter has the same name as a type parameter from the outer type


resharper_c_sharp_warnings_cs0693_highlighting

Warning

Types and aliases should not be named 'record'


resharper_c_sharp_warnings_cs8860_highlighting

Warning

Unable to include XML fragment


resharper_c_sharp_warnings_cs1589_highlighting

Warning

Unassigned field


resharper_unassigned_field_compiler_highlighting

Warning

Unassigned readonly field


resharper_unassigned_readonly_field_compiler_highlighting

Warning

Unboxing a possibly null value.


resharper_c_sharp_warnings_cs8605_highlighting

Warning

Unused local variable


resharper_unused_variable_compiler_highlighting

Warning

Use of a variable in this context may expose referenced variables outside of their declaration scope.


resharper_c_sharp_warnings_cs9080_highlighting

Warning

Use of obsolete symbol


resharper_c_sharp_warnings_cs0618_highlighting

Warning

Use of obsolete symbol (without message)


resharper_c_sharp_warnings_cs0612_highlighting

Warning

Using 'is' to test compatibility with 'dynamic' is essentially identical to testing compatibility with 'Object' and will succeed for all non-null values


resharper_c_sharp_warnings_cs1981_highlighting

Warning

XML comment has a 'param' tag for 'Parameter', but there is no parameter by that name


resharper_c_sharp_warnings_cs1572_highlighting

Warning

XML comment has a 'typeparam' tag for 'TypeParameter', but there is no type parameter by that name


resharper_c_sharp_warnings_cs1711_highlighting

Warning

XML comment has cref attribute that refers to a type parameter


resharper_c_sharp_warnings_cs1723_highlighting

Warning

XML comment is not placed on a valid language element


resharper_c_sharp_warnings_cs1587_highlighting

Warning

Constraints Violations (11 inspections)

This category includes code inspections, mostly with the warning severity level, which detect violations related to symbol attributes, including JetBrains Fleet's code annotations, and other similar issues.

Inspection


EditorConfig property

Default severity

Base type is required


resharper_required_base_types_is_not_inherited_highlighting

Warning

BaseTypeRequired attribute supports only classes and interfaces


resharper_unsupported_required_base_type_highlighting

Warning

Inconsistent Naming


resharper_inconsistent_naming_highlighting

Warning

Namespace does not correspond to file location


resharper_check_namespace_highlighting

Warning

Non-nullable or required member is not initialized at constructor exit


resharper_not_null_or_required_member_is_not_initialized_highlighting

Warning

Possible 'null' assignment to non-nullable entity


resharper_assign_null_to_not_null_attribute_highlighting

Warning

Possible violation of 'ValueRange'/'NonNegativeValue' attribute


resharper_value_range_attribute_violation_highlighting

Warning

Problem in contract annotation definition


resharper_contract_annotation_not_parsed_highlighting

Warning

Required base type conflicting another type


resharper_required_base_types_conflict_highlighting

Warning

Type specified in '[BaseTypeRequired]' attribute conflicts another type


resharper_required_base_types_direct_conflict_highlighting

Warning

Values of types marked with 'CannotApplyEqualityOperatorAttribute' should be compared using 'Equals()'


resharper_cannot_apply_equality_operator_to_type_highlighting

Warning

Formatting (41 inspections)

Inspections in this category detect code formatting problems.

Inspection


EditorConfig property

Default severity

Incorrect blank lines (blank lines are missing elsewhere)


resharper_missing_blank_lines_highlighting

Disabled

Incorrect blank lines (blank lines are redundant elsewhere)


resharper_redundant_blank_lines_highlighting

Disabled

Incorrect blank lines (incorrect number of blank lines near braces)


resharper_incorrect_blank_lines_near_braces_highlighting

Disabled

Incorrect indent (around child statement)


resharper_bad_child_statement_indent_highlighting

Warning

Incorrect indent (around declaration braces)


resharper_bad_declaration_braces_indent_highlighting

Disabled

Incorrect indent (around expression braces)


resharper_bad_expression_braces_indent_highlighting

Disabled

Incorrect indent (around namespace braces)


resharper_bad_namespace_braces_indent_highlighting

Disabled

Incorrect indent (around preprocessor directive)


resharper_bad_preprocessor_indent_highlighting

Disabled

Incorrect indent (around statement braces)


resharper_bad_control_braces_indent_highlighting

Suggestion

Incorrect indent (around switch statement)


resharper_bad_switch_braces_indent_highlighting

Disabled

Incorrect indent (incorrect indent size)


resharper_wrong_indent_size_highlighting

Disabled

Incorrect indent (indent level is not restored)


resharper_outdent_is_off_prev_level_highlighting

Disabled

Incorrect indent (missing indent/outdent elsewhere)


resharper_missing_indent_highlighting

Disabled

Incorrect indent (redundant indent/outdent elsewhere)


resharper_bad_indent_highlighting

Disabled

Incorrect indent (tabs/spaces mismatch)


resharper_tabs_and_spaces_mismatch_highlighting

Disabled

Incorrect line breaks (around comma in lists)


resharper_bad_list_line_breaks_highlighting

Disabled

Incorrect line breaks (around declaration braces)


resharper_bad_declaration_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (around empty braces)


resharper_bad_empty_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (around expression braces)


resharper_bad_expression_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (around LINQ queries)


resharper_bad_linq_line_breaks_highlighting

Disabled

Incorrect line breaks (around parenthesis)


resharper_bad_parens_line_breaks_highlighting

Disabled

Incorrect line breaks (around statement braces)


resharper_bad_control_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (line break is missing elsewhere)


resharper_missing_linebreak_highlighting

Disabled

Incorrect line breaks (line break is redundant elsewhere)


resharper_redundant_linebreak_highlighting

Disabled

Incorrect line breaks (multiple statements on one line)


resharper_multiple_statements_on_one_line_highlighting

Disabled

Incorrect line breaks (multiple type members on one line)


resharper_multiple_type_members_on_one_line_highlighting

Disabled

Incorrect spacing (around attributes)


resharper_bad_attribute_brackets_spaces_highlighting

Disabled

Incorrect spacing (around braces)


resharper_bad_braces_spaces_highlighting

Disabled

Incorrect spacing (around colon)


resharper_bad_colon_spaces_highlighting

Disabled

Incorrect spacing (around comma)


resharper_bad_comma_spaces_highlighting

Disabled

Incorrect spacing (around generic brackets)


resharper_bad_generic_brackets_spaces_highlighting

Disabled

Incorrect spacing (around member access symbols)


resharper_bad_member_access_spaces_highlighting

Disabled

Incorrect spacing (around operator symbols)


resharper_bad_symbol_spaces_highlighting

Disabled

Incorrect spacing (around parenthesis)


resharper_bad_parens_spaces_highlighting

Disabled

Incorrect spacing (around semicolon)


resharper_bad_semicolon_spaces_highlighting

Disabled

Incorrect spacing (around square brackets within a statement)


resharper_bad_square_brackets_spaces_highlighting

Disabled

Incorrect spacing (between keyword and parenthesis)


resharper_bad_spaces_after_keyword_highlighting

Disabled

Incorrect spacing (multiple spaces are prohibited)


resharper_multiple_spaces_highlighting

Disabled

Incorrect spacing (space is missing elsewhere)


resharper_missing_space_highlighting

Disabled

Incorrect spacing (space is redundant elsewhere)


resharper_redundant_space_highlighting

Disabled

Incorrect spacing (tabs are prohibited here)


resharper_tabs_outside_indent_highlighting

Disabled

Language Usage Opportunities (83 inspections)

This category includes code inspections, mostly with the suggestion severity level, which notify you when more advanced language constructs can be used. These inspections detect syntax of outdated language versions and suggest using features from more modern language versions.

Inspection


EditorConfig property

Default severity

Append to collection expression


resharper_append_to_collection_expression_highlighting

Suggestion

Class cannot be instantiated


resharper_class_cannot_be_instantiated_highlighting

Warning

Conditional expression can be rewritten as null-coalescing


resharper_replace_conditional_expression_with_null_coalescing_highlighting

Suggestion

Convert 'as' expression type check and the following null check into negated pattern matching


resharper_use_negated_pattern_matching_highlighting

Hint

Convert 'as' expression type check and the following null check into pattern matching


resharper_use_pattern_matching_highlighting

Suggestion

Convert constructor into member initializers


resharper_convert_constructor_to_member_initializers_highlighting

Suggestion

Convert constructor into primary constructor


resharper_convert_to_primary_constructor_highlighting

Suggestion

Convert delegate variable into local function


resharper_convert_to_local_function_highlighting

Suggestion

Convert 'if' statement into 'switch'


resharper_convert_if_statement_to_switch_statement_highlighting

Hint

Convert into 'await using' statement or declaration


resharper_use_await_using_highlighting

Suggestion

Convert into lambda expression


resharper_convert_to_lambda_expression_highlighting

Suggestion

Convert into static class


resharper_convert_to_static_class_highlighting

Suggestion

Convert into 'using' declaration


resharper_convert_to_using_declaration_highlighting

Suggestion

Convert lambda expression into method group


resharper_convert_closure_to_method_group_highlighting

Suggestion

Convert negated 'is' expression into 'is' expression with negated pattern


resharper_use_negated_pattern_in_is_expression_highlighting

Hint

Convert 'Nullable<T>' into 'T?'


resharper_convert_nullable_to_short_form_highlighting

Suggestion

Convert property into auto-property


resharper_convert_to_auto_property_highlighting

Suggestion

Convert property into auto-property (when possible)


resharper_convert_to_auto_property_when_possible_highlighting

Hint

Convert property into auto-property with private setter


resharper_convert_to_auto_property_with_private_setter_highlighting

Hint

Convert static method invocation into extension method call


resharper_invoke_as_extension_method_highlighting

Suggestion

Foreach loop can be converted into LINQ-expression but another 'GetEnumerator' method will be used


resharper_foreach_can_be_converted_to_query_using_another_get_enumerator_highlighting

Hint

For-loop can be converted into foreach-loop


resharper_for_can_be_converted_to_foreach_highlighting

Suggestion

'if' statement can be rewritten as '?:' expression


resharper_convert_if_statement_to_conditional_ternary_expression_highlighting

Suggestion

'if' statement can be rewritten as '??' expression


resharper_convert_if_statement_to_null_coalescing_expression_highlighting

Suggestion

'if' statement can be rewritten as '??=' assignment


resharper_convert_if_statement_to_null_coalescing_assignment_highlighting

Suggestion

'if-return' statement can be rewritten as 'return' statement


resharper_convert_if_statement_to_return_statement_highlighting

Hint

Inline 'out' variable declaration


resharper_inline_out_variable_declaration_highlighting

Suggestion

Inline temporary variable


resharper_inline_temporary_variable_highlighting

Hint

Introduce optional parameters (non-private accessibility)


resharper_introduce_optional_parameters_global_highlighting

Suggestion

Introduce optional parameters (private accessibility)


resharper_introduce_optional_parameters_local_highlighting

Suggestion

Invert 'if' statement to reduce nesting


resharper_invert_if_highlighting

Hint

Join null check with assignment


resharper_join_null_check_with_usage_highlighting

Suggestion

Lambda expression/anonymous method can be made 'static'


resharper_lambda_expression_can_be_made_static_highlighting

Disabled

Lambda expression/anonymous method must be 'static' to avoid allocations


resharper_lambda_expression_must_be_static_highlighting

Suggestion

Lambda expression/anonymous method must not have captures of the containing context


resharper_lambda_should_not_capture_context_highlighting

Warning

Literal length can be reduced by using verbatim string


resharper_use_verbatim_string_highlighting

Hint

Loop can be converted into LINQ-expression


resharper_loop_can_be_converted_to_query_highlighting

Hint

Merge 'and' pattern


resharper_merge_and_pattern_highlighting

Suggestion

Merge conditional ?: expression into conditional access


resharper_merge_conditional_expression_highlighting

Suggestion

Merge negated null/pattern checks into complex pattern


resharper_merge_into_negated_pattern_highlighting

Hint

Merge nested property patterns


resharper_merge_nested_property_patterns_highlighting

Suggestion

Merge null/pattern checks into complex pattern


resharper_merge_into_pattern_highlighting

Suggestion

Merge null/pattern/value checks into 'or'/'and' patterns


resharper_merge_into_logical_pattern_highlighting

Hint

Merge sequential checks into single conditional access check


resharper_merge_sequential_checks_highlighting

Hint

Move to existing positional deconstruction pattern


resharper_move_to_existing_positional_deconstruction_pattern_highlighting

Hint

Move variable declaration inside loop condition


resharper_move_variable_declaration_inside_loop_condition_highlighting

Suggestion

Part of foreach loop can be converted into LINQ-expression but another 'GetEnumerator' method will be used


resharper_foreach_can_be_partly_converted_to_query_using_another_get_enumerator_highlighting

Hint

Part of loop's body can be converted into LINQ-expression


resharper_loop_can_be_partly_converted_to_query_highlighting

Disabled

Pass string interpolation expression


resharper_pass_string_interpolation_highlighting

Hint

Redundant accessor body


resharper_redundant_accessor_body_highlighting

Suggestion

Replace auto-property with computed property


resharper_replace_auto_property_with_computed_property_highlighting

Hint

Replace if statement with null-propagating code


resharper_use_null_propagation_highlighting

Hint

Replace object pattern not performing any additional checks with 'var' pattern


resharper_replace_object_pattern_with_var_pattern_highlighting

Suggestion

Replace 'SequenceEqual' with constant pattern


resharper_replace_sequence_equal_with_constant_pattern_highlighting

Suggestion

Replace 'Slice' with range indexer


resharper_replace_slice_with_range_indexer_highlighting

Hint

Replace 'Substring' with range indexer


resharper_replace_substring_with_range_indexer_highlighting

Hint

Replace 'switch' statement with 'switch' expression


resharper_convert_switch_statement_to_switch_expression_highlighting

Hint

Replace ternary expression with 'switch' expression


resharper_convert_conditional_ternary_expression_to_switch_expression_highlighting

Hint

Replace with 'field' keyword


resharper_replace_with_field_keyword_highlighting

Suggestion

Replace with primary constructor parameter


resharper_replace_with_primary_constructor_parameter_highlighting

Suggestion

Use alias


resharper_use_symbol_alias_highlighting

Hint

Use collection expression syntax


resharper_use_collection_expression_highlighting

Suggestion

Use compound assignment


resharper_convert_to_compound_assignment_highlighting

Hint

Use compound assignment


resharper_convert_to_null_coalescing_compound_assignment_highlighting

Suggestion

Use deconstruction


resharper_use_deconstruction_highlighting

Hint

Use deconstruction to swap variables


resharper_swap_via_deconstruction_highlighting

Suggestion

Use discard assignment


resharper_use_discard_assignment_highlighting

Suggestion

Use index from end expression


resharper_use_index_from_end_expression_highlighting

Suggestion

Use 'nameof' expression to reference name


resharper_use_nameof_expression_highlighting

Suggestion

Use 'nameof' expression to reference name in part of the string literal


resharper_use_nameof_expression_for_part_of_the_string_highlighting

Disabled

Use 'nameof' expression to reference type name


resharper_use_name_of_instead_of_type_of_highlighting

Suggestion

Use 'nameof' expression when registering a DependencyProperty


resharper_use_nameof_for_dependency_property_highlighting

Suggestion

Use object or collection initializer when possible


resharper_use_object_or_collection_initializer_highlighting

Suggestion

Use positional deconstruction pattern


resharper_use_positional_deconstruction_pattern_highlighting

Disabled

Use raw string


resharper_use_raw_string_highlighting

Hint

Use string interpolation expression


resharper_use_string_interpolation_highlighting

Suggestion

Use type annotation syntax


resharper_use_nullable_reference_types_annotation_syntax_highlighting

Warning

Use unsigned right shift operator '>>>'


resharper_use_unsigned_right_shift_operator_highlighting

Suggestion

Use UTF-8 string literal


resharper_use_utf8_string_literal_highlighting

Suggestion

Use 'with' expression to copy anonymous object


resharper_use_with_expression_to_copy_anonymous_object_highlighting

Suggestion

Use 'with' expression to copy record


resharper_use_with_expression_to_copy_record_highlighting

Suggestion

Use 'with' expression to copy struct


resharper_use_with_expression_to_copy_struct_highlighting

Suggestion

Use 'with' expression to copy tuple


resharper_use_with_expression_to_copy_tuple_highlighting

Suggestion

Potential Code Quality Issues (192 inspections)

This category includes inspections that detect critical issues (code smells), mostly with Error or Warning level.

Inspection


EditorConfig property

Default severity

'?:' expression has identical true and false branches


resharper_conditional_ternary_equal_branch_highlighting

Warning

[MustDisposeResource] annotation is not inherited from the base constructor and should be placed explicitly


resharper_constructor_with_must_dispose_resource_attribute_base_is_not_annotated_highlighting

Warning

[ThreadStatic] does not work with instance fields


resharper_thread_static_at_instance_field_highlighting

Warning

A suppressed nullable warning might hide an underlying problem


resharper_nullable_warning_suppression_is_used_highlighting

Disabled

Abstract or virtual (overridable) event is never invoked


resharper_event_never_invoked_global_highlighting

Suggestion

Access to disposed captured variable


resharper_access_to_disposed_closure_highlighting

Warning

Access to foreach variable in closure


resharper_access_to_for_each_variable_in_closure_highlighting

Warning

Access to modified captured variable


resharper_access_to_modified_closure_highlighting

Warning

According to values of the bit masks, expression result will always be the same


resharper_non_constant_equality_expression_has_constant_result_highlighting

Warning

Actual shift count equals zero


resharper_shift_expression_real_shift_count_is_zero_highlighting

Warning

Ambiguous symbols in text argument


resharper_multiple_resolve_candidates_in_text_highlighting

Warning

Annotation conflict in hierarchy


resharper_annotation_conflict_in_hierarchy_highlighting

Warning

Assignment in conditional expression


resharper_assignment_in_conditional_expression_highlighting

Warning

Async iterator invocation without 'await foreach'


resharper_async_iterator_invocation_without_await_foreach_highlighting

Warning

Auto-property accessor is never used (non-private accessibility)


resharper_unused_auto_property_accessor_global_highlighting

Warning

Auto-property accessor is never used (private accessibility)


resharper_unused_auto_property_accessor_local_highlighting

Warning

Avoid using 'async' lambda when delegate type returns 'void'


resharper_async_void_lambda_highlighting

Warning

Avoid using 'async' methods with the 'void' return type


resharper_async_void_method_highlighting

Disabled

Backing field is assigned but never used


resharper_property_field_keyword_is_never_used_highlighting

Warning

Backing field is used but never assigned


resharper_property_field_keyword_is_never_assigned_highlighting

Warning

Bitwise operation on enum is not marked by [Flags] attribute


resharper_bitwise_operator_on_enum_without_flags_highlighting

Warning

Call to base member with implicit default parameters


resharper_base_method_call_with_default_parameter_highlighting

Warning

Call to 'base.Equals(...)' is reference equality


resharper_base_object_equals_is_object_equals_highlighting

Warning

Cannot access static symbol in text argument


resharper_static_problem_in_text_highlighting

Warning

Cannot access symbol in text argument


resharper_access_rights_in_text_highlighting

Warning

Cannot resolve property


resharper_property_not_resolved_highlighting

Error

Cannot resolve resource


resharper_resource_not_resolved_highlighting

Error

Cannot resolve resource item


resharper_resource_item_not_resolved_highlighting

Error

Cannot resolve symbol in text argument


resharper_not_resolved_in_text_highlighting

Warning

Captured field reference of a marshal-by-reference class may cause a runtime exception


resharper_address_of_marshal_by_ref_object_highlighting

Warning

Captured reference to 'volatile' field will not be treated as 'volatile'


resharper_by_ref_argument_is_volatile_field_highlighting

Warning

Char is possibly unintentionally used as integer


resharper_confusing_char_as_integer_in_constructor_highlighting

Warning

Class is never instantiated (non-private accessibility)


resharper_class_never_instantiated_global_highlighting

Suggestion

Class is never instantiated (private accessibility)


resharper_class_never_instantiated_local_highlighting

Suggestion

Collection content is never queried (non-private accessibility)


resharper_collection_never_queried_global_highlighting

Warning

Collection content is never queried (private accessibility)


resharper_collection_never_queried_local_highlighting

Warning

Collection is never updated (non-private accessibility)


resharper_collection_never_updated_global_highlighting

Warning

Collection is never updated (private accessibility)


resharper_collection_never_updated_local_highlighting

Warning

Constant shift expression with non-zero operands results in a zero value


resharper_shift_expression_result_equals_zero_highlighting

Warning

Co-variant array conversion


resharper_co_variant_array_conversion_highlighting

Warning

Disposal of a variable already captured by the 'using' statement


resharper_dispose_on_using_variable_highlighting

Warning

Division by zero in at least one execution path


resharper_int_division_by_zero_highlighting

Warning

Do not store SpinLock in readonly field


resharper_spin_lock_in_readonly_field_highlighting

Warning

Do not use object initializer for 'using' variable


resharper_using_statement_resource_initialization_highlighting

Warning

Do not use object initializer for 'using' variable (object initializer expression may throw exception while initializing 'using' variable)


resharper_using_statement_resource_initialization_expression_highlighting

Hint

Element is localizable


resharper_localizable_element_highlighting

Warning

Empty general catch clause


resharper_empty_general_catch_clause_highlighting

Warning

Empty 'with' expression is redundant


resharper_redundant_with_expression_highlighting

Suggestion

'Enumerable.Sum' invocation in explicit unchecked context


resharper_enumerable_sum_in_explicit_unchecked_context_highlighting

Warning

Equality comparison of floating point numbers


resharper_compare_of_floats_by_equality_operator_highlighting

Warning

Event is never subscribed to (non-private accessibility)


resharper_event_never_subscribed_to_global_highlighting

Suggestion

Event is never subscribed to (private accessibility)


resharper_event_never_subscribed_to_local_highlighting

Suggestion

Event never invoked


resharper_event_never_invoked_highlighting

Warning

Event unsubscription via anonymous delegate


resharper_event_unsubscription_via_anonymous_delegate_highlighting

Warning

Exception rethrow possibly intended


resharper_possible_intended_rethrow_highlighting

Warning

Explicit argument passed to parameter with caller info attribute


resharper_explicit_caller_info_argument_highlighting

Warning

Field hides property with default implementation in interface


resharper_field_hides_interface_property_with_default_implementation_highlighting

Warning

Formatting is specified, but interpolated string expression is not IFormattable


resharper_interpolated_string_expression_is_not_i_formattable_highlighting

Warning

Function body is too complex to analyze


resharper_function_complexity_overflow_highlighting

Disabled

Function is recursive on all execution paths


resharper_function_recursive_on_all_paths_highlighting

Warning

Function never returns


resharper_function_never_returns_highlighting

Warning

'GC.SuppressFinalize' is invoked for type without destructor


resharper_gc_suppress_finalize_for_type_without_destructor_highlighting

Warning

Heuristically unreachable case according to integer analysis


resharper_unreachable_switch_case_due_to_integer_analysis_highlighting

Warning

Heuristically unreachable switch arm according to integer analysis


resharper_unreachable_switch_arm_due_to_integer_analysis_highlighting

Warning

Inconsistent arguments passed to 'Math.Clamp()' method


resharper_math_clamp_min_greater_than_max_highlighting

Warning

Inconsistent order of taken locks


resharper_inconsistent_order_of_locks_highlighting

Warning

Inconsistent synchronization on field


resharper_inconsistently_synchronized_field_highlighting

Warning

Index from end must be greater than zero; use '^1' to refer to the last element


resharper_zero_index_from_end_highlighting

Warning

Interfaces marked as ServiceContract should declare at least one OperationContract


resharper_service_contract_without_operations_highlighting

Warning

Invalid XML documentation comment


resharper_invalid_xml_doc_comment_highlighting

Warning

Invocation of polymorphic field-like event


resharper_polymorphic_field_like_event_invocation_highlighting

Warning

IQueryable is possibly unintentionally used as IEnumerable


resharper_possible_unintended_queryable_as_enumerable_highlighting

Suggestion

Iterator never returns


resharper_iterator_never_returns_highlighting

Warning

Local function hides method


resharper_local_function_hides_method_highlighting

Warning

Local variable hides member


resharper_local_variable_hides_member_highlighting

Warning

Local variable hides primary constructor parameter


resharper_local_variable_hides_primary_constructor_parameter_highlighting

Warning

Loop control variable is never changed inside loop


resharper_loop_variable_is_never_changed_inside_loop_highlighting

Warning

Meaningless [HandlesResourceDisposal] annotation for an output parameter


resharper_out_parameter_with_handles_resource_disposal_attribute_highlighting

Warning

Meaningless [MustDisposeResource] annotation for an input parameter


resharper_in_parameter_with_must_dispose_resource_attribute_highlighting

Warning

Member hides static member from outer class


resharper_member_hides_static_from_outer_class_highlighting

Warning

Member initialized value ignored


resharper_member_initializer_value_ignored_highlighting

Warning

Method is marked as OperationContract but containing type is not marked as ServiceContract


resharper_operation_contract_without_service_contract_highlighting

Warning

Method with optional or 'params' parameter is hidden by overload


resharper_method_overload_with_optional_parameter_highlighting

Warning

Mismatch of optional parameter value in overridden method


resharper_optional_parameter_hierarchy_mismatch_highlighting

Warning

Missing '.ConfigureAwait(false)' for async disposable in library code


resharper_use_configure_await_false_for_async_disposable_highlighting

Disabled

Missing '.ConfigureAwait(false)' in library code


resharper_use_configure_await_false_highlighting

Suggestion

Multiple sequential 'OrderBy' invocation


resharper_multiple_order_by_highlighting

Warning

Non-accessed field (non-private accessibility)


resharper_not_accessed_field_global_highlighting

Suggestion

Non-accessed field (private accessibility)


resharper_not_accessed_field_local_highlighting

Warning

Non-accessed positional property (non-private accessibility)


resharper_not_accessed_positional_property_global_highlighting

Warning

Non-accessed positional property (private accessibility)


resharper_not_accessed_positional_property_local_highlighting

Warning

Non-public member in implementation class hides default implementation in interface


resharper_member_hides_interface_member_with_default_implementation_highlighting

Warning

Non-readonly type member referenced in 'GetHashCode()'


resharper_non_readonly_member_in_get_hash_code_highlighting

Warning

Nullability conflicts with annotations in hierarchy


resharper_nullness_annotation_conflict_with_jet_brains_annotations_highlighting

Warning

Nullable warning suppression operator might be confused with inverted 'is' expression


resharper_suppress_nullable_warning_expression_as_inverted_is_expression_highlighting

Warning

'Object.ReferenceEquals' is always false because it is called with value type


resharper_reference_equals_with_value_type_highlighting

Warning

One way operations must not return values


resharper_one_way_operation_contract_with_return_type_highlighting

Warning

Operator 'is'/'Type Of ... Is ...' can be used


resharper_operator_is_can_be_used_highlighting

Warning

Operator without matching checked operator


resharper_operator_without_matched_checked_operator_highlighting

Warning

Overridden GetHashCode calls base 'Object.GetHashCode()'


resharper_base_object_get_hash_code_call_in_get_hash_code_highlighting

Warning

Parameter hides member


resharper_parameter_hides_member_highlighting

Warning

Parameter hides primary constructor parameter


resharper_parameter_hides_primary_constructor_parameter_highlighting

Warning

Parameter name differs in partial method declaration


resharper_partial_method_parameter_name_mismatch_highlighting

Warning

Possible ambiguity while accessing member by interface


resharper_possible_interface_member_ambiguity_highlighting

Warning

Possible comparison of value type with 'null'


resharper_compare_non_constrained_generic_with_null_highlighting

Disabled

Possible cyclic constructor call


resharper_constructor_initializer_loop_highlighting

Warning

Possible incorrect implementation of Double-Check Locking pattern. Possible multiple write access to checked field.


resharper_possible_multiple_write_access_in_double_check_locking_highlighting

Warning

Possible incorrect implementation of Double-Check Locking pattern. Read access to checked field.


resharper_read_access_in_double_check_locking_highlighting

Warning

Possible infinite inheritance


resharper_possible_infinite_inheritance_highlighting

Warning

Possible loss of fraction


resharper_possible_loss_of_fraction_highlighting

Warning

Possible multiple enumeration


resharper_possible_multiple_enumeration_highlighting

Warning

Possible overflow


resharper_int_variable_overflow_highlighting

Warning

Possible overflow in checked context


resharper_int_variable_overflow_in_checked_context_highlighting

Warning

Possible overflow in unchecked context


resharper_int_variable_overflow_in_unchecked_context_highlighting

Warning

Possible 'System.ArgumentOutOfRangeException'. Index must be a non-negative integer.


resharper_negative_index_highlighting

Warning

Possible 'System.ArgumentOutOfRangeException'. Start index must be less than or equal to end index.


resharper_indexing_by_invalid_range_highlighting

Warning

Possible 'System.InvalidCastException'


resharper_possible_invalid_cast_exception_highlighting

Warning

Possible 'System.InvalidCastException' in foreach loop


resharper_possible_invalid_cast_exception_in_foreach_loop_highlighting

Warning

Possible 'System.InvalidOperationException'


resharper_possible_invalid_operation_exception_highlighting

Warning

Possible 'System.InvalidOperationException: Collection was modified'


resharper_possible_invalid_operation_exception_collection_was_modified_highlighting

Warning

Possible 'System.NullReferenceException'


resharper_possible_null_reference_exception_highlighting

Warning

Possible unassigned object created by 'new' expression


resharper_object_creation_as_statement_highlighting

Warning

Possible unintended reference comparison


resharper_possible_unintended_reference_comparison_highlighting

Warning

Possibly impure struct method is called on readonly variable: struct value always copied before invocation


resharper_possibly_impure_method_call_on_readonly_variable_highlighting

Warning

Possibly misleading 'DefaultValueAttribute' usage to define optional parameter value


resharper_default_value_attribute_for_optional_parameter_highlighting

Warning

Possibly missing comma before indexer initializer


resharper_possibly_missing_indexer_initializer_comma_highlighting

Warning

Possibly unintended linear search in set


resharper_possible_unintended_linear_search_in_set_highlighting

Warning

Possibly unintended string interpolation instead of format string template


resharper_possibly_mistaken_use_of_interpolated_string_insert_highlighting

Warning

Potentially misleading parameter name in lambda or local function


resharper_all_underscore_local_parameter_name_highlighting

Warning

'ref' or 'out' parameter with [Optional] attribute


resharper_optional_parameter_ref_out_highlighting

Warning

Return of a task produced by 'using'-captured object


resharper_return_of_task_produced_by_using_variable_highlighting

Warning

Return of a variable captured by 'using' statement


resharper_return_of_using_variable_highlighting

Warning

Return type of a function can be non-nullable


resharper_return_type_can_be_not_nullable_highlighting

Warning

Return value must be disposed but the method or function is not annotated with [MustDisposeResource]


resharper_not_disposed_resource_is_returned_highlighting

Warning

Return value of [MustUseReturnValue] annotated method is not used


resharper_must_use_return_value_highlighting

Warning

Return value of a method annotated with [MustDisposeResource] is never disposed


resharper_not_disposed_resource_highlighting

Warning

Return value of a property must be disposed by the callee


resharper_not_disposed_resource_is_returned_by_property_highlighting

Warning

Return value of iterator is not used


resharper_iterator_method_result_is_ignored_highlighting

Warning

Return value of pure method is not used


resharper_return_value_of_pure_method_is_not_used_highlighting

Warning

Safe cast expression always succeeds


resharper_try_cast_always_succeeds_highlighting

Suggestion

Shift expression with zero left operand equals zero


resharper_shift_expression_zero_left_operand_highlighting

Warning

Similar anonymous type detected nearby


resharper_similar_anonymous_type_nearby_highlighting

Hint

Similar expressions comparison


resharper_equal_expression_comparison_highlighting

Warning

Some values of the enum are not processed inside 'switch' expression and are handled via exception in default arm


resharper_switch_expression_handles_some_known_enum_values_with_exception_in_default_highlighting

Hint

Some values of the enum are not processed inside 'switch' statement


resharper_switch_statement_missing_some_enum_cases_no_default_highlighting

Hint

Some values of the enum are not processed inside 'switch' statement and are handled via default section


resharper_switch_statement_handles_some_known_enum_values_with_default_highlighting

Hint

Static field or auto-property in generic type


resharper_static_member_in_generic_type_highlighting

Warning

Static member initializer refers to static member below or in other part


resharper_static_member_initializer_referes_to_member_below_highlighting

Warning

String formatting method problems


resharper_format_string_problem_highlighting

Warning

Structured message template problems


resharper_structured_message_template_problem_highlighting

Warning

Suspicious locking over synchronization primitive


resharper_suspicious_lock_over_synchronization_primitive_highlighting

Warning

Suspicious parameter name in ArgumentNullException


resharper_suspicious_parameter_name_in_argument_null_exception_highlighting

Warning

Suspicious shift count for this type of left operand


resharper_shift_expression_right_operand_not_equal_real_count_highlighting

Warning

Suspicious type conversion or check


resharper_suspicious_type_conversion_global_highlighting

Warning

Suspicious use of variable with discard-like name


resharper_assignment_instead_of_discard_highlighting

Warning

Suspicious 'volatile' field usage: compound operation is not atomic. 'Interlocked' class can be used instead.


resharper_non_atomic_compound_operator_highlighting

Warning

Symbol from module that might be missing at runtime


resharper_symbol_from_not_copied_locally_reference_used_warning_highlighting

Warning

Tail recursive call can be replaced with loop


resharper_tail_recursive_call_highlighting

Hint

The expression of 'is' operator is never of the provided type


resharper_is_expression_always_false_highlighting

Warning

The given expression of 'is' operator is always of the provided type


resharper_is_expression_always_true_highlighting

Warning

The pattern is redundant, it does not produce any runtime checks


resharper_pattern_is_redundant_highlighting

Warning

The source expression always matches the provided pattern


resharper_pattern_always_matches_highlighting

Warning

The source expression never matches the provided pattern


resharper_pattern_never_matches_highlighting

Warning

Thread static field has initializer


resharper_thread_static_field_has_initializer_highlighting

Warning

Try cast and check for null can be replaced with a type check


resharper_safe_cast_is_used_as_type_check_highlighting

Suggestion

Type check and casts can be merged


resharper_merge_cast_with_type_check_highlighting

Suggestion

Type pattern and casts can be merged


resharper_use_switch_case_pattern_variable_highlighting

Suggestion

Unassigned field (non-private accessibility)


resharper_unassigned_field_global_highlighting

Suggestion

Unassigned field (private accessibility)


resharper_unassigned_field_local_highlighting

Warning

Unassigned readonly field


resharper_unassigned_readonly_field_highlighting

Warning

Unknown Razor layout


resharper_razor_layout_not_resolved_highlighting

Error

Unknown Razor section


resharper_razor_section_not_resolved_highlighting

Error

Usage of <inheritdoc /> is invalid


resharper_inheritdoc_invalid_usage_highlighting

Warning

Use <inheritdoc /> on root level to inherit documentation from base candidate


resharper_inheritdoc_consider_usage_highlighting

Disabled

Use collection's count property


resharper_use_collection_count_property_highlighting

Suggestion

Use format specifier in format strings


resharper_use_format_specifier_in_format_string_highlighting

Suggestion

Use format specifier in interpolated strings


resharper_simplify_string_interpolation_highlighting

Suggestion

Use null check instead of a type check succeeding on any not-null value


resharper_convert_type_check_to_null_check_highlighting

Warning

Use null check pattern instead of a type check succeeding on any not-null value


resharper_convert_type_check_pattern_to_null_check_highlighting

Warning

Use nullable annotation instead of an attribute


resharper_use_nullable_annotation_instead_of_attribute_highlighting

Suggestion

Useless arithmetical operation


resharper_useless_binary_operation_highlighting

Warning

Using stackalloc inside loop


resharper_stack_alloc_inside_loop_highlighting

Warning

Value assigned to a property of non-variable qualifier expression can be lost


resharper_possible_struct_member_modification_of_non_variable_struct_highlighting

Warning

'value' parameter is not used


resharper_value_parameter_not_used_highlighting

Warning

Variable can be declared as non-nullable


resharper_variable_can_be_not_nullable_highlighting

Warning

Variable in local function hides variable from outer scope


resharper_variable_hides_outer_variable_highlighting

Warning

Virtual member call in constructor


resharper_virtual_member_call_in_constructor_highlighting

Warning

'void' method is annotated with the [MustDisposeResource] attribute


resharper_void_method_with_must_dispose_resource_attribute_highlighting

Warning

'void' method is annotated with the [MustUseReturnValue] attribute


resharper_void_method_with_must_use_return_value_attribute_highlighting

Warning

'void' method is annotated with the [Pure] attribute


resharper_pure_attribute_on_void_method_highlighting

Warning

'with' expression is used instead of object initializer


resharper_with_expression_instead_of_initializer_highlighting

Suggestion

'with' expression modifies all accessible instance members


resharper_with_expression_modifies_all_members_highlighting

Warning

Redundancies in Code (96 inspections)

Code inspections in this category look for redundancies and dead code, which affect code readability and style, and could be safely removed.

Inspection


EditorConfig property

Default severity

'??' condition is known to be null or not null


resharper_constant_null_coalescing_condition_highlighting

Warning

'??' condition is never null according to nullable reference types' annotations


resharper_null_coalescing_condition_is_always_not_null_according_to_api_contract_highlighting

Warning

[NotNull] or [CanBeNull] attribute is applied to a type that already has the same annotation from nullable reference types


resharper_redundant_nullness_attribute_with_nullable_reference_types_highlighting

Warning

Anonymous method signature is not necessary


resharper_unused_anonymous_method_signature_highlighting

Warning

Array creation can be replaced with array initializer


resharper_redundant_array_creation_expression_highlighting

Hint

Assignment is not used


resharper_redundant_assignment_highlighting

Warning

Assignment results are fully discarded


resharper_assignment_is_fully_discarded_highlighting

Warning

Comparison to integral constant is useless


resharper_useless_comparison_to_integral_constant_highlighting

Warning

Conditional access qualifier expression is known to be null or not null


resharper_constant_conditional_access_qualifier_highlighting

Warning

Conditional access qualifier expression is not null according to nullable reference types' annotations


resharper_conditional_access_qualifier_is_non_nullable_according_to_api_contract_highlighting

Warning

'ContainsKey' call is redundant before adding the item to the dictionary


resharper_redundant_dictionary_contains_key_before_adding_highlighting

Warning

Double negation operator


resharper_double_negation_operator_highlighting

Suggestion

Empty 'for' loop is redundant


resharper_empty_for_statement_highlighting

Warning

Empty region


resharper_empty_region_highlighting

Suggestion

Explicit delegate creation expression is redundant


resharper_redundant_delegate_creation_highlighting

Warning

Expression is always 'null'


resharper_expression_is_always_null_highlighting

Warning

Expression is always 'true' or always 'false'


resharper_condition_is_always_true_or_false_highlighting

Warning

Expression is always 'true' or 'false' according to nullable reference types' annotations


resharper_condition_is_always_true_or_false_according_to_nullable_api_contract_highlighting

Warning

Heuristically unreachable code


resharper_heuristic_unreachable_code_highlighting

Warning

Immediate delegate invocation


resharper_redundant_immediate_delegate_invocation_highlighting

Suggestion

Math.Abs() argument is always non-negative


resharper_math_abs_method_is_redundant_highlighting

Warning

Math.Sign() method always gives the same result


resharper_suspicious_math_sign_method_highlighting

Warning

Parentheses are redundant if attribute has no arguments


resharper_redundant_attribute_parentheses_highlighting

Hint

Pattern is always 'true' or always 'false'


resharper_pattern_is_always_true_or_false_highlighting

Warning

Private field can be converted into local variable


resharper_private_field_can_be_converted_to_local_variable_highlighting

Warning

Raw string can be simplified


resharper_raw_string_can_be_simplified_highlighting

Hint

Redundant [AttributeUsage] attribute property assignment


resharper_redundant_attribute_usage_property_highlighting

Suggestion

Redundant 'abstract' modifier


resharper_redundant_abstract_modifier_highlighting

Warning

Redundant anonymous type property explicit name


resharper_redundant_anonymous_type_property_name_highlighting

Warning

Redundant argument passed to caller argument expression parameter


resharper_redundant_caller_argument_expression_default_value_highlighting

Warning

Redundant argument with default value


resharper_redundant_argument_default_value_highlighting

Warning

Redundant arithmetic overflow checking context


resharper_redundant_overflow_checking_context_highlighting

Warning

Redundant 'Attribute' suffix


resharper_redundant_attribute_suffix_highlighting

Warning

Redundant 'base.' qualifier


resharper_redundant_base_qualifier_highlighting

Warning

Redundant boolean comparison


resharper_redundant_bool_compare_highlighting

Warning

Redundant braces in collection initializer


resharper_redundant_collection_initializer_element_braces_highlighting

Hint

Redundant 'case' label


resharper_redundant_case_label_highlighting

Warning

Redundant 'case' label before default section


resharper_redundant_enum_case_label_for_default_section_highlighting

Disabled

Redundant cast


resharper_redundant_cast_highlighting

Warning

Redundant catch clause


resharper_redundant_catch_clause_highlighting

Warning

Redundant 'class' keyword in record declaration


resharper_redundant_record_class_keyword_highlighting

Warning

Redundant condition check before assignments


resharper_redundant_check_before_assignment_highlighting

Warning

Redundant conditional ternary expression usage


resharper_redundant_ternary_expression_highlighting

Warning

Redundant context capturing with 'ConfigureAwait'


resharper_redundant_configure_await_highlighting

Suggestion

Redundant control flow jump statement


resharper_redundant_jump_statement_highlighting

Warning

Redundant discard designation


resharper_redundant_discard_designation_highlighting

Suggestion

Redundant 'else' keyword


resharper_redundant_if_else_block_highlighting

Hint

Redundant empty argument list on object creation expression


resharper_redundant_empty_object_creation_argument_list_highlighting

Hint

Redundant empty finally block


resharper_redundant_empty_finally_block_highlighting

Warning

Redundant empty object or collection initializer


resharper_redundant_empty_object_or_collection_initializer_highlighting

Warning

Redundant empty switch section


resharper_redundant_empty_switch_section_highlighting

Warning

Redundant explicit array creation in argument of 'params' parameter


resharper_redundant_explicit_params_array_creation_highlighting

Suggestion

Redundant explicit nullable type creation


resharper_redundant_explicit_nullable_creation_highlighting

Warning

Redundant explicit positional property declaration


resharper_redundant_explicit_positional_property_declaration_highlighting

Warning

Redundant explicit size specification in array creation


resharper_redundant_explicit_array_size_highlighting

Warning

Redundant explicit tuple component name


resharper_redundant_explicit_tuple_component_name_highlighting

Warning

Redundant explicit type in array creation


resharper_redundant_explicit_array_creation_highlighting

Warning

Redundant fixed pointer declaration


resharper_redundant_fixed_pointer_declaration_highlighting

Suggestion

Redundant global using directive


resharper_redundant_using_directive_global_highlighting

Warning

Redundant 'IEnumerable.Cast<T>' or 'IEnumerable.OfType<T>' call


resharper_redundant_enumerable_cast_call_highlighting

Warning

Redundant lambda expression parameter type specification


resharper_redundant_lambda_parameter_type_highlighting

Warning

Redundant lambda signature parentheses


resharper_redundant_lambda_signature_parentheses_highlighting

Hint

Redundant name qualifier


resharper_redundant_name_qualifier_highlighting

Warning

Redundant 'notnull' constraint on type parameter constrained by non-nullable base type


resharper_redundant_not_null_constraint_highlighting

Warning

Redundant nullable annotation on base type constraint of type parameter constrained by another non-nullable base type


resharper_redundant_nullable_annotation_on_type_constraint_has_non_nullable_base_type_highlighting

Warning

Redundant nullable annotation on base type constraint of type parameter having non-nullable type kind


resharper_redundant_nullable_annotation_on_type_constraint_has_non_nullable_type_kind_highlighting

Warning

Redundant nullable annotation on 'class?' constraint of type parameter constrained by non-nullable base type


resharper_redundant_nullable_annotation_on_reference_type_constraint_highlighting

Warning

Redundant nullable attribute


resharper_redundant_nullable_flow_attribute_highlighting

Warning

Redundant nullable directive


resharper_redundant_nullable_directive_highlighting

Warning

Redundant nullable warning suppression expression


resharper_redundant_suppress_nullable_warning_expression_highlighting

Warning

Redundant 'object.ToString()' call


resharper_redundant_to_string_call_highlighting

Warning

Redundant 'object.ToString()' call for value types


resharper_redundant_to_string_call_for_value_type_highlighting

Hint

Redundant operand in logical conditional expression


resharper_redundant_logical_conditional_expression_operand_highlighting

Warning

Redundant 'orderby' clause 'ascending' keyword


resharper_redundant_query_order_by_ascending_keyword_highlighting

Hint

Redundant property pattern clause


resharper_redundant_property_pattern_clause_highlighting

Suggestion

Redundant range bound


resharper_redundant_range_bound_highlighting

Suggestion

Redundant 'readonly' modifier


resharper_redundant_readonly_modifier_highlighting

Suggestion

Redundant 'scoped' parameter modifier


resharper_redundant_scoped_parameter_modifier_highlighting

Warning

Redundant semicolon after type or namespace declaration


resharper_redundant_declaration_semicolon_highlighting

Hint

Redundant string interpolation


resharper_redundant_string_interpolation_highlighting

Suggestion

Redundant 'string.Format()' call


resharper_redundant_string_format_call_highlighting

Warning

Redundant 'string.ToCharArray()' call


resharper_redundant_string_to_char_array_call_highlighting

Warning

Redundant type arguments of method


resharper_redundant_type_arguments_of_method_highlighting

Warning

Redundant type check in a pattern


resharper_redundant_type_check_in_pattern_highlighting

Warning

Redundant type declaration body


resharper_redundant_type_declaration_body_highlighting

Suggestion

Redundant using directive


resharper_redundant_using_directive_highlighting

Warning

Redundant verbatim prefix


resharper_redundant_verbatim_prefix_highlighting

Suggestion

Redundant verbatim string prefix


resharper_redundant_verbatim_string_prefix_highlighting

Suggestion

Redundant 'virtual' modifier


resharper_redundant_virtual_modifier_highlighting

Warning

Redundant 'WithCancellation()' invocation


resharper_redundant_with_cancellation_highlighting

Warning

Remove redundant pattern-matching parentheses


resharper_redundant_pattern_parentheses_highlighting

Hint

Subpattern that always matches is redundant


resharper_redundant_always_match_subpattern_highlighting

Suggestion

'true' is redundant as 'for'-statement condition


resharper_for_statement_condition_is_true_highlighting

Warning

Type check for nullable type is equal to underlying type check


resharper_redundant_nullable_type_mark_highlighting

Warning

Unsafe context declaration is redundant


resharper_redundant_unsafe_context_highlighting

Warning

Unused nullable directive


resharper_unused_nullable_directive_highlighting

Warning

Redundancies in Symbol Declarations (49 inspections)

This category includes code inspections, mostly with the warning severity level, which detect empty and unused symbol declarations.

Inspection


EditorConfig property

Default severity

Class with virtual (overridable) members never inherited (non-private accessibility)


resharper_class_with_virtual_members_never_inherited_global_highlighting

Suggestion

Class with virtual (overridable) members never inherited (private accessibility)


resharper_class_with_virtual_members_never_inherited_local_highlighting

Suggestion

Component of the tuple is never used


resharper_unused_tuple_component_in_return_value_highlighting

Warning

'DefaultParameterValueAttribute' must be used in conjunction with 'OptionalAttribute'


resharper_meaningless_default_parameter_value_highlighting

Warning

Empty constructor


resharper_empty_constructor_highlighting

Warning

Empty destructor


resharper_empty_destructor_highlighting

Warning

Empty namespace declaration


resharper_empty_namespace_highlighting

Warning

Entity is only used to capture its name (non-private accessibility)


resharper_entity_name_captured_only_global_highlighting

Warning

Entity is only used to capture its name (private accessibility)


resharper_entity_name_captured_only_local_highlighting

Warning

Local function is never used


resharper_unused_local_function_highlighting

Warning

Local function is never used


resharper_unused_local_function_compiler_highlighting

Warning

Local function return value is never used


resharper_unused_local_function_return_value_highlighting

Warning

Method return value is never used (non-private accessibility)


resharper_unused_method_return_value_global_highlighting

Suggestion

Method return value is never used (private accessibility)


resharper_unused_method_return_value_local_highlighting

Warning

Non-accessed local variable


resharper_not_accessed_variable_highlighting

Warning

Non-accessed local variable only used to discard the 'out' parameter value


resharper_not_accessed_out_parameter_variable_highlighting

Warning

Not accessed primary constructor parameter


resharper_not_accessed_primary_constructor_parameter_compiler_highlighting

Warning

Parameter is only used for precondition check (non-private accessibility)


resharper_parameter_only_used_for_precondition_check_global_highlighting

Suggestion

Parameter is only used for precondition check (private accessibility)


resharper_parameter_only_used_for_precondition_check_local_highlighting

Warning

Parameter output value is always discarded (non-private accessibility)


resharper_out_parameter_value_is_always_discarded_global_highlighting

Suggestion

Parameter output value is always discarded (private accessibility)


resharper_out_parameter_value_is_always_discarded_local_highlighting

Warning

'params' modifier is always ignored on overrides


resharper_redundant_params_highlighting

Warning

Redundant base constructor call


resharper_redundant_base_constructor_call_highlighting

Warning

Redundant class or interface specification in base types list


resharper_redundant_extends_list_entry_highlighting

Warning

Redundant member initializer


resharper_redundant_default_member_initializer_highlighting

Warning

Redundant member override


resharper_redundant_overridden_member_highlighting

Warning

Redundant method overload (non-private accessibility)


resharper_redundant_overload_global_highlighting

Suggestion

Redundant method overload (private accessibility)


resharper_redundant_overload_local_highlighting

Suggestion

Redundant 'partial' modifier on method declaration


resharper_partial_method_with_single_part_highlighting

Warning

Redundant 'partial' modifier on type declaration


resharper_partial_type_with_single_part_highlighting

Warning

Sealed member in sealed class


resharper_sealed_member_in_sealed_class_highlighting

Warning

Type is never used (non-private accessibility)


resharper_unused_type_global_highlighting

Suggestion

Type is never used (private accessibility)


resharper_unused_type_local_highlighting

Warning

Type member is never accessed via base type (non-private accessibility)


resharper_unused_member_in_super_global_highlighting

Suggestion

Type member is never accessed via base type (private accessibility)


resharper_unused_member_in_super_local_highlighting

Warning

Type member is never used (non-private accessibility)


resharper_unused_member_global_highlighting

Suggestion

Type member is never used (private accessibility)


resharper_unused_member_local_highlighting

Warning

Type member is only used in overrides (non-private accessibility)


resharper_unused_member_hierarchy_global_highlighting

Suggestion

Type member is only used in overrides (private accessibility)


resharper_unused_member_hierarchy_local_highlighting

Warning

Underlying type of enum is 'int'


resharper_enum_underlying_type_is_int_highlighting

Warning

Unused label


resharper_unused_label_highlighting

Warning

Unused local variable


resharper_unused_variable_highlighting

Warning

Unused parameter (non-private accessibility)


resharper_unused_parameter_global_highlighting

Suggestion

Unused parameter (private accessibility)


resharper_unused_parameter_local_highlighting

Warning

Unused parameter in partial method


resharper_unused_parameter_in_partial_method_highlighting

Warning

Unused positional parameter


resharper_unused_positional_parameter_compiler_highlighting

Warning

Unused type parameter


resharper_unused_type_parameter_highlighting

Warning

Virtual (overridable) member is never overridden (non-private accessibility)


resharper_virtual_member_never_overridden_global_highlighting

Suggestion

Virtual (overridable) member is never overridden (private accessibility)


resharper_virtual_member_never_overridden_local_highlighting

Suggestion

Last modified: 11 February 2024