ReSharper Web Help

Code Analysis features are available in: ReSharper Full Edition and ReSharper C# Edition

Where ReSharper executes its own code inspections (as opposed to compiler errors and warnings), you can specify whether to display them as errors , warnings , suggestions , hints , or not to display at all.

 Note

Compiler errors and warnings that ReSharper highlights are not configurable the way that ReSharper's own inspections are. However, with some compiler warnings, you can use #pragma directives to suppress them. Look for this action in the list of ReSharper's quick-fixes upon a specific warning.

That is, you can get rid of inspections that seem trivial or being of no interest, using code inspection severity options.

For example, you can force ReSharper to display warnings as errors or suggestions, or even not show them at all. In a similar way, what is initially considered a suggestion can be displayed as a warning or error, or be hidden.

One way of dealing with ReSharper inspections is to navigate between them in a specific file, and take actions upon them. However, there's an alternative way: you can display the list of all inspections discovered in a folder, project, or even in your whole solution using the Inspections Results tool window. You can additionally filter which inspections to display in this tool window, and navigate to them. See Viewing Inspection Results in a Project Or Solution for details.

Another good thing is that you can define you own inspections based on structural search and replace patterns, and specify severity level for them. For more information, see Structural Search and Replace .

To fine-tune how potential errors, code redundancies or bad practices are displayed
  1. On the main menu, choose ReSharper | Options.
  2. Select Code Inspection | Settings.
  3. Make sure that Enable code analysis is selected.
  4. Open the Code Inspection | Inspection Severity category.
  5. Select an entry in the Inspection Severity tab.
  6. Click the drop-down list to the right of the selected entry, and choose one of five standard display options:
  7. Click OK.

In ReSharper 4 or later, you can access inspection severity options right from the list of quick-fixes.

To modify inspection severity for a specific quick-fix from the Text Editor
  1. Put the caret into a code position where a red or yellow bulb displays to the left of your code.
  2. Press Alt+Enter to open a drop-down list with a quick-fix for which you'd like to change inspection severity.
  3. In the drop-down list, choose Inspection options for [name of quick-fix]:
  4. In the Inspection options for [name of quick-fix] dialog box that appears, change severity of an issue that the quick-fix is intended to fix, by selecting any of the five radio buttons: Error, Warning, Suggestion, Hint, or Do not show:
  5. To change inspection severity for other issues, click Open options, which opens the traditional ReSharper | Options | Code Inspection | Inspection Severity tab. Otherwise, click OK to close the Inspection options for [name of quick-fix] dialog box.

See Also

Procedures

Reference