ReSharper 2023.1 Help

Code Inspections in C#

In C#, ReSharper 2023.1 provides two kinds of code inspections: 1064 inspections that detect errors such as broken syntax, unresolved symbols, compiler errors, and so on (you cannot configure or disable any of these inspections), and 914 proprietary code inspections, any of which you can disable or change its severity level.
These code inspections help you detect code issues in design time in all open files, and additionally they allow you to find code issues in specific scope.

Configurable C# inspections are listed below, grouped by their categories.

Code Notification (2 inspections)

This category groups code inspections with minor severity levels.

Inspection


ID


EditorConfig property

Default severity

Method invocation is skipped


InvocationIsSkipped


resharper_invocation_is_skipped_highlighting

Hint

Part of the code cannot be parsed


NonParsableElement


resharper_non_parsable_element_highlighting

Warning

Common Practices and Code Improvements (160 inspections)

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

Inspection


ID


EditorConfig property

Default severity

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


AccessToStaticMemberViaDerivedType


resharper_access_to_static_member_via_derived_type_highlighting

Warning

Annotation duplicate in hierarchy


AnnotationRedundancyInHierarchy


resharper_annotation_redundancy_in_hierarchy_highlighting

Warning

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


AutoPropertyCanBeMadeGetOnly.Global


resharper_auto_property_can_be_made_get_only_global_highlighting

Suggestion

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


AutoPropertyCanBeMadeGetOnly.Local


resharper_auto_property_can_be_made_get_only_local_highlighting

Suggestion

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


BaseMemberHasParams


resharper_base_member_has_params_highlighting

Warning

Check for reference equality instead


CheckForReferenceEqualityInstead.1


resharper_check_for_reference_equality_instead_1_highlighting

Suggestion

Check for reference equality instead


CheckForReferenceEqualityInstead.3


resharper_check_for_reference_equality_instead_3_highlighting

Suggestion

Check for reference equality instead


CheckForReferenceEqualityInstead.2


resharper_check_for_reference_equality_instead_2_highlighting

Suggestion

Check for reference equality instead


CheckForReferenceEqualityInstead.4


resharper_check_for_reference_equality_instead_4_highlighting

Suggestion

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


ClassCanBeSealed.Global


resharper_class_can_be_sealed_global_highlighting

Disabled

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


ClassCanBeSealed.Local


resharper_class_can_be_sealed_local_highlighting

Disabled

Container nullability attribute usage with declaration of non-container type


ContainerAnnotationRedundancy


resharper_container_annotation_redundancy_highlighting

Warning

Convert 'if do while' into 'while'


ConvertIfDoToWhile


resharper_convert_if_do_to_while_highlighting

Suggestion

Convert 'if' into '||'


ConvertIfToOrExpression


resharper_convert_if_to_or_expression_highlighting

Suggestion

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


ConvertToConstant.Global


resharper_convert_to_constant_global_highlighting

Hint

Convert local variable or field into constant (private accessibility)


ConvertToConstant.Local


resharper_convert_to_constant_local_highlighting

Hint

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


AnnotateNotNullParameter


resharper_annotate_not_null_parameter_highlighting

Disabled

Declaration nullability inferred (parameter is inferred to be nullable)


AnnotateCanBeNullParameter


resharper_annotate_can_be_null_parameter_highlighting

Disabled

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


AnnotateNotNullTypeMember


resharper_annotate_not_null_type_member_highlighting

Disabled

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


AnnotateCanBeNullTypeMember


resharper_annotate_can_be_null_type_member_highlighting

Disabled

Dictionary lookup can be simplified with 'TryAdd'


CanSimplifyDictionaryLookupWithTryAdd


resharper_can_simplify_dictionary_lookup_with_try_add_highlighting

Warning

Dictionary lookup can be simplified with 'TryGetValue'


CanSimplifyDictionaryLookupWithTryGetValue


resharper_can_simplify_dictionary_lookup_with_try_get_value_highlighting

Warning

Empty control statement body


EmptyEmbeddedStatement


resharper_empty_embedded_statement_highlighting

Warning

Empty statement is redundant


EmptyStatement


resharper_empty_statement_highlighting

Warning

Extract common property pattern


ExtractCommonPropertyPattern


resharper_extract_common_property_pattern_highlighting

Hint

Field can be made readonly (non-private accessibility)


FieldCanBeMadeReadOnly.Global


resharper_field_can_be_made_read_only_global_highlighting

Suggestion

Field can be made readonly (private accessibility)


FieldCanBeMadeReadOnly.Local


resharper_field_can_be_made_read_only_local_highlighting

Suggestion

Get-only auto-property is never assigned


UnassignedGetOnlyAutoProperty


resharper_unassigned_get_only_auto_property_highlighting

Warning

Invert condition


InvertCondition.1


resharper_invert_condition_1_highlighting

Hint

Iteration variable can be declared with a more specific type


MoreSpecificForeachVariableTypeAvailable


resharper_more_specific_foreach_variable_type_available_highlighting

Suggestion

Join local variable declaration and assignment


JoinDeclarationAndInitializer


resharper_join_declaration_and_initializer_highlighting

Suggestion

Literal length can be reduced by using verbatim string


UseVerbatimString


resharper_use_verbatim_string_highlighting

Hint

Local function can be made static


LocalFunctionCanBeMadeStatic


resharper_local_function_can_be_made_static_highlighting

Disabled

Local variable has too wide declaration scope


TooWideLocalVariableScope


resharper_too_wide_local_variable_scope_highlighting

Suggestion

Make constructor in abstract class protected


PublicConstructorInAbstractClass


resharper_public_constructor_in_abstract_class_highlighting

Suggestion

Member can be made private (non-private accessibility)


MemberCanBePrivate.Global


resharper_member_can_be_private_global_highlighting

Suggestion

Member can be made private (private accessibility)


MemberCanBePrivate.Local


resharper_member_can_be_private_local_highlighting

Suggestion

Member can be made protected (non-private accessibility)


MemberCanBeProtected.Global


resharper_member_can_be_protected_global_highlighting

Suggestion

Member can be made protected (private accessibility)


MemberCanBeProtected.Local


resharper_member_can_be_protected_local_highlighting

Suggestion

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


MemberCanBeMadeStatic.Global


resharper_member_can_be_made_static_global_highlighting

Hint

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


MemberCanBeMadeStatic.Local


resharper_member_can_be_made_static_local_highlighting

Hint

Member or type can be made internal (friend)


MemberCanBeInternal


resharper_member_can_be_internal_highlighting

Disabled

Method has async overload


MethodHasAsyncOverload


resharper_method_has_async_overload_highlighting

Suggestion

Method has async overload with cancellation support


MethodHasAsyncOverloadWithCancellation


resharper_method_has_async_overload_with_cancellation_highlighting

Suggestion

Method supports cancellation


MethodSupportsCancellation


resharper_method_supports_cancellation_highlighting

Suggestion

Missing XML comment for private or internal type or member


InternalOrPrivateMemberNotDocumented


resharper_internal_or_private_member_not_documented_highlighting

Disabled

Multiple nullable attributes usage


MultipleNullableAttributesUsage


resharper_multiple_nullable_attributes_usage_highlighting

Warning

Nested string interpolation can be inlined


NestedStringInterpolation


resharper_nested_string_interpolation_highlighting

Suggestion

Nullability attribute usage with declaration of void or value type


AnnotationRedundancyAtValueType


resharper_annotation_redundancy_at_value_type_highlighting

Warning

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


NotObservableAnnotationRedundancy


resharper_not_observable_annotation_redundancy_highlighting

Warning

Parameter can be declared with the base type


SuggestBaseTypeForParameter


resharper_suggest_base_type_for_parameter_highlighting

Hint

Parameter can be declared with the base type


SuggestBaseTypeForParameterInConstructor


resharper_suggest_base_type_for_parameter_in_constructor_highlighting

Hint

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


ParameterTypeCanBeEnumerable.Global


resharper_parameter_type_can_be_enumerable_global_highlighting

Hint

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


ParameterTypeCanBeEnumerable.Local


resharper_parameter_type_can_be_enumerable_local_highlighting

Hint

Possible mistaken argument


PossibleMistakenArgument


resharper_possible_mistaken_argument_highlighting

Warning

Possible mistaken call to GetType()


PossibleMistakenCallToGetType.1


resharper_possible_mistaken_call_to_get_type_1_highlighting

Warning

Possible mistaken call to GetType()


PossibleMistakenCallToGetType.2


resharper_possible_mistaken_call_to_get_type_2_highlighting

Warning

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


PropertyCanBeMadeInitOnly.Global


resharper_property_can_be_made_init_only_global_highlighting

Suggestion

Property can be made init-only (private accessibility)


PropertyCanBeMadeInitOnly.Local


resharper_property_can_be_made_init_only_local_highlighting

Suggestion

Redundant 'is'


RedundantIsBeforeRelationalPattern


resharper_redundant_is_before_relational_pattern_highlighting

Suggestion

Remove constructor invocation


RemoveConstructorInvocation


resharper_remove_constructor_invocation_highlighting

Disabled

Remove redundant statement


RemoveRedundantOrStatement.False


resharper_remove_redundant_or_statement_false_highlighting

Suggestion

Remove redundant statement


RemoveRedundantOrStatement.True


resharper_remove_redundant_or_statement_true_highlighting

Suggestion

Remove ToList()


RemoveToList.1


resharper_remove_to_list_1_highlighting

Suggestion

Remove ToList()


RemoveToList.2


resharper_remove_to_list_2_highlighting

Suggestion

Replace with FirstOrDefault($args$)


ReplaceWithFirstOrDefault.1


resharper_replace_with_first_or_default_1_highlighting

Suggestion

Replace with FirstOrDefault($args$)


ReplaceWithFirstOrDefault.2


resharper_replace_with_first_or_default_2_highlighting

Suggestion

Replace with FirstOrDefault($args$)


ReplaceWithFirstOrDefault.3


resharper_replace_with_first_or_default_3_highlighting

Suggestion

Replace with FirstOrDefault($args$)


ReplaceWithFirstOrDefault.4


resharper_replace_with_first_or_default_4_highlighting

Suggestion

Replace with LastOrDefault($args$)


ReplaceWithLastOrDefault.1


resharper_replace_with_last_or_default_1_highlighting

Suggestion

Replace with LastOrDefault($args$)


ReplaceWithLastOrDefault.2


resharper_replace_with_last_or_default_2_highlighting

Suggestion

Replace with LastOrDefault($args$)


ReplaceWithLastOrDefault.3


resharper_replace_with_last_or_default_3_highlighting

Suggestion

Replace with LastOrDefault($args$)


ReplaceWithLastOrDefault.4


resharper_replace_with_last_or_default_4_highlighting

Suggestion

Replace with OfType<T>()


ReplaceWithOfType.1


resharper_replace_with_of_type_1_highlighting

Suggestion

Replace with OfType<T>()


ReplaceWithOfType.2


resharper_replace_with_of_type_2_highlighting

Suggestion

Replace with OfType<T>()


ReplaceWithOfType.3


resharper_replace_with_of_type_3_highlighting

Suggestion

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


ReplaceWithOfType.Any.1


resharper_replace_with_of_type_any_1_highlighting

Suggestion

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


ReplaceWithOfType.Any.2


resharper_replace_with_of_type_any_2_highlighting

Suggestion

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


ReplaceWithOfType.Count.1


resharper_replace_with_of_type_count_1_highlighting

Suggestion

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


ReplaceWithOfType.Count.2


resharper_replace_with_of_type_count_2_highlighting

Suggestion

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


ReplaceWithOfType.First.1


resharper_replace_with_of_type_first_1_highlighting

Suggestion

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


ReplaceWithOfType.First.2


resharper_replace_with_of_type_first_2_highlighting

Suggestion

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


ReplaceWithOfType.FirstOrDefault.1


resharper_replace_with_of_type_first_or_default_1_highlighting

Suggestion

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


ReplaceWithOfType.FirstOrDefault.2


resharper_replace_with_of_type_first_or_default_2_highlighting

Suggestion

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


ReplaceWithOfType.Last.1


resharper_replace_with_of_type_last_1_highlighting

Suggestion

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


ReplaceWithOfType.Last.2


resharper_replace_with_of_type_last_2_highlighting

Suggestion

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


ReplaceWithOfType.LastOrDefault.1


resharper_replace_with_of_type_last_or_default_1_highlighting

Suggestion

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


ReplaceWithOfType.LastOrDefault.2


resharper_replace_with_of_type_last_or_default_2_highlighting

Suggestion

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


ReplaceWithOfType.LongCount


resharper_replace_with_of_type_long_count_highlighting

Suggestion

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


ReplaceWithOfType.Single.1


resharper_replace_with_of_type_single_1_highlighting

Suggestion

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


ReplaceWithOfType.Single.2


resharper_replace_with_of_type_single_2_highlighting

Suggestion

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


ReplaceWithOfType.SingleOrDefault.1


resharper_replace_with_of_type_single_or_default_1_highlighting

Suggestion

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


ReplaceWithOfType.SingleOrDefault.2


resharper_replace_with_of_type_single_or_default_2_highlighting

Suggestion

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


ReplaceWithOfType.Where


resharper_replace_with_of_type_where_highlighting

Suggestion

Replace with simple assignment


ReplaceWithSimpleAssignment.True


resharper_replace_with_simple_assignment_true_highlighting

Suggestion

Replace with simple assignment


ReplaceWithSimpleAssignment.False


resharper_replace_with_simple_assignment_false_highlighting

Suggestion

Replace with single assignment


ReplaceWithSingleAssignment.False


resharper_replace_with_single_assignment_false_highlighting

Suggestion

Replace with single assignment


ReplaceWithSingleAssignment.True


resharper_replace_with_single_assignment_true_highlighting

Suggestion

Replace with single call to Any(..)


ReplaceWithSingleCallToAny


resharper_replace_with_single_call_to_any_highlighting

Suggestion

Replace with single call to Count(..)


ReplaceWithSingleCallToCount


resharper_replace_with_single_call_to_count_highlighting

Suggestion

Replace with single call to First(..)


ReplaceWithSingleCallToFirst


resharper_replace_with_single_call_to_first_highlighting

Suggestion

Replace with single call to FirstOrDefault(..)


ReplaceWithSingleCallToFirstOrDefault


resharper_replace_with_single_call_to_first_or_default_highlighting

Suggestion

Replace with single call to Last(..)


ReplaceWithSingleCallToLast


resharper_replace_with_single_call_to_last_highlighting

Suggestion

Replace with single call to LastOrDefault(..)


ReplaceWithSingleCallToLastOrDefault


resharper_replace_with_single_call_to_last_or_default_highlighting

Suggestion

Replace with single call to Single(..)


ReplaceWithSingleCallToSingle


resharper_replace_with_single_call_to_single_highlighting

Suggestion

Replace with single call to SingleOrDefault(..)


ReplaceWithSingleCallToSingleOrDefault


resharper_replace_with_single_call_to_single_or_default_highlighting

Suggestion

Replace with SingleOrDefault($args$)


ReplaceWithSingleOrDefault.1


resharper_replace_with_single_or_default_1_highlighting

Suggestion

Replace with SingleOrDefault($args$)


ReplaceWithSingleOrDefault.2


resharper_replace_with_single_or_default_2_highlighting

Suggestion

Replace with SingleOrDefault($args$)


ReplaceWithSingleOrDefault.3


resharper_replace_with_single_or_default_3_highlighting

