ReSharper executes its Code Analysis by applying inspections to your code in design time. The inspections fall into the following categories:
- Inspection that detect compiler errors and warnings, which have the corresponding fixed severity levels.
- ReSharper's predefined code inspections, which include runtime and logical errors, code smells, redundancies, potential improvement suggestions, etc. You can find the comprehensive list of these inspections in the Code Inspection | Inspection Severity page of ReSharper options. For these inspections, you can configure severity levels.
- Custom code inspections defined in structural search and replace patterns, which also have configurable severtiy levels.
The easiest way to deal with code issues is to set the caret on the highlighted code item and press Alt+Enter or click on the action indicator that appears to the left of the code issue. The action list will pop up where ReSharper suggests one or more quick-fixes for most issues.
Options for inspection
Besides suggested fixes, for each code issue under your caret ReSharper shows the Options for inspection sub-menu in the actions list with the following items:
- Disable once with comment
- Disable and restore with comment
- Configure inspection severity
- Find all issues of this type
- For the most controversial issues, there is the Why is ReSharper suggesting this? item that opens a Code Inspection Wiki page with detailed description of the corresponding inspection.
You can disable the
Options for inspection sub-menu in the
Code Inspection | Settings
page of ReSharper options.
To do so, choose ReSharper | Options | Code Inspection | Settings in the main menu, and then use Show code inspection options in action list check-box.
As an alternative to opening files and exploring code issues there, you can inspect issues in a specific scope - project, project folder, or the whole solution.
Starting from ReSharper 8.0, you can disable all inspections in a specific piece of code — insert // ReSharper Disable All before and // ReSharper Restore All after the code block.
This feature is supported in the following languages/technologies: