Finding Code Issues in Specific Scope
Design-time code inspection is a great help when you are coding in the editor or reviewing specific files. However, JetBrains Rider also allows you to run static code analysis in the whole solution or narrower scope and examine the results in a friendly view.
Starting code inspection
To inspect code in solution, project or in a custom scope
Decide whether you want the results of the solution-wide inspections (e.g. unused public members) to be included in the report. If you want these results to be included, enable the solution wide-analysis. Note that when the solution-wide analysis is enabled, JetBrains Rider has to analyze the whole solution even if you need to inspect a single project, so be prepared that it takes more time.
- Do one of the following:
You can also inspect code in the desired scope with a single inspection of your choice — for example, you may want to check whether there are properties that could be converted to auto-properties.
To run a single inspection, press Ctrl+Shift+Alt+I or choose from the main menu, and then start typing the name of the inspection:
In the Solution Explorer, select items (files, folders, projects, solution folders) that you want to inspect, right-click the selection and choose Inspect Code... in the context menu.
In the dialog that opens, specify the scope where the code should be inspected.
The Inspection Results window will open displaying detected code issues.
Analyzing inspection results
In the Inspection Results window, you can view the list of discovered code issues and locate them in the editor by double-clicking the entries:
Each new run of code inspection opens a new tab in the window so the results of previous runs are preserved until you close their tabs.
Optionally, you can turn on AutoScroll to source so that issues are located in the editor as soon as they get focus in the tool window.