All ReSharper code inspections as well as structural search and replace patterns have one of the following four severity levels:
When code inspection is performed in design-time, severity levels are used to highlight detected code issues in the editor in different ways and to add the corresponding color marks to the marker bar.
If necessary, you can change severity level of every code inspection except compiler errors. For more information, see Configuring Code Inspection Settings.
Errors have the highest priority of all - they prevent your code from compiling or point at runtime errors.
If you inspect code in a specific scope, errors are displayed with the icons in the inspection results. In design-time inspection in the editor, ReSharper highlights errors in one of two alternative ways:
Displays an unresolved symbol in red:
Highlights a statement or part of it with a red curly underline:
In Visual Studio project settings, you can choose to treat warnings as errors. ReSharper is aware of this option and highlights warnings accordingly: if this setting is on, then issues that correspond to compiler warnings will be highlighted as errors.
This setting is configurable in the project properties: Project | [Project Name] Properties | Treat warnings as errors and can be applied to all warnings if All is selected or to the specified warnings only.
This severity level correspond to compiler warnings and to other issues that do not prevent your code from compiling but may nevertheless represent serious coding inefficiencies. For example, ReSharper informs you about redundant type casts or namespace import directives, incorrect format strings, declared but never used local variables or private fields, unused private methods, etc.
If you inspect code in a specific scope, warnings are displayed with the icons in the inspection results. In design-time inspection in the editor, ReSharper highlights warnings in one of two alternative ways:
With grayed text:
With a blue curly underline:
Code issues with this severity level provide insights into code structure, drawing your attention to things that aren't necessarily bad or wrong, but probably useful to know.
For instance, you might be interested to know that "parameter can be declared with base type", meaning that your method only uses members of the parameter's base type. This can be an indication of a different error, such as failure to take into account the specifics of the actual parameter type. Based on this knowledge, you may want to change the parameter's type - or not, if that is by design.
If you inspect code in a specific scope, suggestions are displayed with the icons in the inspection results. In design-time inspection in the editor, ReSharper highlights suggestions with a green curly underline:
This is the lowest severity level. Code issues with this severity simply bring your attention to a particular code detail and/or recommends a way of improvement.
If you inspect code in a specific scope, hints are displayed with the icons in the inspection results. In design-time inspection in the editor, ReSharper highlights hints by adding a dashed green underline to the initial two letters of the corresponding symbol:
Unlike errors, warnings and suggestions, hints are not taken into account when you navigate between code issues in the editor, not shown in the marker bar and therefore do not influence the color of the status indicator. Note that when you set the caret over a highlighted item, the corresponding hint message only appears in the status bar.
Do not show
This severity level allows disabling inspections. If an inspection has this severity level, the corresponding code issues are not highlighted in the editor and do not appear in the inspection results.
- Code Analysis
- Code Inspection
- Inspection Severity Levels and Highlighting
- Marker Bar and Status Indicator
- Solution-Wide Analysis
- Quick-Fixes for Code Issues
- Solution-Wide Code Inspections
- Structural Search and Replace