Suggestion

Replace with SingleOrDefault($args$)


ReplaceWithSingleOrDefault.4


resharper_replace_with_single_or_default_4_highlighting

Suggestion

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


ReturnTypeCanBeEnumerable.Global


resharper_return_type_can_be_enumerable_global_highlighting

Hint

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


ReturnTypeCanBeEnumerable.Local


resharper_return_type_can_be_enumerable_local_highlighting

Hint

Simplify conditional ternary expression


SimplifyConditionalTernaryExpression


resharper_simplify_conditional_ternary_expression_highlighting

Suggestion

Simplify LINQ expression (use 'All')


SimplifyLinqExpressionUseAll


resharper_simplify_linq_expression_use_all_highlighting

Suggestion

Simplify LINQ expression (use 'Any')


SimplifyLinqExpressionUseAny


resharper_simplify_linq_expression_use_any_highlighting

Suggestion

Simplify negated pattern


DoubleNegationInPattern


resharper_double_negation_in_pattern_highlighting

Suggestion

Simplify negated relational pattern


NegationOfRelationalPattern


resharper_negation_of_relational_pattern_highlighting

Suggestion

Simplify negative equality expression


NegativeEqualityExpression


resharper_negative_equality_expression_highlighting

Suggestion

Specify string comparison explicitly


SpecifyStringComparison


resharper_specify_string_comparison_highlighting

Hint

Specify string culture explicitly


SpecifyACultureInStringConversionExplicitly


resharper_specify_a_culture_in_string_conversion_explicitly_highlighting

Warning

String literal can be inlined


StringLiteralAsInterpolationArgument


resharper_string_literal_as_interpolation_argument_highlighting

Suggestion

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


StringCompareIsCultureSpecific.4


resharper_string_compare_is_culture_specific_4_highlighting

Warning

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


StringCompareIsCultureSpecific.5


resharper_string_compare_is_culture_specific_5_highlighting

Warning

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


StringCompareIsCultureSpecific.6


resharper_string_compare_is_culture_specific_6_highlighting

Warning

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


StringCompareIsCultureSpecific.1


resharper_string_compare_is_culture_specific_1_highlighting

Warning

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


StringCompareIsCultureSpecific.2


resharper_string_compare_is_culture_specific_2_highlighting

Warning

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


StringCompareIsCultureSpecific.3


resharper_string_compare_is_culture_specific_3_highlighting

Warning

String.CompareTo is culture-specific


StringCompareToIsCultureSpecific


resharper_string_compare_to_is_culture_specific_highlighting

Warning

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


StringEndsWithIsCultureSpecific


resharper_string_ends_with_is_culture_specific_highlighting

Disabled

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


StringIndexOfIsCultureSpecific.1


resharper_string_index_of_is_culture_specific_1_highlighting

Warning

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


StringIndexOfIsCultureSpecific.2


resharper_string_index_of_is_culture_specific_2_highlighting

Warning

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


StringIndexOfIsCultureSpecific.3


resharper_string_index_of_is_culture_specific_3_highlighting

Warning

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


StringLastIndexOfIsCultureSpecific.1


resharper_string_last_index_of_is_culture_specific_1_highlighting

Warning

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


StringLastIndexOfIsCultureSpecific.2


resharper_string_last_index_of_is_culture_specific_2_highlighting

Warning

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


StringLastIndexOfIsCultureSpecific.3


resharper_string_last_index_of_is_culture_specific_3_highlighting

Warning

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


StringStartsWithIsCultureSpecific


resharper_string_starts_with_is_culture_specific_highlighting

Disabled

Struct can be made readonly


StructCanBeMadeReadOnly


resharper_struct_can_be_made_read_only_highlighting

Suggestion

Struct member can be made readonly


StructMemberCanBeMadeReadOnly


resharper_struct_member_can_be_made_read_only_highlighting

Disabled

try-catch and try-finally statements can be merged


TryStatementsCanBeMerged


resharper_try_statements_can_be_merged_highlighting

Hint

Type can be made file-local


MemberCanBeFileLocal


resharper_member_can_be_file_local_highlighting

Disabled

Type parameter could be declared as covariant or contravariant


TypeParameterCanBeVariant


resharper_type_parameter_can_be_variant_highlighting

Suggestion

Use 'ArgumentNullException.ThrowIfNull'


UseThrowIfNullMethod


resharper_use_throw_if_null_method_highlighting

Disabled

Use array creation expression


UseArrayCreationExpression.1


resharper_use_array_creation_expression_1_highlighting

Suggestion

Use array creation expression


UseArrayCreationExpression.2


resharper_use_array_creation_expression_2_highlighting

Suggestion

Use 'Array.Empty<T>()'


UseArrayEmptyMethod


resharper_use_array_empty_method_highlighting

Suggestion

Use cancellation token


UseCancellationTokenForIAsyncEnumerable


resharper_use_cancellation_token_for_i_async_enumerable_highlighting

Suggestion

Use compiler-supported nullable attributes


UseNullableAttributesSupportedByCompiler


resharper_use_nullable_attributes_supported_by_compiler_highlighting

Suggestion

Use 'EventArgs.Empty'


UseEventArgsEmptyField


resharper_use_event_args_empty_field_highlighting

Suggestion

Use indexed property


UseIndexedProperty


resharper_use_indexed_property_highlighting

Suggestion

Use 'is' operator


UseIsOperator.1


resharper_use_is_operator_1_highlighting

Suggestion

Use 'is' operator


UseIsOperator.2


resharper_use_is_operator_2_highlighting

Suggestion

Use method Any()


UseMethodAny.0


resharper_use_method_any_0_highlighting

Suggestion

Use method Any()


UseMethodAny.1


resharper_use_method_any_1_highlighting

Suggestion

Use method Any()


UseMethodAny.2


resharper_use_method_any_2_highlighting

Suggestion

Use method Any()


UseMethodAny.3


resharper_use_method_any_3_highlighting

Suggestion

Use method Any()


UseMethodAny.4


resharper_use_method_any_4_highlighting

Suggestion

Use method IsInstanceOfType(..)


UseMethodIsInstanceOfType


resharper_use_method_is_instance_of_type_highlighting

Suggestion

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


SimplifyLinqExpressionUseMinByAndMaxBy


resharper_simplify_linq_expression_use_min_by_and_max_by_highlighting

Suggestion

Use 'String.IsNullOrEmpty'


ReplaceWithStringIsNullOrEmpty


resharper_replace_with_string_is_null_or_empty_highlighting

Suggestion

Use 'Type.EmptyTypes'


UseEmptyTypesField


resharper_use_empty_types_field_highlighting

Suggestion

Compiler Warnings (166 inspections)

Inspections in this category detect compiler warnings before you compile.

Inspection


ID


EditorConfig property

Default severity

'#warning' directive


CSharpWarnings::CS1030


resharper_c_sharp_warnings_cs1030_highlighting

Warning

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


CSharpWarnings::CS8971


resharper_c_sharp_warnings_cs8971_highlighting

Warning

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


CSharpWarnings::CS9082


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


CSharpWarnings::CS9083


resharper_c_sharp_warnings_cs9083_highlighting

Warning

A method marked [DoesNotReturn] should not return.


CSharpWarnings::CS8763


resharper_c_sharp_warnings_cs8763_highlighting

Warning

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


CSharpWarnings::CS8607


resharper_c_sharp_warnings_cs8607_highlighting

Warning

A previous catch clause already catches all exceptions


CSharpWarnings::CS1058


resharper_c_sharp_warnings_cs1058_highlighting

Warning

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


CSharpWarnings::CS9081


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


CSharpWarnings::CS1911


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.


CSharpWarnings::CS8094


resharper_c_sharp_warnings_cs8094_highlighting

Warning

Ambiguous reference in XML comment


CSharpWarnings::CS1574


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.


CSharpWarnings::CS8624


resharper_c_sharp_warnings_cs8624_highlighting

Warning

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


CSharpWarnings::CS8620


resharper_c_sharp_warnings_cs8620_highlighting

Warning

Assignment in conditional expression


CSharpWarnings::CS0665


resharper_c_sharp_warnings_cs0665_highlighting

Warning

Assignment made to same variable


CSharpWarnings::CS1717


resharper_c_sharp_warnings_cs1717_highlighting

Warning

Async function without await expression


CSharpWarnings::CS1998


resharper_c_sharp_warnings_cs1998_highlighting

Warning

Async method invocation without await expression


CSharpWarnings::CS4014


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.


CSharpWarnings::CS8892


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.


CSharpWarnings::CS8425


resharper_c_sharp_warnings_cs8425_highlighting

Warning

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


CSharpWarnings::CS0658


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


CSharpWarnings::CS0657


resharper_c_sharp_warnings_cs0657_highlighting

Warning

Badly formed XML in included comments file


CSharpWarnings::CS1592


resharper_c_sharp_warnings_cs1592_highlighting

Warning

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


CSharpWarnings::CS0675


resharper_c_sharp_warnings_cs0675_highlighting

Warning

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


CSharpWarnings::CS8656


resharper_c_sharp_warnings_cs8656_highlighting

Warning

Cannot convert null literal to non-nullable reference type.


CSharpWarnings::CS8625


resharper_c_sharp_warnings_cs8625_highlighting

Warning

Cannot resolve reference in XML comment


CSharpWarnings::CS1574,CS1584,CS1581,CS1580


resharper_c_sharp_warnings_cs1574_cs1584_cs1581_cs1580_highlighting

Warning

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


CSharpWarnings::CS0659


resharper_c_sharp_warnings_cs0659_highlighting

Warning

Code is unreachable


CSharpWarnings::CS0162


resharper_c_sharp_warnings_cs0162_highlighting

Warning

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


CSharpWarnings::CS0464


resharper_c_sharp_warnings_cs0464_highlighting

Warning

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


CSharpWarnings::CS0652


resharper_c_sharp_warnings_cs0652_highlighting

Warning

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


CSharpWarnings::CS8600


resharper_c_sharp_warnings_cs8600_highlighting

Warning

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


CSharpWarnings::CS0628


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


CSharpWarnings::CS1066


resharper_c_sharp_warnings_cs1066_highlighting

Warning

Dereference of a possibly null reference.


CSharpWarnings::CS8602


resharper_c_sharp_warnings_cs8602_highlighting

Warning

Duplicate param tag in XML comment


CSharpWarnings::CS1571


resharper_c_sharp_warnings_cs1571_highlighting

Warning

Duplicate typeparam tag in XML comment


CSharpWarnings::CS1710


resharper_c_sharp_warnings_cs1710_highlighting

Warning

Empty switch block


CSharpWarnings::CS1522


resharper_c_sharp_warnings_cs1522_highlighting

Warning

Field is never used


UnusedField.Compiler


resharper_unused_field_compiler_highlighting

Warning

Filter expression is a constant, consider removing the filter


CSharpWarnings::CS7095


resharper_c_sharp_warnings_cs7095_highlighting

Warning

Given expression always matches the provided pattern


CSharpWarnings::CS8794


resharper_c_sharp_warnings_cs8794_highlighting

Warning

Given expression is always of the provided type


CSharpWarnings::CS0183


resharper_c_sharp_warnings_cs0183_highlighting

Warning

Given expression is never of the provided type


CSharpWarnings::CS0184


resharper_c_sharp_warnings_cs0184_highlighting

Warning

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


CSharpWarnings::CS0469


resharper_c_sharp_warnings_cs0469_highlighting

Warning

Incorrect signature in XML comment


CSharpWarnings::CS1580


resharper_c_sharp_warnings_cs1580_highlighting

Warning

Introducing a 'Finalize' method can interfere with destructor invocation


CSharpWarnings::CS0465


resharper_c_sharp_warnings_cs0465_highlighting

Warning

Invalid XML in XML comment


CSharpWarnings::CS1570


resharper_c_sharp_warnings_cs1570_highlighting

Warning

Invalid XML include element


CSharpWarnings::CS1590


resharper_c_sharp_warnings_cs1590_highlighting

Warning

Keyword 'new' is redundant


CSharpWarnings::CS0109


resharper_c_sharp_warnings_cs0109_highlighting

Warning

Keyword 'new' is required


CSharpWarnings::CS0108,CS0114


resharper_c_sharp_warnings_cs0108_cs0114_highlighting

Warning

Member cannot be used in this attribute.


CSharpWarnings::CS8776


resharper_c_sharp_warnings_cs8776_highlighting

Warning

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


CSharpWarnings::CS8775


resharper_c_sharp_warnings_cs8775_highlighting

Warning

Member must have a non-null value when exiting.


CSharpWarnings::CS8774


resharper_c_sharp_warnings_cs8774_highlighting

Warning

Member overrides obsolete member


CSharpWarnings::CS0672


resharper_c_sharp_warnings_cs0672_highlighting

Warning

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


CSharpWarnings::CS8770


resharper_c_sharp_warnings_cs8770_highlighting

Warning

Missing XML comment for publicly visible type or member


CSharpWarnings::CS1591


resharper_c_sharp_warnings_cs1591_highlighting

Warning

Multiple override candidates at run-time


CSharpWarnings::CS1957


resharper_c_sharp_warnings_cs1957_highlighting

Warning

Namespace should be default namespace of this project


CSharpWarnings::WME006


resharper_c_sharp_warnings_wme006_highlighting

Warning

Non-accessed field


NotAccessedField.Compiler


resharper_not_accessed_field_compiler_highlighting

Warning

Non-accessed local variable


NotAccessedVariable.Compiler


resharper_not_accessed_variable_compiler_highlighting

Warning

Non-nullable member is uninitialized.


CSharpWarnings::CS8618


resharper_c_sharp_warnings_cs8618_highlighting

Warning

Nullability mismatch in constraints for type parameter.


CSharpWarnings::CS8633


resharper_c_sharp_warnings_cs8633_highlighting

Warning

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


CSharpWarnings::CS8643


resharper_c_sharp_warnings_cs8643_highlighting

Warning

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


CSharpWarnings::CS8644


resharper_c_sharp_warnings_cs8644_highlighting

Warning

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


CSharpWarnings::CS8616


resharper_c_sharp_warnings_cs8616_highlighting

Warning

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


CSharpWarnings::CS8613


resharper_c_sharp_warnings_cs8613_highlighting

Warning

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


CSharpWarnings::CS8609


resharper_c_sharp_warnings_cs8609_highlighting

Warning

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


CSharpWarnings::CS8819


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).


CSharpWarnings::CS8621


resharper_c_sharp_warnings_cs8621_highlighting

Warning

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


CSharpWarnings::CS8619


resharper_c_sharp_warnings_cs8619_highlighting

Warning

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


CSharpWarnings::CS8615


resharper_c_sharp_warnings_cs8615_highlighting

Warning

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


CSharpWarnings::CS8612


resharper_c_sharp_warnings_cs8612_highlighting

Warning

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


CSharpWarnings::CS8608


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).


CSharpWarnings::CS8622


resharper_c_sharp_warnings_cs8622_highlighting

Warning

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


CSharpWarnings::CS8617


resharper_c_sharp_warnings_cs8617_highlighting

Warning

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


CSharpWarnings::CS8614


resharper_c_sharp_warnings_cs8614_highlighting

Warning

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


CSharpWarnings::CS8610


resharper_c_sharp_warnings_cs8610_highlighting

Warning

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


CSharpWarnings::CS8611


resharper_c_sharp_warnings_cs8611_highlighting

Warning

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


