Code Analysis
- 3 minutes to read
CodeRush Classic 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 Classic 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 | ![]() |
Code |
The code is valid, but is unreadable. For instance, a method is too complex. |
Gray | ![]() |
Dead |
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 |
---|---|
![]() |
Code |
![]() |
Code |
You can enable or disable Code Issues from the Code Issues options page or from the CodeRush Classic tool bar.
See the Code Issues topic for the complete list of available code issues.
Note
This product is designed for outdated versions of Visual Studio. Although Visual Studio 2015 is supported, consider using the Code