Code Issues Window
- 3 minutes to read
The Code Issues window allows you to analyze a solution, active project or active document.
To analyze a current solution, perform the following actions:
Invoke the Code Issues window.
Open the CodeRush menu and choose the Code Analysis | Code Issues menu item.
Use the Mode Selector drop-down menu to choose the static code analysis mode.
The Code Issues window supports the following operation modes:
Run CodeRush Diagnostics - uses the Analyzers Library to analyze code.
Load from Visual Studio - performs the Visual Studio built-in code analysis.
Click Refresh to analyze your code or open the CodeRush menu and choose the Code Analysis | Analyze Solution menu item.
If you do not need to find all code issues in the solution, you can run static code analysis for the active project or file only. This gives the following benefits:
Code issues from other projects are excluded from analysis.
The code analysis time is decreased.
To run static code analysis for the active project or file:
Open the CodeRush menu and choose the Code Analysis | Analyze Active Project or Analyze Active Document menu item.
You can also choose the Scope analysis of an active project or Scope analysis of an active document mode in the Code Issues window and click Refresh.
When you select an issue in the code issues list, CodeRush makes the following actions:
- Highlights the code elements which can cause the issue in the Code Issues window’s preview.
- Moves the caret to the corresponding declaration in the code editor.
Filter Code Issues
Filter Code Issues by Analyzer Id
Perform one of the following actions to filter issues found in the code:
Enter the analyzer Id in the Code Issues window’s search box (for example, CRR0048).
Specify a filter condition in the Filter Editor:
Click the Show filter editor toolbar button to open the Filter Editor.
Click the drop-down button and choose the Add Condition item.
Enter the analyzer Id value in the “enter a value” field and click OK.
CodeRush filters code issues based on the specified criteria.
Filter by Code Issue Type
Use Show Errors, Show Warnings, and Show Messages toolbar buttons to filter code issues by the required code issue type.
The image below shows the code issues filtered by errors.
Choose Code Issues Window Layout
You can set the Code Issues window to one of the following layout modes:
Landscape layout - CodeRush shows the code preview on the right.
Portrait layout - CodeRush shows the code preview below.
Code Issues only - CodeRush does not show the code preview.
The following image shows the Code Issues window set to portrait layout.
Code Issues Grouping
CodeRush allows you to group code issues by projects, folders, files, namespaces, types, and/or members.
The image below shows code issues grouped by folders and files.
Export Code Issues Report
CodeRush can export a code issue report to plain text or an XML file.
Click the Export drop-down button and choose Export to XML… or Export to Text… item.
In the Save As dialog, specify a file name and click Save.