CSharpWarnings::CS8768


resharper_c_sharp_warnings_cs8768_highlighting

Warning

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


CSharpWarnings::CS8766


resharper_c_sharp_warnings_cs8766_highlighting

Warning

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


CSharpWarnings::CS8764


resharper_c_sharp_warnings_cs8764_highlighting

Warning

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


CSharpWarnings::CS8634


resharper_c_sharp_warnings_cs8634_highlighting

Warning

Nullability of type argument doesn't match constraint type.


CSharpWarnings::CS8631


resharper_c_sharp_warnings_cs8631_highlighting

Warning

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


CSharpWarnings::CS8714


resharper_c_sharp_warnings_cs8714_highlighting

Warning

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


CSharpWarnings::CS8769


resharper_c_sharp_warnings_cs8769_highlighting

Warning

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


CSharpWarnings::CS8767


resharper_c_sharp_warnings_cs8767_highlighting

Warning

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


CSharpWarnings::CS8765


resharper_c_sharp_warnings_cs8765_highlighting

Warning

Nullable value type may be null.


CSharpWarnings::CS8629


resharper_c_sharp_warnings_cs8629_highlighting

Warning

Object or collection initializer implicitly dereferences possibly null member.


CSharpWarnings::CS8670


resharper_c_sharp_warnings_cs8670_highlighting

Warning

Obsolete members should not be required.


CSharpWarnings::CS9042


resharper_c_sharp_warnings_cs9042_highlighting

Warning

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


CSharpWarnings::CS0660,CS0661


resharper_c_sharp_warnings_cs0660_cs0661_highlighting

Warning

Opt in to preview features before using them.


CSharpWarnings::CA2252


resharper_c_sharp_warnings_ca2252_highlighting

Error

Parameter has no matching param tag in the XML comment


CSharpWarnings::CS1573


resharper_c_sharp_warnings_cs1573_highlighting

Warning

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


CSharpWarnings::CS8762


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.


CSharpWarnings::CS8824


resharper_c_sharp_warnings_cs8824_highlighting

Warning

Parameter must have a non-null value when exiting.


CSharpWarnings::CS8777


resharper_c_sharp_warnings_cs8777_highlighting

Warning

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


CSharpWarnings::CS8947


resharper_c_sharp_warnings_cs8947_highlighting

Warning

Partial method declarations have inconsistent nullability for type parameter.


CSharpWarnings::CS8667


resharper_c_sharp_warnings_cs8667_highlighting

Warning

Possible mistaken empty statement


CSharpWarnings::CS0642


resharper_c_sharp_warnings_cs0642_highlighting

Warning

Possible null reference argument for a parameter.


CSharpWarnings::CS8604


resharper_c_sharp_warnings_cs8604_highlighting

Warning

Possible null reference assignment.


CSharpWarnings::CS8601


resharper_c_sharp_warnings_cs8601_highlighting

Warning

Possible null reference return.


CSharpWarnings::CS8603


resharper_c_sharp_warnings_cs8603_highlighting

Warning

Possible unintended reference comparison


CSharpWarnings::CS0252,CS0253


resharper_c_sharp_warnings_cs0252_cs0253_highlighting

Warning

Record defined 'Equals' but not 'GetHashCode'


CSharpWarnings::CS8851


resharper_c_sharp_warnings_cs8851_highlighting

Warning

Reference to a volatile field will not be treated as volatile


CSharpWarnings::CS0420


resharper_c_sharp_warnings_cs0420_highlighting

Warning

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


CSharpWarnings::CS8825


resharper_c_sharp_warnings_cs8825_highlighting

Warning

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


CSharpWarnings::CS7023


resharper_c_sharp_warnings_cs7023_highlighting

Warning

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


CSharpWarnings::CS9084


resharper_c_sharp_warnings_cs9084_highlighting

Warning

Syntax error in XML comment


CSharpWarnings::CS1584


resharper_c_sharp_warnings_cs1584_highlighting

Warning

Taking address of marshal-by-reference class field


CSharpWarnings::CS0197


resharper_c_sharp_warnings_cs0197_highlighting

Warning

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


CSharpWarnings::CS8632


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.


CSharpWarnings::CS8669


resharper_c_sharp_warnings_cs8669_highlighting

Warning

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


CSharpWarnings::CS9086


resharper_c_sharp_warnings_cs9086_highlighting

Warning

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


CSharpWarnings::CS8965


resharper_c_sharp_warnings_cs8965_highlighting

Warning

The CallerArgumentExpressionAttribute is applied with an invalid parameter name.


CSharpWarnings::CS8963


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


CSharpWarnings::CS8966


resharper_c_sharp_warnings_cs8966_highlighting

Warning

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


CSharpWarnings::CS8961


resharper_c_sharp_warnings_cs8961_highlighting

Warning

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


CSharpWarnings::CS8960


resharper_c_sharp_warnings_cs8960_highlighting

Warning

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


CSharpWarnings::CS8962


resharper_c_sharp_warnings_cs8962_highlighting

Warning

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


CSharpWarnings::CS8424


resharper_c_sharp_warnings_cs8424_highlighting

Warning

The given expression always matches the provided constant.


CSharpWarnings::CS8417


resharper_c_sharp_warnings_cs8417_highlighting

Warning

The given expression never matches the provided pattern.


CSharpWarnings::CS8416


resharper_c_sharp_warnings_cs8416_highlighting

Warning

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


CSharpWarnings::CS0078


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.


CSharpWarnings::CS7022


resharper_c_sharp_warnings_cs7022_highlighting

Warning

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


CSharpWarnings::CS0458


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'


CSharpWarnings::CS0472


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'


CSharpWarnings::CS8073


resharper_c_sharp_warnings_cs8073_highlighting

Warning

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


CSharpWarnings::CS9073


resharper_c_sharp_warnings_cs9073_highlighting

Warning

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


CSharpWarnings::CS9074


resharper_c_sharp_warnings_cs9074_highlighting

Warning

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


CSharpWarnings::CS8509


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.


CSharpWarnings::CS8846


resharper_c_sharp_warnings_cs8846_highlighting

Warning

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


CSharpWarnings::CS8655


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.


CSharpWarnings::CS8847


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.


CSharpWarnings::CS8524


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.


CSharpWarnings::CS8123


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.


CSharpWarnings::CS8383


resharper_c_sharp_warnings_cs8383_highlighting

Warning

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


CSharpWarnings::CS8981


resharper_c_sharp_warnings_cs8981_highlighting

Warning

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


CSharpWarnings::CS9093


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.


CSharpWarnings::CS9097


resharper_c_sharp_warnings_cs9097_highlighting

Warning

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


CSharpWarnings::CS9085


resharper_c_sharp_warnings_cs9085_highlighting

Warning

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


CSharpWarnings::CS9092


resharper_c_sharp_warnings_cs9092_highlighting

Warning

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


CSharpWarnings::CS9087


resharper_c_sharp_warnings_cs9087_highlighting

Warning

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


CSharpWarnings::CS9088


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.


CSharpWarnings::CS9094


resharper_c_sharp_warnings_cs9094_highlighting

Warning

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


CSharpWarnings::CS9089


resharper_c_sharp_warnings_cs9089_highlighting

Warning

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


CSharpWarnings::CS9090


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.


CSharpWarnings::CS9095


resharper_c_sharp_warnings_cs9095_highlighting

Warning

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


CSharpWarnings::CS9091


resharper_c_sharp_warnings_cs9091_highlighting

Warning

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


CSharpWarnings::CS8500


resharper_c_sharp_warnings_cs8500_highlighting

Warning

Thrown value may be null.


CSharpWarnings::CS8597


resharper_c_sharp_warnings_cs8597_highlighting

Warning

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


CSharpWarnings::CS8645


resharper_c_sharp_warnings_cs8645_highlighting

Warning

Type parameter has no matching typeparam tag in the XML comment


CSharpWarnings::CS1712


resharper_c_sharp_warnings_cs1712_highlighting

Warning

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


CSharpWarnings::CS0693


resharper_c_sharp_warnings_cs0693_highlighting

Warning

Types and aliases should not be named 'record'


CSharpWarnings::CS8860


resharper_c_sharp_warnings_cs8860_highlighting

Warning

Unable to include XML fragment


CSharpWarnings::CS1589


resharper_c_sharp_warnings_cs1589_highlighting

Warning

Unassigned field


UnassignedField.Compiler


resharper_unassigned_field_compiler_highlighting

Warning

Unassigned readonly field


UnassignedReadonlyField.Compiler


resharper_unassigned_readonly_field_compiler_highlighting

Warning

Unboxing a possibly null value.


CSharpWarnings::CS8605


resharper_c_sharp_warnings_cs8605_highlighting

Warning

Unused local variable


UnusedVariable.Compiler


resharper_unused_variable_compiler_highlighting

Warning

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


CSharpWarnings::CS9080


resharper_c_sharp_warnings_cs9080_highlighting

Warning

Use of obsolete symbol


CSharpWarnings::CS0618


resharper_c_sharp_warnings_cs0618_highlighting

Warning

Use of obsolete symbol (without message)


CSharpWarnings::CS0612


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


CSharpWarnings::CS1981


resharper_c_sharp_warnings_cs1981_highlighting

Warning

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


CSharpWarnings::CS1572


resharper_c_sharp_warnings_cs1572_highlighting

Warning

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


CSharpWarnings::CS1711


resharper_c_sharp_warnings_cs1711_highlighting

Warning

XML comment has cref attribute that refers to a type parameter


CSharpWarnings::CS1723


resharper_c_sharp_warnings_cs1723_highlighting

Warning

XML comment is not placed on a valid language element


CSharpWarnings::CS1587


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 ReSharper's code annotations, and other similar issues.

Inspection


ID


EditorConfig property

Default severity

Base type is required


RequiredBaseTypesIsNotInherited


resharper_required_base_types_is_not_inherited_highlighting

Warning

BaseTypeRequired attribute supports only classes and interfaces


UnsupportedRequiredBaseType


resharper_unsupported_required_base_type_highlighting

Warning

Compare with '==' types marked by 'CannotApplyEqualityOperatorAttribute'


CannotApplyEqualityOperatorToType


resharper_cannot_apply_equality_operator_to_type_highlighting

Warning

Inconsistent Naming


InconsistentNaming


resharper_inconsistent_naming_highlighting

Warning

Namespace does not correspond to file location


CheckNamespace


resharper_check_namespace_highlighting

Warning

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


NotNullOrRequiredMemberIsNotInitialized


resharper_not_null_or_required_member_is_not_initialized_highlighting

Warning

Possible 'null' assignment to non-nullable entity


AssignNullToNotNullAttribute


resharper_assign_null_to_not_null_attribute_highlighting

Warning

Possible violation of 'ValueRange'/'NonNegativeValue' attribute


ValueRangeAttributeViolation


resharper_value_range_attribute_violation_highlighting

Warning

Problem in contract annotation definition


ContractAnnotationNotParsed


resharper_contract_annotation_not_parsed_highlighting

Warning

Required base type conflicting another type


RequiredBaseTypesConflict


resharper_required_base_types_conflict_highlighting

Warning

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


RequiredBaseTypesDirectConflict


resharper_required_base_types_direct_conflict_highlighting

Warning

Formatting (41 inspections)

Inspections in this category detect code formatting problems.

Inspection


ID


EditorConfig property

Default severity

Incorrect blank lines (blank lines are missing elsewhere)


MissingBlankLines


resharper_missing_blank_lines_highlighting

Disabled

Incorrect blank lines (blank lines are redundant elsewhere)


RedundantBlankLines


resharper_redundant_blank_lines_highlighting

Disabled

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


IncorrectBlankLinesNearBraces


resharper_incorrect_blank_lines_near_braces_highlighting

Disabled

Incorrect indent (around child statement)


BadChildStatementIndent


resharper_bad_child_statement_indent_highlighting

Warning

Incorrect indent (around declaration braces)


BadDeclarationBracesIndent


resharper_bad_declaration_braces_indent_highlighting

Disabled

Incorrect indent (around expression braces)


BadExpressionBracesIndent


resharper_bad_expression_braces_indent_highlighting

Disabled

Incorrect indent (around namespace braces)


BadNamespaceBracesIndent


resharper_bad_namespace_braces_indent_highlighting

Disabled

Incorrect indent (around preprocessor directive)


BadPreprocessorIndent


resharper_bad_preprocessor_indent_highlighting

Disabled

Incorrect indent (around statement braces)


BadControlBracesIndent


resharper_bad_control_braces_indent_highlighting

Suggestion

Incorrect indent (around switch statement)


BadSwitchBracesIndent


resharper_bad_switch_braces_indent_highlighting

Disabled

Incorrect indent (incorrect indent size)


WrongIndentSize


resharper_wrong_indent_size_highlighting

Disabled

Incorrect indent (line indent should be restored to the previous level elsewhere)


OutdentIsOffPrevLevel


resharper_outdent_is_off_prev_level_highlighting

Disabled

Incorrect indent (line indent should not be changed relative to the previous line elsewhere)


BadIndent


resharper_bad_indent_highlighting

Disabled

Incorrect indent (line should be indented or outdented elsewhere)


MissingIndent


resharper_missing_indent_highlighting

Disabled

Incorrect indent (tabs/spaces mismatch)


TabsAndSpacesMismatch


resharper_tabs_and_spaces_mismatch_highlighting

Disabled

Incorrect line breaks (around comma in lists)


BadListLineBreaks


resharper_bad_list_line_breaks_highlighting

Disabled

Incorrect line breaks (around declaration braces)


BadDeclarationBracesLineBreaks


resharper_bad_declaration_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (around empty braces)


BadEmptyBracesLineBreaks


resharper_bad_empty_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (around expression braces)


BadExpressionBracesLineBreaks


resharper_bad_expression_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (around LINQ queries)


BadLinqLineBreaks


resharper_bad_linq_line_breaks_highlighting

Disabled

Incorrect line breaks (around parenthesis)


BadParensLineBreaks


resharper_bad_parens_line_breaks_highlighting

Disabled

Incorrect line breaks (around statement braces)


BadControlBracesLineBreaks


resharper_bad_control_braces_line_breaks_highlighting

Disabled

Incorrect line breaks (line break is missing elsewhere)


MissingLinebreak


resharper_missing_linebreak_highlighting

Disabled

Incorrect line breaks (line break is redundant elsewhere)


RedundantLinebreak


resharper_redundant_linebreak_highlighting

Disabled

Incorrect line breaks (multiple statements on one line)


MultipleStatementsOnOneLine


resharper_multiple_statements_on_one_line_highlighting

Disabled

Incorrect line breaks (multiple type members on one line)


MultipleTypeMembersOnOneLine


resharper_multiple_type_members_on_one_line_highlighting

Disabled

Incorrect spacing (around attributes)


BadAttributeBracketsSpaces


resharper_bad_attribute_brackets_spaces_highlighting

Disabled

Incorrect spacing (around braces)


BadBracesSpaces


resharper_bad_braces_spaces_highlighting

Disabled

Incorrect spacing (around colon)


BadColonSpaces


resharper_bad_colon_spaces_highlighting

Disabled

Incorrect spacing (around comma)


BadCommaSpaces


resharper_bad_comma_spaces_highlighting

Disabled

Incorrect spacing (around generic brackets)


BadGenericBracketsSpaces


resharper_bad_generic_brackets_spaces_highlighting

Disabled

Incorrect spacing (around member access symbols)


