Code Inspections in ASP.NET
In ASP.NET, ReSharper 2020.2 provides two kinds of code inspections: 6 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 35 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 ASP.NET inspections are listed below, grouped by their categories.
Common Practices and Code Improvements (1 inspection)
This category groups inspections that hunt for medium severity issues that mainly affect code readability. Inspection ID EditorConfig property | Default severity |
---|---|
Attribute with optional value problemAsp.TagAttributeWithOptionalValue resharper_asp_tag_attribute_with_optional_value_highlighting | Warning |
Potential Code Quality Issues (25 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 |
---|---|
ASP.NET Dead CodeAsp.DeadCode resharper_asp_dead_code_highlighting | Warning |
ASP.NET Resolve WarningAsp.ResolveWarning resharper_asp_resolve_warning_highlighting | Warning |
ASP.NET WarningAsp.Warning resharper_asp_warning_highlighting | Warning |
Cannot resolve propertyPropertyNotResolved resharper_property_not_resolved_highlighting | Error |
Cannot resolve resourceResourceNotResolved resharper_resource_not_resolved_highlighting | Error |
Cannot resolve resource itemResourceItemNotResolved resharper_resource_item_not_resolved_highlighting | Error |
Invalid control typeAsp.InvalidControlType resharper_asp_invalid_control_type_highlighting | Error |
MVC (mismatch Model Type)Mvc.InvalidModelType resharper_mvc_invalid_model_type_highlighting | Error |
MVC (unknown action)Mvc.ActionNotResolved resharper_mvc_action_not_resolved_highlighting | Error |
MVC (unknown area)Mvc.AreaNotResolved resharper_mvc_area_not_resolved_highlighting | Error |
MVC (unknown controller)Mvc.ControllerNotResolved resharper_mvc_controller_not_resolved_highlighting | Error |
MVC (unknown masterpage)Mvc.MasterpageNotResolved resharper_mvc_masterpage_not_resolved_highlighting | Error |
MVC (unknown partial view)Mvc.PartialViewNotResolved resharper_mvc_partial_view_not_resolved_highlighting | Error |
MVC (unknown template)Mvc.TemplateNotResolved resharper_mvc_template_not_resolved_highlighting | Error |
MVC (unknown view component view)Mvc.ViewComponentViewNotResolved resharper_mvc_view_component_view_not_resolved_highlighting | Error |
MVC (unknown view component)Mvc.ViewComponentNotResolved resharper_mvc_view_component_not_resolved_highlighting | Error |
MVC (unknown view)Mvc.ViewNotResolved resharper_mvc_view_not_resolved_highlighting | Error |
Non-accessed field (non-private accessibility)NotAccessedField.Global resharper_not_accessed_field_global_highlighting | Suggestion |
Object data source method resolve problemAspOdsMethodReferenceResolveError resharper_asp_ods_method_reference_resolve_error_highlighting | Error |
Unknown content placeholderAsp.ContentPlaceholderNotResolved resharper_asp_content_placeholder_not_resolved_highlighting | Error |
Unknown skinAsp.SkinNotResolved resharper_asp_skin_not_resolved_highlighting | Error |
Unknown symbolAsp.NotResolved resharper_asp_not_resolved_highlighting | Error |
Unknown themeAsp.ThemeNotResolved resharper_asp_theme_not_resolved_highlighting | Error |
Unsupported pageParserFilterTypeAsp.CustomPageParserFilterType resharper_asp_custom_page_parser_filter_type_highlighting | Warning |
Wrong image sizeAsp.Image resharper_asp_image_highlighting | Warning |
Redundancies in Code (3 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 |
---|---|
Redundant using directiveRedundantUsingDirective resharper_redundant_using_directive_highlighting | Warning |
Unused import clauseUnusedImportClause resharper_unused_import_clause_highlighting | Warning |
Unused register directiveAspUnusedRegisterDirectiveHighlighting resharper_asp_unused_register_directive_highlighting_highlighting | Warning |
Redundancies in Symbol Declarations (1 inspection)
This category includes code inspections, mostly with the warning severity level, which detect empty and unused symbol declarations. Inspection ID EditorConfig property | Default severity |
---|---|
Type member is never used (non-private accessibility)UnusedMember.Global resharper_unused_member_global_highlighting | Suggestion |
Spelling issues (5 inspections)
These inspections detect typos in various contexts. Inspection ID EditorConfig property | Default severity |
---|---|
Typo in commentCommentTypo resharper_comment_typo_highlighting | Suggestion |
Typo in identifierIdentifierTypo resharper_identifier_typo_highlighting | Suggestion |
Typo in markup attribute valueMarkupAttributeTypo resharper_markup_attribute_typo_highlighting | Suggestion |
Typo in markup textMarkupTextTypo resharper_markup_text_typo_highlighting | Suggestion |
Typo in string literalStringLiteralTypo resharper_string_literal_typo_highlighting | Suggestion |