ReSharper helps you analyze code on various levels, starting from a single statement in the editor and all the way through to the architecture of your entire solution.
The code inspection is performed at design time by continuously applying over 1300 inspections to your code. By default, ReSharper starts analyzing a code file as soon as you open it in the editor, all the way you edit it, until it is closed. Not only ReSharper highlights code issues right in the editor, it also adds its own marker bar to the right of the editor window, where you can see instantly the status of the file and navigate to code issues. ReSharper also provides commands for navigation between code issues.
For most of the discovered code issues, ReSharper suggests instant corrections with quick-fixes as soon as you set the caret at them.
If necessary, you can run code inspection for a specific project or the entire solution and check the list of issues found in the specified scope.
Also, you can enable the Solution-Wide Analysis that will detect all errors in your entire solution and extend the list of code inspections in the current file (e.g. it will find unused public members).
If needed, you can use Code Annotations to customize the way ReSharper inspects your code.
Another good thing is that you can define you own inspections based on structural search and replace patterns, and specify severity level for them.
ReSharper also provides features that do not detect code issues automatically, but rather allow you to find potential problems yourself by deeper investigation of the code. For instance, you can study call chains and find origin and destinations of a specific value. For more information on these features, see the Code Exploration section.
Project dependency analysis
Some code issues may be discovered by analyzing the solution architecture. ReSharper can help you here with the project dependency analysis that allows you visually explore project dependency graph, find and optimize unused references, and detect possible architecture problems.
Code analysis from command line
If you need to integrate automatic code quality analysis into your CI, version control or any other server, you can use ReSharper Command Line Tools, which are free of charge and do not require ReSharper or Visual Studio to be running. The Command Line Tools package includes two tools: InspectCode, which executes ReSharper's code inspection and dupFinder., which detects duplicated code.
- ReSharper Options | Code Inspection | Inspection Severity
- ReSharper Options | Code Inspection | Settings
- ReSharper Options | Code Inspection | Code Annotations