BadMemberAccessSpaces


resharper_bad_member_access_spaces_highlighting

Disabled

Incorrect spacing (around operator symbols)


BadSymbolSpaces


resharper_bad_symbol_spaces_highlighting

Disabled

Incorrect spacing (around parenthesis)


BadParensSpaces


resharper_bad_parens_spaces_highlighting

Disabled

Incorrect spacing (around semicolon)


BadSemicolonSpaces


resharper_bad_semicolon_spaces_highlighting

Disabled

Incorrect spacing (around square brackets within a statement)


BadSquareBracketsSpaces


resharper_bad_square_brackets_spaces_highlighting

Disabled

Incorrect spacing (between keyword and parenthesis)


BadSpacesAfterKeyword


resharper_bad_spaces_after_keyword_highlighting

Disabled

Incorrect spacing (multiple spaces are prohibited)


MultipleSpaces


resharper_multiple_spaces_highlighting

Disabled

Incorrect spacing (space is missing elsewhere)


MissingSpace


resharper_missing_space_highlighting

Disabled

Incorrect spacing (space is redundant elsewhere)


RedundantSpace


resharper_redundant_space_highlighting

Disabled

Incorrect spacing (tabs are prohibited here)


TabsOutsideIndent


resharper_tabs_outside_indent_highlighting

Disabled

