Skip to main content

Code Issues Window

  • 3 minutes to read

The Code Issues window allows you to analyze a solution, active project or active document.

CodeIssues_main

To analyze a current solution, perform the following actions:

  1. Invoke the Code Issues window.

    Open the CodeRush menu and choose the Code Analysis | Code Issues menu item.

    CodeIssues_main

  2. Use the Mode Selector drop-down menu to choose the static code analysis mode.

    CodeIssues_main

    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.

  3. Click Refresh to analyze your code or open the CodeRush menu and choose the Code Analysis | Analyze Solution menu item.

    CodeIssues_main

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.

CodeIssues_main

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.

Scope

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.

Sync

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).

CodeIssuesSearch

Specify a filter condition in the Filter Editor:

  1. Click the Show filter editor toolbar button to open the Filter Editor.

    FilterEditor

  2. Click the drop-down button and choose the Add Condition item.

    AddCondition

  3. Enter the analyzer Id value in the “enter a value” field and click OK.

    EnterId

    CodeRush filters code issues based on the specified criteria.

    Filtered

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.

Filtered

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.

Filtered

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.

CodeIssuesCatalog

Export Code Issues Report

CodeRush can export a code issue report to plain text or an XML file.

  1. Click the Export drop-down button and choose Export to XML… or Export to Text… item.

    Export

  2. In the Save As dialog, specify a file name and click Save.

    Save

See Also