ReSharper Web Help

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

ReSharper executes its code analysis by applying inspections. The list of inspections includes:

  • Compiler errors and warnings.
  • ReSharper's own inspections.

To display the list of ReSharper's own inspections, choose ReSharper | Options | Code Inspection | Inspection Severity.

Every inspection has one of the following four severity levels (see Configuring ReSharper Inspections for guidelines on changing severity levels):

  • Errors. Errors have the highest priority of all - they prevent your code from compiling. When ReSharper detects an error, it highlights it in one of two alternative ways:
    • Displays an unresolved symbol in red:
    • Highlights a construct or part of it with a red curly underline:
    No matter how ReSharper chooses to display an error, you can roll the mouse pointer over the error to display its description as a tooltip (as shown in the picture above) (for details and other ways to know the reason why your code is highlighted, see Finding Out What is Wrong with Your Code ).
  • Warnings. ReSharper provides you with warnings that don't 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. Constructs that have associated warnings are emphasized in one of the following ways:
    • With grayed text:
    • With a blue curly underline:
  • Suggestions. Code suggestions provide insights into code structure, drawing your attention to things that aren't necessarily bad or wrong, but probably useful to know. Suggestions are highlighted with a green curly underline:

    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.
  • Hints. This is the lowest possible severity level. Unlike errors, warnings and suggestions, hints are not taken into account when you navigate to next/previous highlights, not shown in the Marker Bar and therefore do not influence the color of the Status Indicator. A hint simply brings your attention to a particular code detail and recommends a way of improvement. Code items that have associated hints are highlighted with a solid green underline. Move the mouse pointer over a highlighted item to view the corresponding hint in a tooltip:

    Putting the caret at a highlighted item allows you to display the hint in the status bar.

See Also

Procedures

Reference