Language Usage Opportunities (75 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. For most of the supported languages, language version can be detected automatically or set manually.

Inspection


ID


EditorConfig property

Default severity

Class cannot be instantiated


ClassCannotBeInstantiated


resharper_class_cannot_be_instantiated_highlighting

Warning

Conditional expression can be rewritten as null-coalescing


ReplaceConditionalExpressionWithNullCoalescing


resharper_replace_conditional_expression_with_null_coalescing_highlighting

Suggestion

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


UseNegatedPatternMatching


resharper_use_negated_pattern_matching_highlighting

Hint

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


UsePatternMatching


resharper_use_pattern_matching_highlighting

Suggestion

Convert delegate variable into local function


ConvertToLocalFunction


resharper_convert_to_local_function_highlighting

Suggestion

Convert 'if' statement into 'switch'


ConvertIfStatementToSwitchStatement


resharper_convert_if_statement_to_switch_statement_highlighting

Hint

Convert into 'await using' statement or declaration


UseAwaitUsing


resharper_use_await_using_highlighting

Suggestion

Convert into lambda expression


ConvertToLambdaExpression


resharper_convert_to_lambda_expression_highlighting

Suggestion

Convert into static class


ConvertToStaticClass


resharper_convert_to_static_class_highlighting

Suggestion

Convert into 'using' declaration


ConvertToUsingDeclaration


resharper_convert_to_using_declaration_highlighting

Suggestion

Convert lambda expression into method group


ConvertClosureToMethodGroup


resharper_convert_closure_to_method_group_highlighting

Suggestion

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


UseNegatedPatternInIsExpression


resharper_use_negated_pattern_in_is_expression_highlighting

Hint

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


ConvertNullableToShortForm


resharper_convert_nullable_to_short_form_highlighting

Suggestion

Convert property into auto-property


ConvertToAutoProperty


resharper_convert_to_auto_property_highlighting

Suggestion

Convert property into auto-property (when possible)


ConvertToAutoPropertyWhenPossible


resharper_convert_to_auto_property_when_possible_highlighting

Hint

Convert property into auto-property with private setter


ConvertToAutoPropertyWithPrivateSetter


resharper_convert_to_auto_property_with_private_setter_highlighting

Hint

Convert record constructor into primary constructor


ConvertToPrimaryConstructor


resharper_convert_to_primary_constructor_highlighting

Suggestion

Convert static method invocation into extension method call


InvokeAsExtensionMethod


resharper_invoke_as_extension_method_highlighting

Suggestion

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


ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator


resharper_foreach_can_be_converted_to_query_using_another_get_enumerator_highlighting

Hint

For-loop can be converted into foreach-loop


ForCanBeConvertedToForeach


resharper_for_can_be_converted_to_foreach_highlighting

Suggestion

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


ConvertIfStatementToConditionalTernaryExpression


resharper_convert_if_statement_to_conditional_ternary_expression_highlighting

Suggestion

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


ConvertIfStatementToNullCoalescingExpression


resharper_convert_if_statement_to_null_coalescing_expression_highlighting

Suggestion

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


ConvertIfStatementToNullCoalescingAssignment


resharper_convert_if_statement_to_null_coalescing_assignment_highlighting

Suggestion

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


ConvertIfStatementToReturnStatement


resharper_convert_if_statement_to_return_statement_highlighting

Hint

Inline 'out' variable declaration


InlineOutVariableDeclaration


resharper_inline_out_variable_declaration_highlighting

Suggestion

Inline temporary variable


InlineTemporaryVariable


resharper_inline_temporary_variable_highlighting

Hint

Introduce optional parameters (non-private accessibility)


IntroduceOptionalParameters.Global


resharper_introduce_optional_parameters_global_highlighting

Suggestion

Introduce optional parameters (private accessibility)


IntroduceOptionalParameters.Local


resharper_introduce_optional_parameters_local_highlighting

Suggestion

Invert 'if' statement to reduce nesting


InvertIf


resharper_invert_if_highlighting

Hint

Join null check with assignment


JoinNullCheckWithUsage


resharper_join_null_check_with_usage_highlighting

Suggestion

Lambda expression/anonymous method can be made 'static'


LambdaExpressionCanBeMadeStatic


resharper_lambda_expression_can_be_made_static_highlighting

Disabled

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


LambdaExpressionMustBeStatic


resharper_lambda_expression_must_be_static_highlighting

Suggestion

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


LambdaShouldNotCaptureContext


resharper_lambda_should_not_capture_context_highlighting

Warning

Loop can be converted into LINQ-expression


LoopCanBeConvertedToQuery


resharper_loop_can_be_converted_to_query_highlighting

Hint

Merge 'and' pattern


MergeAndPattern


resharper_merge_and_pattern_highlighting

Suggestion

Merge conditional ?: expression into conditional access


MergeConditionalExpression


resharper_merge_conditional_expression_highlighting

Suggestion

Merge negated null/pattern checks into complex pattern


MergeIntoNegatedPattern


resharper_merge_into_negated_pattern_highlighting

Hint

Merge nested property patterns


MergeNestedPropertyPatterns


resharper_merge_nested_property_patterns_highlighting

Suggestion

Merge null/pattern checks into complex pattern


MergeIntoPattern


resharper_merge_into_pattern_highlighting

Suggestion

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


MergeIntoLogicalPattern


resharper_merge_into_logical_pattern_highlighting

Hint

Merge sequential checks into single conditional access check


MergeSequentialChecks


resharper_merge_sequential_checks_highlighting

Hint

Move to existing positional deconstruction pattern


MoveToExistingPositionalDeconstructionPattern


resharper_move_to_existing_positional_deconstruction_pattern_highlighting

Hint

Move variable declaration inside loop condition


MoveVariableDeclarationInsideLoopCondition


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


ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator


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


LoopCanBePartlyConvertedToQuery


resharper_loop_can_be_partly_converted_to_query_highlighting

Disabled

Pass string interpolation expression


PassStringInterpolation


resharper_pass_string_interpolation_highlighting

Hint

Redundant accessor body


RedundantAccessorBody


resharper_redundant_accessor_body_highlighting

Suggestion

Replace auto-property with computed property


ReplaceAutoPropertyWithComputedProperty


resharper_replace_auto_property_with_computed_property_highlighting

Hint

Replace if statement with null-propagating code


UseNullPropagation


resharper_use_null_propagation_highlighting

Hint

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


ReplaceObjectPatternWithVarPattern


resharper_replace_object_pattern_with_var_pattern_highlighting

Suggestion

Replace 'SequenceEqual' with constant pattern


ReplaceSequenceEqualWithConstantPattern


resharper_replace_sequence_equal_with_constant_pattern_highlighting

Suggestion

Replace 'Slice' with range indexer


ReplaceSliceWithRangeIndexer


resharper_replace_slice_with_range_indexer_highlighting

Hint

Replace 'Substring' with range indexer


ReplaceSubstringWithRangeIndexer


resharper_replace_substring_with_range_indexer_highlighting

Hint

Replace 'switch' statement with 'switch' expression


ConvertSwitchStatementToSwitchExpression


resharper_convert_switch_statement_to_switch_expression_highlighting

Hint

Replace ternary expression with 'switch' expression


ConvertConditionalTernaryExpressionToSwitchExpression


resharper_convert_conditional_ternary_expression_to_switch_expression_highlighting

Hint

Replace with 'field' keyword


ReplaceWithFieldKeyword


resharper_replace_with_field_keyword_highlighting

Suggestion

Use compound assignment


ConvertToCompoundAssignment


resharper_convert_to_compound_assignment_highlighting

Hint

Use compound assignment


ConvertToNullCoalescingCompoundAssignment


resharper_convert_to_null_coalescing_compound_assignment_highlighting

Suggestion

Use deconstruction


UseDeconstruction


resharper_use_deconstruction_highlighting

Hint

Use deconstruction to swap variables


SwapViaDeconstruction


resharper_swap_via_deconstruction_highlighting

Suggestion

Use index from end expression


UseIndexFromEndExpression


resharper_use_index_from_end_expression_highlighting

Suggestion

Use 'nameof' expression to reference name


UseNameofExpression


resharper_use_nameof_expression_highlighting

Suggestion

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


UseNameofExpressionForPartOfTheString


resharper_use_nameof_expression_for_part_of_the_string_highlighting

Disabled

Use 'nameof' expression to reference type name


UseNameOfInsteadOfTypeOf


resharper_use_name_of_instead_of_type_of_highlighting

Suggestion

Use 'nameof' expression when registering a DependencyProperty


UseNameofForDependencyProperty


resharper_use_nameof_for_dependency_property_highlighting

Suggestion

Use object or collection initializer when possible


UseObjectOrCollectionInitializer


resharper_use_object_or_collection_initializer_highlighting

Suggestion

Use positional deconstruction pattern


UsePositionalDeconstructionPattern


resharper_use_positional_deconstruction_pattern_highlighting

Disabled

Use string interpolation expression


UseStringInterpolation


resharper_use_string_interpolation_highlighting

Suggestion

Use type annotation syntax


UseNullableReferenceTypesAnnotationSyntax


resharper_use_nullable_reference_types_annotation_syntax_highlighting

Warning

Use unsigned right shift operator '>>>'


UseUnsignedRightShiftOperator


resharper_use_unsigned_right_shift_operator_highlighting

Suggestion

Use UTF-8 string literal


UseUtf8StringLiteral


resharper_use_utf8_string_literal_highlighting

Suggestion

Use 'with' expression to copy anonymous object


UseWithExpressionToCopyAnonymousObject


resharper_use_with_expression_to_copy_anonymous_object_highlighting

Suggestion

Use 'with' expression to copy record


UseWithExpressionToCopyRecord


resharper_use_with_expression_to_copy_record_highlighting

Suggestion

Use 'with' expression to copy struct


UseWithExpressionToCopyStruct


resharper_use_with_expression_to_copy_struct_highlighting

Suggestion

Use 'with' expression to copy tuple


UseWithExpressionToCopyTuple


resharper_use_with_expression_to_copy_tuple_highlighting

Suggestion

NUnit (30 inspections)

These inspections detect code issues related to NUnit tests.

Inspection


ID


EditorConfig property

Default severity

NUnit. Async test method must return Task or Task<T>


NUnit.AsyncMethodMustBeTask


resharper_n_unit_async_method_must_be_task_highlighting

Warning

NUnit. Cannot resolve symbol in TestCaseSource or ValueSource attribute.


NUnit.TestCaseSourceCannotBeResolved


resharper_n_unit_test_case_source_cannot_be_resolved_highlighting

Warning

NUnit. Duplicate values.


NUnit.DuplicateValues


resharper_n_unit_duplicate_values_highlighting

Warning

NUnit. Ignored parameter attribute.


NUnit.IgnoredParameterAttribute


resharper_n_unit_ignored_parameter_attribute_highlighting

Warning

NUnit. Implicitly unspecified null values.


NUnit.ImplicitUnspecifiedNullValues


resharper_n_unit_implicit_unspecified_null_values_highlighting

Warning

NUnit. Incompatible argument type or incorrect argument value.


NUnit.IncorrectArgumentType


resharper_n_unit_incorrect_argument_type_highlighting

Warning

NUnit. Incompatible expected result type or incorrect value.


NUnit.IncorrectExpectedResultType


resharper_n_unit_incorrect_expected_result_type_highlighting

Warning

NUnit. Incorrect range bounds. 'to' must be greater than or equal to 'from'.


NUnit.IncorrectRangeBounds


resharper_n_unit_incorrect_range_bounds_highlighting

Warning

NUnit. Mismatch of the range step sign.


NUnit.RangeStepSignMismatch


resharper_n_unit_range_step_sign_mismatch_highlighting

Warning

NUnit. Missing arguments in TestCase attribute.


NUnit.MissingArgumentsInTestCaseAttribute


resharper_n_unit_missing_arguments_in_test_case_attribute_highlighting

Warning

NUnit. Missing expected result for non-void test method.


NUnit.TestCaseAttributeRequiresExpectedResult


resharper_n_unit_test_case_attribute_requires_expected_result_highlighting

Warning

NUnit. No values provided in the attributes.


NUnit.NoValuesProvided


resharper_n_unit_no_values_provided_highlighting

Warning

NUnit. Non-public test method.


NUnit.NonPublicMethodWithTestAttribute


resharper_n_unit_non_public_method_with_test_attribute_highlighting

Warning

NUnit. Range 'step' parameter value must be non-zero.


NUnit.RangeStepValueMustNotBeZero


resharper_n_unit_range_step_value_must_not_be_zero_highlighting

Warning

NUnit. Redundant argument in TestCase attribute.


NUnit.RedundantArgumentInTestCaseAttribute


resharper_n_unit_redundant_argument_in_test_case_attribute_highlighting

Warning

NUnit. Redundant argument instead of ExpectedResult.


NUnit.RedundantArgumentInsteadOfExpectedResult


resharper_n_unit_redundant_argument_instead_of_expected_result_highlighting

Warning

NUnit. Redundant expected result for void test method.


NUnit.RedundantExpectedResultInTestCaseAttribute


resharper_n_unit_redundant_expected_result_in_test_case_attribute_highlighting

Warning

NUnit. Specified attribute values produce too many tests.


NUnit.AttributeProducesTooManyTests


resharper_n_unit_attribute_produces_too_many_tests_highlighting

Disabled

NUnit. Specified values are not compatible with the test parameter type.


NUnit.ParameterTypeIsNotCompatibleWithAttribute


resharper_n_unit_parameter_type_is_not_compatible_with_attribute_highlighting

Warning

NUnit. Test case Result property duplicates ExpectedResult.


NUnit.TestCaseResultPropertyDuplicatesExpectedResult


resharper_n_unit_test_case_result_property_duplicates_expected_result_highlighting

Warning

NUnit. Test case Result property is obsolete.


NUnit.TestCaseResultPropertyIsObsolete


resharper_n_unit_test_case_result_property_is_obsolete_highlighting

Warning

NUnit. Test case source must be field, property, or method.


NUnit.TestCaseSourceMustBeFieldPropertyMethod


resharper_n_unit_test_case_source_must_be_field_property_method_highlighting

Warning

NUnit. Test case source must be non-abstract and implement IEnumerable.


NUnit.TestCaseSourceShouldImplementIEnumerable


resharper_n_unit_test_case_source_should_implement_i_enumerable_highlighting

Warning

NUnit. Test case source must be static.


NUnit.TestCaseSourceMustBeStatic


resharper_n_unit_test_case_source_must_be_static_highlighting

Warning

NUnit. The maximum range value is not reachable with the step value.


NUnit.RangeToValueIsNotReachable


resharper_n_unit_range_to_value_is_not_reachable_highlighting

Warning

NUnit. Values for test method parameters are not provided.


NUnit.MethodWithParametersAndTestAttribute


resharper_n_unit_method_with_parameters_and_test_attribute_highlighting

Warning

NUnit. Values in range do not fit the type of the test parameter.


NUnit.RangeAttributeBoundsAreOutOfRange


resharper_n_unit_range_attribute_bounds_are_out_of_range_highlighting

Warning

NUnit.AutoFixture. Incompatible argument type or incorrect argument value.


NUnit.AutoFixture.IncorrectArgumentType


resharper_n_unit_auto_fixture_incorrect_argument_type_highlighting

Warning

NUnit.AutoFixture. Missing Test or TestFixture attribute.


NUnit.AutoFixture.MissedTestOrTestFixtureAttribute


resharper_n_unit_auto_fixture_missed_test_or_test_fixture_attribute_highlighting

Warning

NUnit.AutoFixture. Redundant argument in InlineAutoData attribute.


NUnit.AutoFixture.RedundantArgumentInInlineAutoDataAttribute


resharper_n_unit_auto_fixture_redundant_argument_in_inline_auto_data_attribute_highlighting

Warning

Potential Code Quality Issues (175 inspections)

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

Inspection


ID


EditorConfig property

Default severity

'?:' expression has identical true and false branches


ConditionalTernaryEqualBranch


resharper_conditional_ternary_equal_branch_highlighting

Warning

[ThreadStatic] does not work with instance fields


ThreadStaticAtInstanceField


resharper_thread_static_at_instance_field_highlighting

Warning

A suppressed nullable warning might hide an underlying problem


NullableWarningSuppressionIsUsed


resharper_nullable_warning_suppression_is_used_highlighting

Disabled

Abstract or virtual (overridable) event is never invoked


EventNeverInvoked.Global


resharper_event_never_invoked_global_highlighting

Suggestion

Access to disposed captured variable


AccessToDisposedClosure


resharper_access_to_disposed_closure_highlighting

Warning

Access to foreach variable in closure


AccessToForEachVariableInClosure


resharper_access_to_for_each_variable_in_closure_highlighting

Warning

Access to modified captured variable


AccessToModifiedClosure


resharper_access_to_modified_closure_highlighting

Warning

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


NonConstantEqualityExpressionHasConstantResult


resharper_non_constant_equality_expression_has_constant_result_highlighting

Warning

Actual shift count equals zero


ShiftExpressionRealShiftCountIsZero


resharper_shift_expression_real_shift_count_is_zero_highlighting

Warning

Ambiguous symbols in text argument


MultipleResolveCandidatesInText


resharper_multiple_resolve_candidates_in_text_highlighting

Warning

Annotation conflict in hierarchy


AnnotationConflictInHierarchy


resharper_annotation_conflict_in_hierarchy_highlighting

Warning

Assignment in conditional expression


AssignmentInConditionalExpression


resharper_assignment_in_conditional_expression_highlighting

Warning

Async iterator invocation without 'await foreach'


AsyncIteratorInvocationWithoutAwaitForeach


resharper_async_iterator_invocation_without_await_foreach_highlighting

Warning

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


UnusedAutoPropertyAccessor.Global


resharper_unused_auto_property_accessor_global_highlighting

Warning

Auto-property accessor is never used (private accessibility)


UnusedAutoPropertyAccessor.Local


resharper_unused_auto_property_accessor_local_highlighting

Warning

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


AsyncVoidLambda


resharper_async_void_lambda_highlighting

Warning

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


AsyncVoidMethod


resharper_async_void_method_highlighting

Disabled

Backing field is assigned but never used


PropertyFieldKeywordIsNeverUsed


resharper_property_field_keyword_is_never_used_highlighting

Warning

Backing field is used but never assigned


PropertyFieldKeywordIsNeverAssigned


resharper_property_field_keyword_is_never_assigned_highlighting

Warning

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


BitwiseOperatorOnEnumWithoutFlags


resharper_bitwise_operator_on_enum_without_flags_highlighting

Warning

Call to base member with implicit default parameters


BaseMethodCallWithDefaultParameter


resharper_base_method_call_with_default_parameter_highlighting

Warning

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


BaseObjectEqualsIsObjectEquals


resharper_base_object_equals_is_object_equals_highlighting

Warning

Cannot access static symbol in text argument


StaticProblemInText


resharper_static_problem_in_text_highlighting

Warning

Cannot access symbol in text argument


AccessRightsInText


resharper_access_rights_in_text_highlighting

Warning

Cannot resolve property


PropertyNotResolved


resharper_property_not_resolved_highlighting

Error

Cannot resolve resource


ResourceNotResolved


resharper_resource_not_resolved_highlighting

Error

Cannot resolve resource item


ResourceItemNotResolved


resharper_resource_item_not_resolved_highlighting

Error

Cannot resolve symbol in text argument


NotResolvedInText


resharper_not_resolved_in_text_highlighting

Warning

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


AddressOfMarshalByRefObject


resharper_address_of_marshal_by_ref_object_highlighting

Warning

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


ByRefArgumentIsVolatileField


resharper_by_ref_argument_is_volatile_field_highlighting

Warning

Char is possibly unintentionally used as integer


ConfusingCharAsIntegerInConstructor


resharper_confusing_char_as_integer_in_constructor_highlighting

Warning

Class is never instantiated (non-private accessibility)


ClassNeverInstantiated.Global


resharper_class_never_instantiated_global_highlighting

Suggestion

Class is never instantiated (private accessibility)


ClassNeverInstantiated.Local


resharper_class_never_instantiated_local_highlighting

Suggestion

Collection content is never queried (non-private accessibility)


CollectionNeverQueried.Global


resharper_collection_never_queried_global_highlighting

Warning

Collection content is never queried (private accessibility)


CollectionNeverQueried.Local


resharper_collection_never_queried_local_highlighting

Warning

Collection is never updated (non-private accessibility)


CollectionNeverUpdated.Global


resharper_collection_never_updated_global_highlighting

Warning

Collection is never updated (private accessibility)


CollectionNeverUpdated.Local


resharper_collection_never_updated_local_highlighting

Warning

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


ShiftExpressionResultEqualsZero


resharper_shift_expression_result_equals_zero_highlighting

Warning

Co-variant array conversion


CoVariantArrayConversion


resharper_co_variant_array_conversion_highlighting

Warning

Division by zero in at least one execution path


IntDivisionByZero


resharper_int_division_by_zero_highlighting

Warning

Do not store SpinLock in readonly field


SpinLockInReadonlyField


resharper_spin_lock_in_readonly_field_highlighting

Warning

Element is localizable


LocalizableElement


resharper_localizable_element_highlighting

Warning

Empty general catch clause


EmptyGeneralCatchClause


resharper_empty_general_catch_clause_highlighting

Warning

Empty 'with' expression is redundant


RedundantWithExpression


resharper_redundant_with_expression_highlighting

Suggestion

'Enumerable.Sum' invocation in explicit unchecked context


EnumerableSumInExplicitUncheckedContext


resharper_enumerable_sum_in_explicit_unchecked_context_highlighting

Warning

Equality comparison of floating point numbers


CompareOfFloatsByEqualityOperator


resharper_compare_of_floats_by_equality_operator_highlighting

Warning

Event is never subscribed to (non-private accessibility)


EventNeverSubscribedTo.Global


resharper_event_never_subscribed_to_global_highlighting

Suggestion

Event is never subscribed to (private accessibility)


EventNeverSubscribedTo.Local


resharper_event_never_subscribed_to_local_highlighting

Suggestion

Event never invoked


EventNeverInvoked


resharper_event_never_invoked_highlighting

Warning

Event unsubscription via anonymous delegate


EventUnsubscriptionViaAnonymousDelegate


resharper_event_unsubscription_via_anonymous_delegate_highlighting

Warning

Exception rethrow possibly intended


PossibleIntendedRethrow


resharper_possible_intended_rethrow_highlighting

Warning

Explicit argument passed to parameter with caller info attribute


ExplicitCallerInfoArgument


resharper_explicit_caller_info_argument_highlighting

Warning

Field hides property with default implementation in interface


FieldHidesInterfacePropertyWithDefaultImplementation


resharper_field_hides_interface_property_with_default_implementation_highlighting

Warning

Formatting is specified, but interpolated string expression is not IFormattable


InterpolatedStringExpressionIsNotIFormattable


resharper_interpolated_string_expression_is_not_i_formattable_highlighting

Warning

Function body is too complex to analyze


FunctionComplexityOverflow


resharper_function_complexity_overflow_highlighting

Disabled

Function is recursive on all execution paths


FunctionRecursiveOnAllPaths


resharper_function_recursive_on_all_paths_highlighting

Warning

Function never returns


FunctionNeverReturns


resharper_function_never_returns_highlighting

Warning

'GC.SuppressFinalize' is invoked for type without destructor


GCSuppressFinalizeForTypeWithoutDestructor


resharper_gc_suppress_finalize_for_type_without_destructor_highlighting

Warning

Heuristically unreachable case according to integer analysis


UnreachableSwitchCaseDueToIntegerAnalysis


resharper_unreachable_switch_case_due_to_integer_analysis_highlighting

Warning

Heuristically unreachable switch arm according to integer analysis


UnreachableSwitchArmDueToIntegerAnalysis


resharper_unreachable_switch_arm_due_to_integer_analysis_highlighting

Warning

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


MathClampMinGreaterThanMax


resharper_math_clamp_min_greater_than_max_highlighting

Warning

Inconsistent order of taken locks


InconsistentOrderOfLocks


resharper_inconsistent_order_of_locks_highlighting

Warning

Inconsistent synchronization on field


InconsistentlySynchronizedField


resharper_inconsistently_synchronized_field_highlighting

Warning

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


ZeroIndexFromEnd


resharper_zero_index_from_end_highlighting

Warning

Instance of IEnumerator is never disposed


GenericEnumeratorNotDisposed


resharper_generic_enumerator_not_disposed_highlighting

Warning

Interfaces marked as ServiceContract should declare at least one OperationContract


ServiceContractWithoutOperations


resharper_service_contract_without_operations_highlighting

Warning

Invalid XML documentation comment


InvalidXmlDocComment


resharper_invalid_xml_doc_comment_highlighting

Warning

Invocation of polymorphic field-like event


PolymorphicFieldLikeEventInvocation


resharper_polymorphic_field_like_event_invocation_highlighting

Warning

IQueryable is possibly unintentionally used as IEnumerable


PossibleUnintendedQueryableAsEnumerable


resharper_possible_unintended_queryable_as_enumerable_highlighting

Suggestion

Iterator never returns


IteratorNeverReturns


resharper_iterator_never_returns_highlighting

Warning

Local function hides method


LocalFunctionHidesMethod


resharper_local_function_hides_method_highlighting

Warning

Local variable hides member


LocalVariableHidesMember


resharper_local_variable_hides_member_highlighting

Warning

Loop control variable is never changed inside loop


LoopVariableIsNeverChangedInsideLoop


resharper_loop_variable_is_never_changed_inside_loop_highlighting

Warning

Member hides static member from outer class


MemberHidesStaticFromOuterClass


resharper_member_hides_static_from_outer_class_highlighting

Warning

Member initialized value ignored


MemberInitializerValueIgnored


resharper_member_initializer_value_ignored_highlighting

Warning

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


OperationContractWithoutServiceContract


resharper_operation_contract_without_service_contract_highlighting

Warning

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


MethodOverloadWithOptionalParameter


resharper_method_overload_with_optional_parameter_highlighting

Warning

Mismatch of optional parameter value in overridden method


OptionalParameterHierarchyMismatch


resharper_optional_parameter_hierarchy_mismatch_highlighting

Warning

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


UseConfigureAwaitFalseForAsyncDisposable


resharper_use_configure_await_false_for_async_disposable_highlighting

Disabled

Missing '.ConfigureAwait(false)' in library code


UseConfigureAwaitFalse


resharper_use_configure_await_false_highlighting

Suggestion

Multiple sequential 'OrderBy' invocation


MultipleOrderBy


resharper_multiple_order_by_highlighting

Warning

Non-accessed field (non-private accessibility)


NotAccessedField.Global


resharper_not_accessed_field_global_highlighting

Suggestion

Non-accessed field (private accessibility)


NotAccessedField.Local


resharper_not_accessed_field_local_highlighting

Warning

Non-accessed positional property (non-private accessibility)


NotAccessedPositionalProperty.Global


resharper_not_accessed_positional_property_global_highlighting

Warning

Non-accessed positional property (private accessibility)


NotAccessedPositionalProperty.Local


resharper_not_accessed_positional_property_local_highlighting

Warning

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


MemberHidesInterfaceMemberWithDefaultImplementation


resharper_member_hides_interface_member_with_default_implementation_highlighting

Warning

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


NonReadonlyMemberInGetHashCode


resharper_non_readonly_member_in_get_hash_code_highlighting

Warning

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


SuppressNullableWarningExpressionAsInvertedIsExpression


resharper_suppress_nullable_warning_expression_as_inverted_is_expression_highlighting

Warning

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


ReferenceEqualsWithValueType


resharper_reference_equals_with_value_type_highlighting

Warning

One way operations must not return values


OneWayOperationContractWithReturnType


resharper_one_way_operation_contract_with_return_type_highlighting

Warning

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


OperatorIsCanBeUsed


resharper_operator_is_can_be_used_highlighting

Warning

Operator without matching checked operator


OperatorWithoutMatchedCheckedOperator


resharper_operator_without_matched_checked_operator_highlighting

Warning

Overridden GetHashCode calls base 'Object.GetHashCode()'


BaseObjectGetHashCodeCallInGetHashCode


resharper_base_object_get_hash_code_call_in_get_hash_code_highlighting

Warning

Parameter hides member


ParameterHidesMember


resharper_parameter_hides_member_highlighting

Warning

Parameter name differs in partial method declaration


PartialMethodParameterNameMismatch


resharper_partial_method_parameter_name_mismatch_highlighting

Warning

Possible ambiguity while accessing member by interface


PossibleInterfaceMemberAmbiguity


resharper_possible_interface_member_ambiguity_highlighting

Warning

Possible comparison of value type with 'null'


CompareNonConstrainedGenericWithNull


resharper_compare_non_constrained_generic_with_null_highlighting

Disabled

Possible cyclic constructor call


ConstructorInitializerLoop


resharper_constructor_initializer_loop_highlighting

Warning

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


PossibleMultipleWriteAccessInDoubleCheckLocking


resharper_possible_multiple_write_access_in_double_check_locking_highlighting

Warning

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


ReadAccessInDoubleCheckLocking


resharper_read_access_in_double_check_locking_highlighting

Warning

Possible infinite inheritance


PossibleInfiniteInheritance


resharper_possible_infinite_inheritance_highlighting

Warning

Possible loss of fraction


PossibleLossOfFraction


resharper_possible_loss_of_fraction_highlighting

Warning

Possible multiple enumeration


PossibleMultipleEnumeration


resharper_possible_multiple_enumeration_highlighting

Warning

Possible overflow


IntVariableOverflow


resharper_int_variable_overflow_highlighting

Warning

Possible overflow in checked context


IntVariableOverflowInCheckedContext


resharper_int_variable_overflow_in_checked_context_highlighting

Warning

Possible overflow in unchecked context


IntVariableOverflowInUncheckedContext


resharper_int_variable_overflow_in_unchecked_context_highlighting

Warning

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


NegativeIndex


resharper_negative_index_highlighting

Warning

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


IndexingByInvalidRange


resharper_indexing_by_invalid_range_highlighting

Warning

Possible 'System.InvalidCastException'


PossibleInvalidCastException


resharper_possible_invalid_cast_exception_highlighting

Warning

Possible 'System.InvalidCastException' in foreach loop


PossibleInvalidCastExceptionInForeachLoop


resharper_possible_invalid_cast_exception_in_foreach_loop_highlighting

Warning

Possible 'System.InvalidOperationException'


PossibleInvalidOperationException


resharper_possible_invalid_operation_exception_highlighting

Warning

Possible 'System.NullReferenceException'


PossibleNullReferenceException


resharper_possible_null_reference_exception_highlighting

Warning

Possible unassigned object created by 'new' expression


ObjectCreationAsStatement


resharper_object_creation_as_statement_highlighting

Warning

Possible unintended reference comparison


PossibleUnintendedReferenceComparison


resharper_possible_unintended_reference_comparison_highlighting

Warning

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


PossiblyImpureMethodCallOnReadonlyVariable


resharper_possibly_impure_method_call_on_readonly_variable_highlighting

Warning

Possibly misleading 'DefaultValueAttribute' usage to define optional parameter value


DefaultValueAttributeForOptionalParameter


resharper_default_value_attribute_for_optional_parameter_highlighting

Warning

Possibly missing comma before indexer initializer


PossiblyMissingIndexerInitializerComma


resharper_possibly_missing_indexer_initializer_comma_highlighting

Warning

Possibly unintended linear search in set


PossibleUnintendedLinearSearchInSet


resharper_possible_unintended_linear_search_in_set_highlighting

Warning

Possibly unintended string interpolation instead of format string template


PossiblyMistakenUseOfInterpolatedStringInsert


resharper_possibly_mistaken_use_of_interpolated_string_insert_highlighting

Warning

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


OptionalParameterRefOut


resharper_optional_parameter_ref_out_highlighting

Warning

Return type of a function can be non-nullable


ReturnTypeCanBeNotNullable


resharper_return_type_can_be_not_nullable_highlighting

Warning

Return value of [MustUseReturnValue] annotated method is not used


MustUseReturnValue


resharper_must_use_return_value_highlighting

Warning

Return value of iterator is not used


IteratorMethodResultIsIgnored


resharper_iterator_method_result_is_ignored_highlighting

Warning

Return value of pure method is not used


ReturnValueOfPureMethodIsNotUsed


resharper_return_value_of_pure_method_is_not_used_highlighting

Warning

Safe cast expression always succeeds


TryCastAlwaysSucceeds


resharper_try_cast_always_succeeds_highlighting

Suggestion

Shift expression with zero left operand equals zero


ShiftExpressionZeroLeftOperand


resharper_shift_expression_zero_left_operand_highlighting

Warning

Similar anonymous type detected nearby


SimilarAnonymousTypeNearby


resharper_similar_anonymous_type_nearby_highlighting

Hint

Similar expressions comparison


EqualExpressionComparison


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


SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault


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


SwitchStatementMissingSomeEnumCasesNoDefault


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


SwitchStatementHandlesSomeKnownEnumValuesWithDefault


resharper_switch_statement_handles_some_known_enum_values_with_default_highlighting

Hint

Static field or auto-property in generic type


StaticMemberInGenericType


resharper_static_member_in_generic_type_highlighting

Warning

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


StaticMemberInitializerReferesToMemberBelow


resharper_static_member_initializer_referes_to_member_below_highlighting

Warning

String formatting method problems


FormatStringProblem


resharper_format_string_problem_highlighting

Warning

Structured message template problems


StructuredMessageTemplateProblem


resharper_structured_message_template_problem_highlighting

Warning

Suspicious locking over synchronization primitive


SuspiciousLockOverSynchronizationPrimitive


resharper_suspicious_lock_over_synchronization_primitive_highlighting

Warning

Suspicious parameter name in ArgumentNullException


SuspiciousParameterNameInArgumentNullException


resharper_suspicious_parameter_name_in_argument_null_exception_highlighting

Warning

Suspicious shift count for this type of left operand


ShiftExpressionRightOperandNotEqualRealCount


resharper_shift_expression_right_operand_not_equal_real_count_highlighting

Warning

Suspicious type conversion or check


SuspiciousTypeConversion.Global


resharper_suspicious_type_conversion_global_highlighting

Warning

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


NonAtomicCompoundOperator


resharper_non_atomic_compound_operator_highlighting

Warning

Symbol from module that might be missing at runtime


SymbolFromNotCopiedLocallyReferenceUsedWarning


resharper_symbol_from_not_copied_locally_reference_used_warning_highlighting

Warning

Tail recursive call can be replaced with loop


TailRecursiveCall


resharper_tail_recursive_call_highlighting

Hint

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


IsExpressionAlwaysFalse


resharper_is_expression_always_false_highlighting

Warning

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


IsExpressionAlwaysTrue


resharper_is_expression_always_true_highlighting

Warning

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


PatternIsRedundant


resharper_pattern_is_redundant_highlighting

Warning

The source expression always matches the provided pattern


PatternAlwaysMatches


resharper_pattern_always_matches_highlighting

Warning

The source expression never matches the provided pattern


PatternNeverMatches


resharper_pattern_never_matches_highlighting

Warning

Thread static field has initializer


ThreadStaticFieldHasInitializer


resharper_thread_static_field_has_initializer_highlighting

Warning

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


SafeCastIsUsedAsTypeCheck


resharper_safe_cast_is_used_as_type_check_highlighting

Suggestion

Type check and casts can be merged


MergeCastWithTypeCheck


resharper_merge_cast_with_type_check_highlighting

Suggestion

Type pattern and casts can be merged


UseSwitchCasePatternVariable


resharper_use_switch_case_pattern_variable_highlighting

Suggestion

Unassigned field (non-private accessibility)


UnassignedField.Global


resharper_unassigned_field_global_highlighting

Suggestion

Unassigned field (private accessibility)


UnassignedField.Local


resharper_unassigned_field_local_highlighting

Warning

Unassigned readonly field


UnassignedReadonlyField


resharper_unassigned_readonly_field_highlighting

Warning

Unknown Razor layout


Razor.LayoutNotResolved


resharper_razor_layout_not_resolved_highlighting

Error

Unknown Razor section


Razor.SectionNotResolved


resharper_razor_section_not_resolved_highlighting

Error

Usage of <inheritdoc /> is invalid


InheritdocInvalidUsage


resharper_inheritdoc_invalid_usage_highlighting

Warning

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


InheritdocConsiderUsage


resharper_inheritdoc_consider_usage_highlighting

Disabled

Use collection's count property


UseCollectionCountProperty


resharper_use_collection_count_property_highlighting

Suggestion

Use format specifier in format strings


UseFormatSpecifierInFormatString


resharper_use_format_specifier_in_format_string_highlighting

Suggestion

Use format specifier in interpolated strings


SimplifyStringInterpolation


resharper_simplify_string_interpolation_highlighting

Suggestion

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


ConvertTypeCheckToNullCheck


resharper_convert_type_check_to_null_check_highlighting

Warning

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


ConvertTypeCheckPatternToNullCheck


resharper_convert_type_check_pattern_to_null_check_highlighting

Warning

Use nullable annotation instead of an attribute


UseNullableAnnotationInsteadOfAttribute


resharper_use_nullable_annotation_instead_of_attribute_highlighting

Suggestion

Useless arithmetical operation


UselessBinaryOperation


resharper_useless_binary_operation_highlighting

Warning

Using stackalloc inside loop


StackAllocInsideLoop


resharper_stack_alloc_inside_loop_highlighting

Warning

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


PossibleStructMemberModificationOfNonVariableStruct


resharper_possible_struct_member_modification_of_non_variable_struct_highlighting

Warning

'value' parameter is not used


ValueParameterNotUsed


resharper_value_parameter_not_used_highlighting

Warning

Variable can be declared as non-nullable


VariableCanBeNotNullable


resharper_variable_can_be_not_nullable_highlighting

Warning

Variable in local function hides variable from outer scope


VariableHidesOuterVariable


resharper_variable_hides_outer_variable_highlighting

Warning

Virtual member call in constructor


VirtualMemberCallInConstructor


resharper_virtual_member_call_in_constructor_highlighting

Warning

'void' method is annotated by [MustUseReturnValue] attribute


VoidMethodWithMustUseReturnValueAttribute


resharper_void_method_with_must_use_return_value_attribute_highlighting

Warning

'void' method is annotated by [Pure] attribute


PureAttributeOnVoidMethod


resharper_pure_attribute_on_void_method_highlighting

Warning

'with' expression is used instead of object initializer


WithExpressionInsteadOfInitializer


resharper_with_expression_instead_of_initializer_highlighting

Suggestion

'with' expression modifies all accessible instance members


WithExpressionModifiesAllMembers


resharper_with_expression_modifies_all_members_highlighting

Warning

Redundancies in Code (93 inspections)

Code inspections in this category look for redundancies and dead code, which affect code readability and style, and could be safely removed. Some code redundancies cannot be fixed automatically, and quick-fixes for them are performed in the interactive mode, requiring the user input. But the majority of the redundancies can be fixed without user interaction, using either fix in scope or code cleanup.

Inspection


ID


EditorConfig property

Default severity

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


ConstantNullCoalescingCondition


resharper_constant_null_coalescing_condition_highlighting

Warning

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


NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract


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


RedundantNullnessAttributeWithNullableReferenceTypes


resharper_redundant_nullness_attribute_with_nullable_reference_types_highlighting

Warning

Anonymous method signature is not necessary


UnusedAnonymousMethodSignature


resharper_unused_anonymous_method_signature_highlighting

Warning

Array creation can be replaced with array initializer


RedundantArrayCreationExpression


resharper_redundant_array_creation_expression_highlighting

Hint

Assignment is not used


RedundantAssignment


resharper_redundant_assignment_highlighting

Warning

Assignment results are fully discarded


AssignmentIsFullyDiscarded


resharper_assignment_is_fully_discarded_highlighting

Warning

Comparison to integral constant is useless


UselessComparisonToIntegralConstant


resharper_useless_comparison_to_integral_constant_highlighting

Warning

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


ConstantConditionalAccessQualifier


resharper_constant_conditional_access_qualifier_highlighting

Warning

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


ConditionalAccessQualifierIsNonNullableAccordingToAPIContract


resharper_conditional_access_qualifier_is_non_nullable_according_to_api_contract_highlighting

Warning

Double negation operator


DoubleNegationOperator


resharper_double_negation_operator_highlighting

Suggestion

Empty 'for' loop is redundant


EmptyForStatement


resharper_empty_for_statement_highlighting

Warning

Empty region


EmptyRegion


resharper_empty_region_highlighting

Suggestion

Explicit delegate creation expression is redundant


RedundantDelegateCreation


resharper_redundant_delegate_creation_highlighting

Warning

Expression is always 'null'


ExpressionIsAlwaysNull


resharper_expression_is_always_null_highlighting

Warning

Expression is always 'true' or always 'false'


ConditionIsAlwaysTrueOrFalse


resharper_condition_is_always_true_or_false_highlighting

Warning

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


ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract


resharper_condition_is_always_true_or_false_according_to_nullable_api_contract_highlighting

Warning

Heuristically unreachable code


HeuristicUnreachableCode


resharper_heuristic_unreachable_code_highlighting

Warning

Immediate delegate invocation


RedundantImmediateDelegateInvocation


resharper_redundant_immediate_delegate_invocation_highlighting

Suggestion

Math.Abs() argument is always non-negative


MathAbsMethodIsRedundant


resharper_math_abs_method_is_redundant_highlighting

Warning

Math.Sign() method always gives the same result


SuspiciousMathSignMethod


resharper_suspicious_math_sign_method_highlighting

Warning

Parentheses are redundant if attribute has no arguments


RedundantAttributeParentheses


resharper_redundant_attribute_parentheses_highlighting

Hint

Pattern is always 'true' or always 'false'


PatternIsAlwaysTrueOrFalse


resharper_pattern_is_always_true_or_false_highlighting

Warning

Private field can be converted into local variable


PrivateFieldCanBeConvertedToLocalVariable


resharper_private_field_can_be_converted_to_local_variable_highlighting

Warning

Redundant [AttributeUsage] attribute property assignment


RedundantAttributeUsageProperty


resharper_redundant_attribute_usage_property_highlighting

Suggestion

Redundant 'abstract' modifier


RedundantAbstractModifier


resharper_redundant_abstract_modifier_highlighting

Warning

Redundant anonymous type property explicit name


RedundantAnonymousTypePropertyName


resharper_redundant_anonymous_type_property_name_highlighting

Warning

Redundant argument passed to caller argument expression parameter


RedundantCallerArgumentExpressionDefaultValue


resharper_redundant_caller_argument_expression_default_value_highlighting

Warning

Redundant argument with default value


RedundantArgumentDefaultValue


resharper_redundant_argument_default_value_highlighting

Warning

Redundant arithmetic overflow checking context


RedundantOverflowCheckingContext


resharper_redundant_overflow_checking_context_highlighting

Warning

Redundant 'Attribute' suffix


RedundantAttributeSuffix


resharper_redundant_attribute_suffix_highlighting

Warning

Redundant 'base.' qualifier


RedundantBaseQualifier


resharper_redundant_base_qualifier_highlighting

Warning

Redundant boolean comparison


RedundantBoolCompare


resharper_redundant_bool_compare_highlighting

Warning

Redundant braces in collection initializer


RedundantCollectionInitializerElementBraces


resharper_redundant_collection_initializer_element_braces_highlighting

Hint

Redundant 'case' label


RedundantCaseLabel


resharper_redundant_case_label_highlighting

Warning

Redundant 'case' label before default section


RedundantEnumCaseLabelForDefaultSection


resharper_redundant_enum_case_label_for_default_section_highlighting

Disabled

Redundant cast


RedundantCast


resharper_redundant_cast_highlighting

Warning

Redundant catch clause


RedundantCatchClause


resharper_redundant_catch_clause_highlighting

Warning

Redundant 'class' keyword in record declaration


RedundantRecordClassKeyword


resharper_redundant_record_class_keyword_highlighting

Warning

Redundant condition check before assignments


RedundantCheckBeforeAssignment


resharper_redundant_check_before_assignment_highlighting

Warning

Redundant conditional ternary expression usage


RedundantTernaryExpression


resharper_redundant_ternary_expression_highlighting

Warning

Redundant 'ConfigureAwait(true)'


RedundantConfigureAwait


resharper_redundant_configure_await_highlighting

Suggestion

Redundant control flow jump statement


RedundantJumpStatement


resharper_redundant_jump_statement_highlighting

Warning

Redundant dictionary 'ContainsKey' before adding to the collection


RedundantDictionaryContainsKeyBeforeAdding


resharper_redundant_dictionary_contains_key_before_adding_highlighting

Warning

Redundant discard designation


RedundantDiscardDesignation


resharper_redundant_discard_designation_highlighting

Suggestion

Redundant 'else' keyword


RedundantIfElseBlock


resharper_redundant_if_else_block_highlighting

Hint

Redundant empty argument list on object creation expression


RedundantEmptyObjectCreationArgumentList


resharper_redundant_empty_object_creation_argument_list_highlighting

Hint

Redundant empty finally block


RedundantEmptyFinallyBlock


resharper_redundant_empty_finally_block_highlighting

Warning

Redundant empty object or collection initializer


RedundantEmptyObjectOrCollectionInitializer


resharper_redundant_empty_object_or_collection_initializer_highlighting

Warning

Redundant empty switch section


RedundantEmptySwitchSection


resharper_redundant_empty_switch_section_highlighting

Warning

Redundant explicit array creation in argument of 'params' parameter


RedundantExplicitParamsArrayCreation


resharper_redundant_explicit_params_array_creation_highlighting

Suggestion

Redundant explicit nullable type creation


RedundantExplicitNullableCreation


resharper_redundant_explicit_nullable_creation_highlighting

Warning

Redundant explicit positional property declaration


RedundantExplicitPositionalPropertyDeclaration


resharper_redundant_explicit_positional_property_declaration_highlighting

Warning

Redundant explicit size specification in array creation


RedundantExplicitArraySize


resharper_redundant_explicit_array_size_highlighting

Warning

Redundant explicit tuple component name


RedundantExplicitTupleComponentName


resharper_redundant_explicit_tuple_component_name_highlighting

Warning

Redundant explicit type in array creation


RedundantExplicitArrayCreation


resharper_redundant_explicit_array_creation_highlighting

Warning

Redundant fixed pointer declaration


RedundantFixedPointerDeclaration


resharper_redundant_fixed_pointer_declaration_highlighting

Suggestion

Redundant global using directive


RedundantUsingDirective.Global


resharper_redundant_using_directive_global_highlighting

Warning

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


RedundantEnumerableCastCall


resharper_redundant_enumerable_cast_call_highlighting

Warning

Redundant lambda expression parameter type specification


RedundantLambdaParameterType


resharper_redundant_lambda_parameter_type_highlighting

Warning

Redundant lambda signature parentheses


RedundantLambdaSignatureParentheses


resharper_redundant_lambda_signature_parentheses_highlighting

Hint

Redundant name qualifier


RedundantNameQualifier


resharper_redundant_name_qualifier_highlighting

Warning

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


RedundantNotNullConstraint


resharper_redundant_not_null_constraint_highlighting

Warning

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


RedundantNullableAnnotationOnTypeConstraintHasNonNullableBaseType


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


RedundantNullableAnnotationOnTypeConstraintHasNonNullableTypeKind


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


RedundantNullableAnnotationOnReferenceTypeConstraint


resharper_redundant_nullable_annotation_on_reference_type_constraint_highlighting

Warning

Redundant nullable attribute


RedundantNullableFlowAttribute


resharper_redundant_nullable_flow_attribute_highlighting

Warning

Redundant nullable warning suppression expression


RedundantSuppressNullableWarningExpression


resharper_redundant_suppress_nullable_warning_expression_highlighting

Warning

Redundant 'object.ToString()' call


RedundantToStringCall


resharper_redundant_to_string_call_highlighting

Warning

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


RedundantToStringCallForValueType


resharper_redundant_to_string_call_for_value_type_highlighting

Hint

Redundant operand in logical conditional expression


RedundantLogicalConditionalExpressionOperand


resharper_redundant_logical_conditional_expression_operand_highlighting

Warning

Redundant 'orderby' clause 'ascending' keyword


RedundantQueryOrderByAscendingKeyword


resharper_redundant_query_order_by_ascending_keyword_highlighting

Hint

Redundant property pattern clause


RedundantPropertyPatternClause


resharper_redundant_property_pattern_clause_highlighting

Suggestion

Redundant range bound


RedundantRangeBound


resharper_redundant_range_bound_highlighting

Suggestion

Redundant 'readonly' modifier


RedundantReadonlyModifier


resharper_redundant_readonly_modifier_highlighting

Suggestion

Redundant 'record' type declaration body


RedundantRecordBody


resharper_redundant_record_body_highlighting

Warning

Redundant 'scoped' parameter modifier


RedundantScopedParameterModifier


resharper_redundant_scoped_parameter_modifier_highlighting

Warning

Redundant semicolon after type or namespace declaration


RedundantDeclarationSemicolon


resharper_redundant_declaration_semicolon_highlighting

Hint

Redundant set 'Contains' before 'Add'


RedundantSetContainsBeforeAdding


resharper_redundant_set_contains_before_adding_highlighting

Warning

Redundant string interpolation


RedundantStringInterpolation


resharper_redundant_string_interpolation_highlighting

Suggestion

Redundant 'string.Format()' call


RedundantStringFormatCall


resharper_redundant_string_format_call_highlighting

Warning

Redundant 'string.ToCharArray()' call


RedundantStringToCharArrayCall


resharper_redundant_string_to_char_array_call_highlighting

Warning

Redundant type arguments of method


RedundantTypeArgumentsOfMethod


resharper_redundant_type_arguments_of_method_highlighting

Warning

Redundant type check in a pattern


RedundantTypeCheckInPattern


resharper_redundant_type_check_in_pattern_highlighting

Warning

Redundant using directive


RedundantUsingDirective


resharper_redundant_using_directive_highlighting

Warning

Redundant verbatim prefix


RedundantVerbatimPrefix


resharper_redundant_verbatim_prefix_highlighting

Suggestion

Redundant verbatim string prefix


RedundantVerbatimStringPrefix


resharper_redundant_verbatim_string_prefix_highlighting

Suggestion

Redundant 'virtual' modifier


RedundantVirtualModifier


resharper_redundant_virtual_modifier_highlighting

Warning

Remove redundant pattern-matching parentheses


RedundantPatternParentheses


resharper_redundant_pattern_parentheses_highlighting

Hint

Subpattern that always matches is redundant


RedundantAlwaysMatchSubpattern


resharper_redundant_always_match_subpattern_highlighting

Suggestion

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


ForStatementConditionIsTrue


resharper_for_statement_condition_is_true_highlighting

Warning

Type check for nullable type is equal to underlying type check


RedundantNullableTypeMark


resharper_redundant_nullable_type_mark_highlighting

Warning

Unsafe context declaration is redundant


RedundantUnsafeContext


resharper_redundant_unsafe_context_highlighting

Warning

Redundancies in Symbol Declarations (48 inspections)

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

Inspection


ID


EditorConfig property

Default severity

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


ClassWithVirtualMembersNeverInherited.Global


resharper_class_with_virtual_members_never_inherited_global_highlighting

Suggestion

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


ClassWithVirtualMembersNeverInherited.Local


resharper_class_with_virtual_members_never_inherited_local_highlighting

Suggestion

Component of the tuple is never used


UnusedTupleComponentInReturnValue


resharper_unused_tuple_component_in_return_value_highlighting

Warning

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


MeaninglessDefaultParameterValue


resharper_meaningless_default_parameter_value_highlighting

Warning

Empty constructor


EmptyConstructor


resharper_empty_constructor_highlighting

Warning

Empty destructor


EmptyDestructor


resharper_empty_destructor_highlighting

Warning

Empty namespace declaration


EmptyNamespace


resharper_empty_namespace_highlighting

Warning

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


EntityNameCapturedOnly.Global


resharper_entity_name_captured_only_global_highlighting

Warning

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


EntityNameCapturedOnly.Local


resharper_entity_name_captured_only_local_highlighting

Warning

Local function is never used


UnusedLocalFunction


resharper_unused_local_function_highlighting

Warning

Local function is never used


UnusedLocalFunction.Compiler


resharper_unused_local_function_compiler_highlighting

Warning

Local function return value is never used


UnusedLocalFunctionReturnValue


resharper_unused_local_function_return_value_highlighting

Warning

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


UnusedMethodReturnValue.Global


resharper_unused_method_return_value_global_highlighting

Suggestion

Method return value is never used (private accessibility)


UnusedMethodReturnValue.Local


resharper_unused_method_return_value_local_highlighting

Warning

Non-accessed local variable


NotAccessedVariable


resharper_not_accessed_variable_highlighting

Warning

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


NotAccessedOutParameterVariable


resharper_not_accessed_out_parameter_variable_highlighting

Warning

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


ParameterOnlyUsedForPreconditionCheck.Global


resharper_parameter_only_used_for_precondition_check_global_highlighting

Suggestion

Parameter is only used for precondition check (private accessibility)


ParameterOnlyUsedForPreconditionCheck.Local


resharper_parameter_only_used_for_precondition_check_local_highlighting

Warning

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


OutParameterValueIsAlwaysDiscarded.Global


resharper_out_parameter_value_is_always_discarded_global_highlighting

Suggestion

Parameter output value is always discarded (private accessibility)


OutParameterValueIsAlwaysDiscarded.Local


resharper_out_parameter_value_is_always_discarded_local_highlighting

Warning

'params' modifier is always ignored on overrides


RedundantParams


resharper_redundant_params_highlighting

Warning

Redundant base constructor call


RedundantBaseConstructorCall


resharper_redundant_base_constructor_call_highlighting

Warning

Redundant class or interface specification in base types list


RedundantExtendsListEntry


resharper_redundant_extends_list_entry_highlighting

Warning

Redundant member initializer


RedundantDefaultMemberInitializer


resharper_redundant_default_member_initializer_highlighting

Warning

Redundant member override


RedundantOverriddenMember


resharper_redundant_overridden_member_highlighting

Warning

Redundant method overload (non-private accessibility)


RedundantOverload.Global


resharper_redundant_overload_global_highlighting

Suggestion

Redundant method overload (private accessibility)


RedundantOverload.Local


resharper_redundant_overload_local_highlighting

Suggestion

Redundant 'partial' modifier on method declaration


PartialMethodWithSinglePart


resharper_partial_method_with_single_part_highlighting

Warning

Redundant 'partial' modifier on type declaration


PartialTypeWithSinglePart


resharper_partial_type_with_single_part_highlighting

Warning

Sealed member in sealed class


SealedMemberInSealedClass


resharper_sealed_member_in_sealed_class_highlighting

Warning

Type is never used (non-private accessibility)


UnusedType.Global


resharper_unused_type_global_highlighting

Suggestion

Type is never used (private accessibility)


UnusedType.Local


resharper_unused_type_local_highlighting

Warning

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


UnusedMemberInSuper.Global


resharper_unused_member_in_super_global_highlighting

Suggestion

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


UnusedMemberInSuper.Local


resharper_unused_member_in_super_local_highlighting

Warning

Type member is never used (non-private accessibility)


UnusedMember.Global


resharper_unused_member_global_highlighting

Suggestion

Type member is never used (private accessibility)


UnusedMember.Local


resharper_unused_member_local_highlighting

Warning

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


UnusedMemberHierarchy.Global


resharper_unused_member_hierarchy_global_highlighting

Suggestion

Type member is only used in overrides (private accessibility)


UnusedMemberHierarchy.Local


resharper_unused_member_hierarchy_local_highlighting

Warning

Underlying type of enum is 'int'


EnumUnderlyingTypeIsInt


resharper_enum_underlying_type_is_int_highlighting

Warning

Unused label


UnusedLabel


resharper_unused_label_highlighting

Warning

Unused local variable


UnusedVariable


resharper_unused_variable_highlighting

Warning

Unused parameter (non-private accessibility)


UnusedParameter.Global


resharper_unused_parameter_global_highlighting

Suggestion

Unused parameter (private accessibility)


UnusedParameter.Local


resharper_unused_parameter_local_highlighting

Warning

Unused parameter in partial method


UnusedParameterInPartialMethod


resharper_unused_parameter_in_partial_method_highlighting

Warning

Unused positional parameter


UnusedPositionalParameterCompiler


resharper_unused_positional_parameter_compiler_highlighting

Warning

Unused type parameter


UnusedTypeParameter


resharper_unused_type_parameter_highlighting

Warning

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


VirtualMemberNeverOverridden.Global


resharper_virtual_member_never_overridden_global_highlighting

Suggestion

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


VirtualMemberNeverOverridden.Local


resharper_virtual_member_never_overridden_local_highlighting

Suggestion

Spelling Issues (3 inspections)

These inspections detect typos in various contexts.

Inspection


ID


EditorConfig property

Default severity

Typo in comment


CommentTypo


resharper_comment_typo_highlighting

Suggestion

Typo in identifier


IdentifierTypo


resharper_identifier_typo_highlighting

Suggestion

Typo in string literal


StringLiteralTypo


resharper_string_literal_typo_highlighting

Suggestion

Syntax Style (46 inspections)

Inspections in this category detect violations of code syntax styles. In contrast to most code inspections, these inspections can either detect the same code construct as a code issue or not depending on the corresponding code style rule configured on the Code Editing | [Language] | Syntax Style page of ReSharper options (Alt+R, O). You can also fix issues that these inspection detect using code cleanup.

Inspection


ID


EditorConfig property

Default severity

Add parentheses to avoid non-obvious precedence


ArrangeMissingParentheses


resharper_arrange_missing_parentheses_highlighting

Disabled

Add/remove qualifier for static members


ArrangeStaticMemberQualifier


resharper_arrange_static_member_qualifier_highlighting

Hint

Add/remove 'this.' qualifier


ArrangeThisQualifier


resharper_arrange_this_qualifier_highlighting

Hint

Adjust modifiers declaration order


ArrangeModifiersOrder


resharper_arrange_modifiers_order_highlighting

Suggestion

Arrange null checking pattern


ArrangeNullCheckingPattern


resharper_arrange_null_checking_pattern_highlighting

Hint

Join or separate attributes in section


ArrangeAttributes


resharper_arrange_attributes_highlighting

Disabled

Join or separate 'var' in deconstruction declarations


ArrangeVarKeywordsInDeconstructingDeclaration


resharper_arrange_var_keywords_in_deconstructing_declaration_highlighting

Suggestion

Place assignment expression into block


PlaceAssignmentExpressionIntoBlock


resharper_place_assignment_expression_into_block_highlighting

Disabled

Remove redundant parentheses


ArrangeRedundantParentheses


resharper_arrange_redundant_parentheses_highlighting

Hint

Replace built-in type reference with a CLR type name or a keyword


BuiltInTypeReferenceStyle


resharper_built_in_type_reference_style_highlighting

Hint

Replace built-in type reference with a CLR type name or a keyword in static member access expressions


BuiltInTypeReferenceStyleForMemberAccess


resharper_built_in_type_reference_style_for_member_access_highlighting

Hint

Separate control transfer statement with blank line


SeparateControlTransferStatement


resharper_separate_control_transfer_statement_highlighting

Disabled

Unnecessary whitespace at the end of line


UnnecessaryWhitespace


resharper_unnecessary_whitespace_highlighting

Disabled

Usage of tabulation character for indentation is prohibited


TabsAreDisallowed


resharper_tabs_are_disallowed_highlighting

Disabled

Use explicit or implicit modifier definition for type members


ArrangeTypeMemberModifiers


resharper_arrange_type_member_modifiers_highlighting

Hint

Use explicit or implicit modifier definition for types


ArrangeTypeModifiers


resharper_arrange_type_modifiers_highlighting

Hint

Use preferred argument style


ArgumentsStyleOther


resharper_arguments_style_other_highlighting

Disabled

Use preferred argument style for anonymous functions


ArgumentsStyleAnonymousFunction


resharper_arguments_style_anonymous_function_highlighting

Disabled

Use preferred argument style for literal values


ArgumentsStyleLiteral


resharper_arguments_style_literal_highlighting

Disabled

Use preferred argument style for named expressions


ArgumentsStyleNamedExpression


resharper_arguments_style_named_expression_highlighting

Disabled

Use preferred argument style for string literal values


ArgumentsStyleStringLiteral


resharper_arguments_style_string_literal_highlighting

Disabled

Use preferred body style (convert into constructor or destructor with preferred body style)


ArrangeConstructorOrDestructorBody


resharper_arrange_constructor_or_destructor_body_highlighting

Disabled

Use preferred body style (convert into local function with preferred body style)


ArrangeLocalFunctionBody


resharper_arrange_local_function_body_highlighting

Disabled

Use preferred body style (convert into method or operator with preferred body style)


ArrangeMethodOrOperatorBody


resharper_arrange_method_or_operator_body_highlighting

Disabled

Use preferred body style (convert into property, indexer, or event with preferred body style)


ArrangeAccessorOwnerBody


resharper_arrange_accessor_owner_body_highlighting

Suggestion

Use preferred braces style (enforce braces in 'do-while' statement)


EnforceDoWhileStatementBraces


resharper_enforce_do_while_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'fixed' statement)


