Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Collapse]CodeRush Classic
  What's New
 [Expand]System Requirements
 [Collapse]Concepts
  [Collapse]Code Analysis
   [Expand]Code Issues
    DDC - Duplicate Detection and Consolidation
  [Expand]Code Style
   Feature Advisor
   FrictionFree Mode
   Mastering CodeRush Features
  [Expand]Visualization Tools
  [Expand]Navigation
  [Expand]Advanced Selection Tools
  [Expand]Clipboard Tools
  [Expand]Coding Assistance
   Unit Test Runner
 [Expand]Visual Elements
 [Expand]Tool Windows
 [Expand]CodeRush Options
 [Expand]Examples
  Get More Help
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Code Analysis

CodeRush provides a powerful code analysis tool. It finds issues in your code and marks them with indicators to the left of the appropriate line and to the right of the vertical scroll bar. Hint, Warning and Error issues are underlined with colored wavy lines as well. Dead Code issues are colored gray. Click the appropriate right-spaced indicator to move the cursor to an issue, even if it is beyond the editor's bounds.

The information on each issue is contained in an appropriate Code Fix hint. This hint is shown when you place the mouse pointer over the underlined code or over the appropriate indicator (see animation).

You can view all issues found in you solution in a single window. Choose DevExpress|CodeRush|Tool Windows|Code Issues to open the Code Issues tool window.

Note

To show all issues of the entire solution, the Enable solution wide analysis option on the Code Issues options page should be enabled. Otherwise, the tool window shows only code issues contained in the current file.

If a code provider or a refactoring can be used to eliminate an issue, CodeRush enables you to do it with a single click.

Code issues are marked with different colors. Each color corresponds to a certain issue type. The following issue types are available.

Color Icon Name Description
Blue Hint The code is valid, but can be improved slightly. For instance, a variable initialization that can be moved to the declaration.
Orange Warning The code is valid, but is useless. For instance, it contains an unimplemented class member.
Red Error The code is invalid. For instance, it contains a call to an undeclared method.
Green CodeSmell The code is valid, but is unreadable. For instance, a method is too complex.
Gray DeadCode Unused code. For instance, it contains a declared variable whose value is never returned.
Purple Duplicate Code The solution contains several similar code blocks that can be consolidated into a single method.

The Document Status Indicator is situated in the right-top corner of the editor. It shows whether the current file contains issues. Here are the various ways the indicator may look.

Icon Description
The current document does not contain Hint, Warning, or Error issues.
The current file contains Hint issues.
The current file contains Hint and Warning issues.
The current file contains Hint, Warning and Error issues.

If a background duplicate code search is enabled, one of the following duplicate code icons is shown in the right-bottom corner of the code editor.

Icon Description
CodeRush has found duplicate code in the current solution.
CodeRush has not found duplicates.

You can enable or disable Code Issues from the Code Issues options page or from the CodeRush tool bar.

See the Code Issues topic for the complete list of available code issues.

How would you rate this topic?​​​​​​​