Code Inspections in C#
In C#, ReSharper 2021.1 provides two kinds of code inspections: 919 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 744 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 (150 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 overrider hasn't 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' to 'while ConvertIfDoToWhile resharper_convert_if_do_to_while_highlighting | Suggestion |
Convert 'if' to '||' ConvertIfToOrExpression resharper_convert_if_to_or_expression_highlighting | Suggestion |
Convert local variable or field to constant (non-private accessibility) ConvertToConstant.Global resharper_convert_to_constant_global_highlighting | Hint |
Convert local variable or field to 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 |
Empty control statement body EmptyEmbeddedStatement resharper_empty_embedded_statement_highlighting | Warning |
Empty statement is redundant EmptyStatement resharper_empty_statement_highlighting | Warning |
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's 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 | Hint |
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 base type SuggestBaseTypeForParameter resharper_suggest_base_type_for_parameter_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 parameter could be declared as covariant or contravariant TypeParameterCanBeVariant resharper_type_parameter_can_be_variant_highlighting | Suggestion |
Unreachable code detected UnreachableCode resharper_unreachable_code_highlighting | Warning |
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 cancellation token UseCancellationTokenForIAsyncEnumerable resharper_use_cancellation_token_for_i_async_enumerable_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 'String.IsNullOrEmpty' ReplaceWithStringIsNullOrEmpty resharper_replace_with_string_is_null_or_empty_highlighting | Suggestion |
Compiler Warnings (128 inspections)
Inspections in this category detect compiler warnings before you compile.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 member is not initialized at constructor exit NotNullMemberIsNotInitialized resharper_not_null_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 (60 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 |
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 to local function ConvertToLocalFunction resharper_convert_to_local_function_highlighting | Suggestion |
Convert 'if' statement to 'switch' expression ConvertIfStatementToSwitchExpression resharper_convert_if_statement_to_switch_expression_highlighting | Hint |
Convert 'if' statement to 'switch' statement ConvertIfStatementToSwitchStatement resharper_convert_if_statement_to_switch_statement_highlighting | Hint |
Convert lambda expression to method group ConvertClosureToMethodGroup resharper_convert_closure_to_method_group_highlighting | Suggestion |
Convert negated 'is' expression to 'is' expression with negated pattern UseNegatedPatternInIsExpression resharper_use_negated_pattern_in_is_expression_highlighting | Hint |
Convert 'Nullable<T>' to 'T?' ConvertNullableToShortForm resharper_convert_nullable_to_short_form_highlighting | Suggestion |
Convert property to auto-property ConvertToAutoProperty resharper_convert_to_auto_property_highlighting | Suggestion |
Convert property to auto-property (when possible) ConvertToAutoPropertyWhenPossible resharper_convert_to_auto_property_when_possible_highlighting | Hint |
Convert property to auto-property with private setter ConvertToAutoPropertyWithPrivateSetter resharper_convert_to_auto_property_with_private_setter_highlighting | Hint |
Convert static method invocation to extension method call InvokeAsExtensionMethod resharper_invoke_as_extension_method_highlighting | Suggestion |
Convert to 'await using' statement or declaration UseAwaitUsing resharper_use_await_using_highlighting | Suggestion |
Convert to lambda expression ConvertToLambdaExpression resharper_convert_to_lambda_expression_highlighting | Suggestion |
Convert to lambda expression (when possible) ConvertToLambdaExpressionWhenPossible resharper_convert_to_lambda_expression_when_possible_highlighting | Disabled |
Convert to static class ConvertToStaticClass resharper_convert_to_static_class_highlighting | Suggestion |
Convert to 'using' declaration ConvertToUsingDeclaration resharper_convert_to_using_declaration_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 re-written as '?:' expression ConvertIfStatementToConditionalTernaryExpression resharper_convert_if_statement_to_conditional_ternary_expression_highlighting | Suggestion |
'if' statement can be re-written as '??' expression ConvertIfStatementToNullCoalescingExpression resharper_convert_if_statement_to_null_coalescing_expression_highlighting | Suggestion |
'if' statement can be re-written as '??=' assignment ConvertIfStatementToNullCoalescingAssignment resharper_convert_if_statement_to_null_coalescing_assignment_highlighting | Suggestion |
'if-return' statement can be re-written 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 |
Join null check with assignment (when possible) JoinNullCheckWithUsageWhenPossible resharper_join_null_check_with_usage_when_possible_highlighting | Disabled |
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 conditional ?: expression into conditional access (when possible) MergeConditionalExpressionWhenPossible resharper_merge_conditional_expression_when_possible_highlighting | Disabled |
Merge negated null/pattern checks into complex pattern MergeIntoNegatedPattern resharper_merge_into_negated_pattern_highlighting | Hint |
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 |
Merge sequential checks into single conditional access check (when possible) MergeSequentialChecksWhenPossible resharper_merge_sequential_checks_when_possible_highlighting | Disabled |
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 |
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 if statement with null-propagating code (when possible) UseNullPropagationWhenPossible resharper_use_null_propagation_when_possible_highlighting | Disabled |
Replace object pattern not performing any additional checks with 'var' pattern ReplaceObjectPatternWithVarPattern resharper_replace_object_pattern_with_var_pattern_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 (on parameter declaration) UseDeconstructionOnParameter resharper_use_deconstruction_on_parameter_highlighting | Hint |
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 type's name UseNameOfInsteadOfTypeOf resharper_use_name_of_instead_of_type_of_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 | Hint |
Use range indexer ReplaceSliceWithRangeIndexer resharper_replace_slice_with_range_indexer_highlighting | Suggestion |
Use range indexer ReplaceSubstringWithRangeIndexer resharper_replace_substring_with_range_indexer_highlighting | Hint |
Use string interpolation expression UseStringInterpolation resharper_use_string_interpolation_highlighting | Suggestion |
Use switch expression ConvertSwitchStatementToSwitchExpression resharper_convert_switch_statement_to_switch_expression_highlighting | Hint |
Use switch expression ConvertConditionalTernaryExpressionToSwitchExpression resharper_convert_conditional_ternary_expression_to_switch_expression_highlighting | Hint |
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. Missed 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 (155 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] doesn't work with instance fields ThreadStaticAtInstanceField resharper_thread_static_at_instance_field_highlighting | Warning |
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 |
Bitwise operation on enum which 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 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 |
Collection's content is never queried (non-private accessibility) CollectionNeverQueried.Global resharper_collection_never_queried_global_highlighting | Warning |
Collection's content is never queried (private accessibility) CollectionNeverQueried.Local resharper_collection_never_queried_local_highlighting | Warning |
Constant shift expression with non-zero operands results in 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 |
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 |
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 due to integer analysis. UnreachableSwitchCaseDueToIntegerAnalysis resharper_unreachable_switch_case_due_to_integer_analysis_highlighting | Warning |
Heuristically unreachable switch arm due 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 synchronization on field InconsistentlySynchronizedField resharper_inconsistently_synchronized_field_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 isn't 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 |
Method with 'params' is invoked while more specific method is available PossiblyMistakenUseOfParamsMethod resharper_possibly_mistaken_use_of_params_method_highlighting | Warning |
Mismatch of optional parameter value in overridden method OptionalParameterHierarchyMismatch resharper_optional_parameter_hierarchy_mismatch_highlighting | Warning |
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-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 |
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 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 overflow. IntVariableOverflow resharper_int_variable_overflow_highlighting | Warning |
Possible 'System.ArgumentOutOfRangeException'. Index must be a non-negative integer NegativeIndex resharper_negative_index_highlighting | Warning |
Possible 'System.ArgumentOutOfRangeException'. Start index should 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 |
Right operand of dynamic shift operation should be convertible to 'int' DynamicShiftRightOpIsNotInt resharper_dynamic_shift_right_op_is_not_int_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 |
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 given expression of 'is' operator is always of the provided type IsExpressionAlwaysTrue resharper_is_expression_always_true_highlighting | Warning |
The given expression of 'is' operator is never of the provided type IsExpressionAlwaysFalse resharper_is_expression_always_false_highlighting | Warning |
The source expression always matches the provided pattern PatternAlwaysMatches resharper_pattern_always_matches_highlighting | Warning |
The source expression is always of pattern's type PatternAlwaysOfType resharper_pattern_always_of_type_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 UseFormatSpecifierInInterpolation resharper_use_format_specifier_in_interpolation_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 |
Redundancies in Code (75 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 |
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 |
Double negation operator DoubleNegationOperator resharper_double_negation_operator_highlighting | Suggestion |
Empty 'for' loop is redundant EmptyForStatement resharper_empty_for_statement_highlighting | Warning |
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 |
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 to 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 always match subpattern RedundantAlwaysMatchSubpattern resharper_redundant_always_match_subpattern_highlighting | Suggestion |
Redundant anonymous type property explicit name RedundantAnonymousTypePropertyName resharper_redundant_anonymous_type_property_name_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 '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 cast RedundantCast resharper_redundant_cast_highlighting | Warning |
Redundant catch clause RedundantCatchClause resharper_redundant_catch_clause_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 control flow jump statement RedundantJumpStatement resharper_redundant_jump_statement_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 '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 '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 semicolon after type or namespace declaration RedundantDeclarationSemicolon resharper_redundant_declaration_semicolon_highlighting | Hint |
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 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 |
Remove redundant pattern-matching parentheses RedundantPatternParentheses resharper_redundant_pattern_parentheses_highlighting | Hint |
'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 (45 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' should 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 |
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 |
'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 (43 inspections)
Inspections in this category detect violations of code syntax styles. In contrast to most of other 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 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 |
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 |
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 | Hint |
Use preferred argument style for anonymous functions ArgumentsStyleAnonymousFunction resharper_arguments_style_anonymous_function_highlighting | Hint |
Use preferred argument style for literal values ArgumentsStyleLiteral resharper_arguments_style_literal_highlighting | Hint |
Use preferred argument style for named expressions ArgumentsStyleNamedExpression resharper_arguments_style_named_expression_highlighting | Hint |
Use preferred argument style for string literal values ArgumentsStyleStringLiteral resharper_arguments_style_string_literal_highlighting | Hint |
Use preferred body style (convert to constructor or destructor with preferred body style) ArrangeConstructorOrDestructorBody resharper_arrange_constructor_or_destructor_body_highlighting | Disabled |
Use preferred body style (convert to local function with preferred body style) ArrangeLocalFunctionBody resharper_arrange_local_function_body_highlighting | Disabled |
Use preferred body style (convert to method or operator with preferred body style) ArrangeMethodOrOperatorBody resharper_arrange_method_or_operator_body_highlighting | Disabled |
Use preferred body style (convert to 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 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 |
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: 12 July 2021