EnforceFixedStatementBraces


resharper_enforce_fixed_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'for' statement)


EnforceForStatementBraces


resharper_enforce_for_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'foreach' statement)


EnforceForeachStatementBraces


resharper_enforce_foreach_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'if' statement)


EnforceIfStatementBraces


resharper_enforce_if_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'lock' statement)


EnforceLockStatementBraces


resharper_enforce_lock_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'using' statement)


EnforceUsingStatementBraces


resharper_enforce_using_statement_braces_highlighting

Disabled

Use preferred braces style (enforce braces in 'while' statement)


EnforceWhileStatementBraces


resharper_enforce_while_statement_braces_highlighting

Disabled

Use preferred braces style (remove redundant braces)


RemoveRedundantBraces


resharper_remove_redundant_braces_highlighting

Disabled

Use preferred namespace body style


ArrangeNamespaceBody


resharper_arrange_namespace_body_highlighting

Hint

Use preferred style for discard declaration


SuggestDiscardDeclarationVarStyle


resharper_suggest_discard_declaration_var_style_highlighting

Hint

Use preferred style for trailing comma before new line in multiline lists


ArrangeTrailingCommaInMultilineLists


resharper_arrange_trailing_comma_in_multiline_lists_highlighting

Hint

Use preferred style for trailing comma when the last element is not followed by a new line


