CodeRush

Background Code Analysis

CodeRush ships with a powerful code analysis tool. It finds issues in your code, underlines them with wavy lines and puts indicators to the left of corresponding code lines. All issues are also indicated within the vertical scroll bar which enables you to estimate the total count of issues in the current file.

Code Issues - CodeRush by DevExpress

To view an issue details, just place the mouse pointer over the underlined code or over an issue marker. CodeRush will offer the way to fix the issue in a single click, if the appropriate refactoring or code provider is available.

Code Issue fixes - CodeRush by DevExpress

Solution Wide Analysis

CodeRush also supports Fast Solution-Wide Analysis, which reports code issues found throughout the entire solution in a background thread while you work. The Project File bar at the bottom of the code editor shows you the most critical code issues found within the solution and enables you to navigate to them in a few clicks.

Project File bar - CodeRush by DevExpress

Note that Solution Wide Analysis is disabled by default. To activate it, check the appropriate option on the Editor|Code Analysis|Code Issues option page, as shown on the following screenshot:

Code Issues option page - CodeRush by DevExpress

Code Issues Tool Window

The Code Issues tool window enables you to see all the code issues in one place. This window lists code issues contained in the current file, project, or solution. The tool window also shows the details of each issue, and takes you to the issue in the editor with a double-click.

Code Issues window - CodeRush by DevExpress

Code Issue types

CodeRush includes issues of several types. Each issue is marked with the appropriate color, depending on its type (see the following table).

TypeDescription
HintThe code is valid, but can be improved. For instance, a variable initialization that can be moved to the declaration.
WarningThe code is valid, but is useless. For instance, an unimplemented class member.
ErrorThe code is invalid. For instance, a call to an undeclared method.
Code SmellThe code is valid, but is unreadable. For instance, a method is too complex.
Dead CodeUnused code. For instance, a declared variable whose value is never returned. The dead code is marked with gray font, but is not underlined.

Supported Code Issues

Hint Issues

Can initialize conditionallyCan combine initialization with declarationCan implement base type constructors
Can inline temporary variableDeclaration can be made constantDelegate can be replaced with lambda expression
Environment.NewLine can be usedField can be made read-onlyForEach Action can be called
Implicit variable can be usedInitializer can be usedMember can be static
Nested code can be flattenedNull coalescing operation can be usedPartial class has only single part
Partial method has only single partProperty can be auto-implementedRedundant delegate creation
Redundant sealed modifierRedundant constructorRedundant String.Format call
Redundant ToString callString.Compare can be usedString.Format can be used
Ternary expression can be usedType can be moved to separate fileType name does not correspond to file name

JavaScript Specific Hint Issues

Assignment to global variableDuplicate local declarationDuplicate property declaration
Hides declaration from the outer scopeRedundant use of "this" qualifier in the global contextSuspicious use of the Equal To operator
Suspicious use of the Unequal To operatorSuspicious use of "this" qualifierPossibly unassigned variable usage
Statement is not terminated

Dead Code Issues

Can remove type qualifierEmpty case statementEmpty event handler
Empty namespace declarationRedundant base constructor callRedundant base qualifier
Redundant destructorRedundant else statementRedundant field initialization
Redundant finally blockLambda parameter has redundant type specificationRedundant namespace reference
Redundant private setterRedundant this qualifierRedundant type qualifier
Unused memberUnused variableUnused setter
Unused type parameter

Warning Issues

Case statements do not explicitly handle all enum valuesCan declare MVC viewCatch block is empty
Class should implement IDisposableDefault branch is missingFields should be disposed
Member is not implementedUndisposed localVirtual member call in constructor

Error Issues

Abstract member cannot be declared in nonabstract classAbstract member cannot be privateAbstract member cannot be marked as sealed
Abstract member cannot be marked as virtualAbstract member cannot declare a bodyAnonymous method cannot have 'params' parameter
Array elements cannot be of static typeBase type constructors are not implementedCannot create an instance of abstract class
Cannot create an instance of interfaceCannot create an instance of static classCannot declare instance member in a static class
Cannot declare variable of static typeCannot inherit from sealed typeCannot inherit from special class 'System.ValueType'
Cannot inherit from static classCannot override inherited sealed memberCannot yield in the body of a catch clause
Cannot yield in the body of a finally clauseCannot yield in the body of a try block with a catch clauseConstant cannot be marked static
Constructor cannot call itselfConstructor must declare a bodyControl cannot leave the body of a finally clause
Delegate cannot be marked staticDestructor must declare a bodyInterface events cannot have add or remove accessors
Extension method cannot have a parameter array used with 'this' modifierExtension methods cannot extend System.TypeExtension method must be defined in a non-generic static class
Extension method must be defined in a top level static classExtern member cannot declare a bodyFormat item index too large
Generic class cannot derive from AttributeIndexer cannot be staticInterface cannot contain constructors
Interface member cannot have a definitionInterface expectedKeyword "base" is not valid in a static member
Keyword this/Me is not valid in a static memberLambda expression cannot have 'params' parameterMember cannot be sealed because it is not an override
Member must declare a body because it is not marked abstract or externMember names cannot be the same as their enclosing typeMethod must have a return type
Only class types can contain destructorsOperator cannot be abstractOperator cannot have 'params' parameter
Operator must be declared static and publicOperator must declare a bodyOverloaded unary operator takes one parameter
Override member cannot be marked as newOverride member cannot be marked as virtualOverride member cannot change access rights
Parameter modifier 'this' should be the first parameter of extension methodPartial method cannot have access modifiers or the virtual, abstract, override, new, sealed, or extern modifiersPartial method cannot have out parameters
Partial method must be declared within a partial class or partial structProperty cannot have void typeProtected member cannot be declared in struct
Protected member in sealed type will be privateSealed class cannot be abstractStatic class cannot be abstract
Static class cannot be sealedStatic class cannot contain protected memberStatic constructors cannot have access modifiers
Static constructors must be parameterlessStruct cannot contain parameterless constructorThe params parameter must be a single dimensional array
The params parameter must be the last parameter in a formal parameter listTry statement without catch or finallyUndeclared element
Virtual member cannot be privateVirtual member cannot be declared in sealed classVirtual member cannot be declared in structures

Code Smell Issues

Case statement has incorrect range of integers expressionComplex Member

Duplicate Code issues

Duplicate code
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.