ArrangeTrailingCommaInSinglelineLists


resharper_arrange_trailing_comma_in_singleline_lists_highlighting

Hint

Use preferred style of default value expression when type is evident


ArrangeDefaultValueWhenTypeEvident


resharper_arrange_default_value_when_type_evident_highlighting

Suggestion

Use preferred style of default value expression when type is not evident


ArrangeDefaultValueWhenTypeNotEvident


resharper_arrange_default_value_when_type_not_evident_highlighting

Hint

Use preferred style of 'new' expression when created type is evident


ArrangeObjectCreationWhenTypeEvident


resharper_arrange_object_creation_when_type_evident_highlighting

Suggestion

Use preferred style of 'new' expression when created type is not evident


ArrangeObjectCreationWhenTypeNotEvident


resharper_arrange_object_creation_when_type_not_evident_highlighting

Hint

Use preferred 'var' style (elsewhere)


SuggestVarOrType_Elsewhere


resharper_suggest_var_or_type_elsewhere_highlighting

Hint

Use preferred 'var' style (for built-in types)


SuggestVarOrType_BuiltInTypes


resharper_suggest_var_or_type_built_in_types_highlighting

Hint

Use preferred 'var' style (in deconstruction declarations)


SuggestVarOrType_DeconstructionDeclarations


resharper_suggest_var_or_type_deconstruction_declarations_highlighting

Hint

Use preferred 'var' style (when type is simple)


SuggestVarOrType_SimpleTypes


resharper_suggest_var_or_type_simple_types_highlighting

Hint

Unity (43 inspections)

Inspections in this category report code issues specific to Unity projects.

Inspection


ID


EditorConfig property

Default severity

Alternative non-allocating method available


Unity.PreferNonAllocApi


resharper_unity_prefer_non_alloc_api_highlighting

Warning

Avoid 'base.OnGUI()' in classes derived from 'PropertyDrawer'


Unity.PropertyDrawerOnGUIBase


resharper_unity_property_drawer_on_gui_base_highlighting

Warning

Cannot resolve component or scriptable object


Unity.UnresolvedComponentOrScriptableObject


resharper_unity_unresolved_component_or_scriptable_object_highlighting

Warning

DOTS types must be declared as struct


Unity.Entities.MustBeStructForDotsInheritor


resharper_unity_entities_must_be_struct_for_dots_inheritor_highlighting

Error

Event function with the same name is already declared


Unity.DuplicateEventFunction


resharper_unity_duplicate_event_function_highlighting

Warning

Expected type derived from 'Component' or 'MonoBehaviour'


Unity.ExpectedComponent


resharper_unity_expected_component_highlighting

Warning

Expected type derived from 'ScriptableObject'


Unity.ExpectedScriptableObject


resharper_unity_expected_scriptable_object_highlighting

Warning

Field of 'ComponentLookup' type must be updated before being used.


Unity.Entities.NotUpdatedComponentLookup


resharper_unity_entities_not_updated_component_lookup_highlighting

Warning

File name should match the name of the assembly


MISMATCHED_ASMDEF_FILENAME


resharper_mismatched_asmdef_filename_highlighting

Suggestion

Inconsistent modifier for DOTS types


Unity.Entities.InconsistentModifiersForDotsInheritor


resharper_unity_entities_inconsistent_modifiers_for_dots_inheritor_highlighting

Error

Incorrect field type for IAspect


Unity.Entities.AspectWrongFieldsType


resharper_unity_entities_aspect_wrong_fields_type_highlighting

Error

Incorrect method signature


Unity.IncorrectMethodSignature


resharper_unity_incorrect_method_signature_highlighting

Warning

Method referenced in string literal does not have the expected signature


Unity.IncorrectMethodSignatureInStringLiteral


resharper_unity_incorrect_method_signature_in_string_literal_highlighting

Warning

'MonoBehaviour' instances must be instantiated with 'GameObject.AddComponent<T>()' instead of 'new'


Unity.IncorrectMonoBehaviourInstantiation


resharper_unity_incorrect_mono_behaviour_instantiation_highlighting

Warning

Parameter should be derived from 'Component'


Unity.ParameterNotDerivedFromComponent


resharper_unity_parameter_not_derived_from_component_highlighting

Warning

Possible incorrect application of attribute to multiple fields


Unity.PossibleMisapplicationOfAttributeToMultipleFields


resharper_unity_possible_misapplication_of_attribute_to_multiple_fields_highlighting

Warning

Possible unintended bypass of lifetime check of underlying Unity engine object ('?.' on a type deriving from 'UnityEngine.Object' bypasses the lifetime check on the underlying Unity engine object)


Unity.NoNullPropagation


resharper_unity_no_null_propagation_highlighting

Warning

Possible unintended bypass of lifetime check of underlying Unity engine object ('??' on a type deriving from 'UnityEngine.Object' bypasses the lifetime check on the underlying Unity engine object)


Unity.NoNullCoalescing


resharper_unity_no_null_coalescing_highlighting

Warning

Prefer GUID-based assembly references


Unity.PreferGuidReference


resharper_unity_prefer_guid_reference_highlighting

Hint

Redundant attribute usage (attribute is redundant when applied to this declaration type)


Unity.RedundantAttributeOnTarget


resharper_unity_redundant_attribute_on_target_highlighting

Warning

Redundant attribute usage (redundant 'FormerlySerializedAs' attribute)


Unity.RedundantFormerlySerializedAsAttribute


resharper_unity_redundant_formerly_serialized_as_attribute_highlighting

Warning

Redundant attribute usage (redundant 'HideInInspector' attribute)


Unity.RedundantHideInInspectorAttribute


resharper_unity_redundant_hide_in_inspector_attribute_highlighting

Warning

Redundant attribute usage (redundant 'InitializeOnLoad' attribute)


Unity.RedundantInitializeOnLoadAttribute


resharper_unity_redundant_initialize_on_load_attribute_highlighting

Warning

Redundant attribute usage (redundant 'SerializeField' attribute)


Unity.RedundantSerializeFieldAttribute


resharper_unity_redundant_serialize_field_attribute_highlighting

Warning

Redundant Unity event function


Unity.RedundantEventFunction


resharper_unity_redundant_event_function_highlighting

Warning

Repeated access of property on built in component is inefficient


Unity.InefficientPropertyAccess


resharper_unity_inefficient_property_access_highlighting

Warning

Scene does not exist


Unity.LoadSceneUnexistingScene


resharper_unity_load_scene_unexisting_scene_highlighting

Warning

Scene is disabled in the build settings


Unity.LoadSceneDisabledSceneName


resharper_unity_load_scene_disabled_scene_name_highlighting

Warning

'ScriptableObject' instances must be instantiated with 'ScriptableObject.CreateInstance<T>()' instead of 'new'


Unity.IncorrectScriptableObjectInstantiation


resharper_unity_incorrect_scriptable_object_instantiation_highlighting

Warning

Setting 'parent' property immediately after object instantiation is inefficient


Unity.InstantiateWithoutParent


resharper_unity_instantiate_without_parent_highlighting

Warning

Short scene name is not unique


Unity.LoadSceneAmbiguousSceneName


resharper_unity_load_scene_ambiguous_scene_name_highlighting

Warning

String based graphics property lookup is inefficient


Unity.PreferAddressByIdToGraphicsParams


resharper_unity_prefer_address_by_id_to_graphics_params_highlighting

Warning

String based lookup of component type is inefficient


Unity.PreferGenericMethodOverload


resharper_unity_prefer_generic_method_overload_highlighting

Warning

The index is missing in the build settings


Unity.LoadSceneWrongIndex


resharper_unity_load_scene_wrong_index_highlighting

Warning

The input name is not defined in the Input manager


Unity.UnknownInputAxes


resharper_unity_unknown_input_axes_highlighting

Warning

The layer is not defined in the 'Tags & Layers'


Unity.UnknownLayer


resharper_unity_unknown_layer_highlighting

Warning

The resource is not defined in the project


Unity.UnknownResource


resharper_unity_unknown_resource_highlighting

Warning

The same shortcut is defined for another menu item


Unity.DuplicateShortcut


resharper_unity_duplicate_shortcut_highlighting

Warning

The tag is not defined in the 'Tags & Layers'


Unity.UnknownTag


resharper_unity_unknown_tag_highlighting

Warning

There is no animator state with the same name in the project.


Unity.UnknownAnimatorStateName


resharper_unity_unknown_animator_state_name_highlighting

Warning

There is no scene with the same name in the build settings


Unity.LoadSceneUnknownSceneName


resharper_unity_load_scene_unknown_scene_name_highlighting

Warning

To use the result of a 'GetSingleton<T>' call in the function, 'OnCreate' must include a 'RequireForUpdate' call


Unity.Entities.SingletonMustBeRequested


resharper_unity_entities_singleton_must_be_requested_highlighting

Warning

Use 'CompareTag' instead of explicit string comparison


Unity.ExplicitTagComparison


resharper_unity_explicit_tag_comparison_highlighting

Warning

Unity Burst Compiler Warnings (13 inspections)

Inspections in this category report warnings of the Unity Burst Compiler before the code is actually compiled.

Inspection


ID


EditorConfig property

Default severity

Accessing managed methods is not supported


Unity.BurstAccessingManagedMethod


resharper_unity_burst_accessing_managed_method_highlighting

Warning

Boxing is not supported


Unity.BurstBoxingNotSupported


resharper_unity_burst_boxing_not_supported_highlighting

Warning

Creating a managed type is not supported


Unity.BurstCreatingManagedType


resharper_unity_burst_creating_managed_type_highlighting

Warning

Debug logging functions accepts only strings


Unity.BurstDebugLogInvalidArgument


resharper_unity_burst_debug_log_invalid_argument_highlighting

Warning

Function signature cannot contain managed types


Unity.BurstFunctionSignatureContainsManagedTypes


resharper_unity_burst_function_signature_contains_managed_types_highlighting

Warning

Loading from a non-readonly static field is not supported


Unity.BurstLoadingStaticNotReadonly


resharper_unity_burst_loading_static_not_readonly_highlighting

Warning

Loading managed type is not supported


Unity.BurstLoadingManagedType


resharper_unity_burst_loading_managed_type_highlighting

Warning

Shared static type parameter requires the unmanaged constraint


Unity.SharedStaticUnmanagedType


resharper_unity_shared_static_unmanaged_type_highlighting

Warning

Some SharedStatic`1.GetOrCreate overloads cause compiler errors


Unity.BurstSharedStaticCreate


resharper_unity_burst_shared_static_create_highlighting

Warning

The 'foreach' construction is not supported


Unity.BurstForeachNotSupported


resharper_unity_burst_foreach_not_supported_highlighting

Warning

Try statement is not supported


Unity.BurstTryNotSupported


resharper_unity_burst_try_not_supported_highlighting

Warning

Typeof is prohibited in Burst


Unity.BurstTypeofExpression


resharper_unity_burst_typeof_expression_highlighting

Warning

Writing to a static field is not supported


Unity.BurstWriteStaticField


resharper_unity_burst_write_static_field_highlighting

Warning

Unity Performance Inspections (5 inspections)

Inspections in this category report computationally inefficient patterns Unity projects.

Inspection


ID


EditorConfig property

Default severity

'Camera.main' is expensive


Unity.PerformanceCriticalCodeCameraMain


resharper_unity_performance_critical_code_camera_main_highlighting

Hint

Expensive method invocation


Unity.PerformanceCriticalCodeInvocation


resharper_unity_performance_critical_code_invocation_highlighting

Hint

Expensive null comparison


Unity.PerformanceCriticalCodeNullComparison


resharper_unity_performance_critical_code_null_comparison_highlighting

Hint

Order of multiplication operations is inefficient


Unity.InefficientMultiplicationOrder


resharper_unity_inefficient_multiplication_order_highlighting

Warning

Use jagged or one-dimensional array instead of multidimensional array


Unity.InefficientMultidimensionalArrayUsage


resharper_unity_inefficient_multidimensional_array_usage_highlighting

Warning

Unreal Build System (2 inspections)

Inspection


ID


EditorConfig property

Default severity

Dependency for the plugin is missing in the project file


CSharpMissingPluginDependency


resharper_c_sharp_missing_plugin_dependency_highlighting

Warning

Module with this name does not exist


CSharpBuildCSInvalidModuleName


resharper_c_sharp_build_cs_invalid_module_name_highlighting

Warning

Xunit (1 inspection)

These inspections detect code issues related to xUnit.Net tests.

Inspection


ID


EditorConfig property

Default severity

Console output in Xunit tests


Xunit.XunitTestWithConsoleOutput


resharper_xunit_xunit_test_with_console_output_highlighting

Warning

Last modified: 27 March 2023