Analyzers Library
- 5 minutes to read
The CodeRush Server Analyze task uses CodeRush Code Analyzers library to inspect the source code.
The following table lists the available code analyzers:
ID | Description | C# | VB |
---|---|---|---|
Code Complexity Analysis | |||
CRR0001 | The binary operation for identical sub-expressions may contain a redundant expression. | ![]() |
![]() |
CRR0004 | Both ternary expression branches appear to be identical. | ![]() |
![]() |
CRR0009 | The conditional expression in the if-statement can be combined with the next one. | ![]() |
![]() |
CRR0012 | The logical OR expression has opposite terms. Check both operands to make sure they are expressed as intended. | ![]() |
![]() |
CRR0015 | The logical OR operation in the expression may be redundant. | ![]() |
![]() |
CRR0019 | The expression contains at least one expression that is a logical subset of another. | ![]() |
![]() |
CRR0024 | The number appears to be a low-precision version of a common constant. Consider changing the number to the suggested reference. | ![]() |
![]() |
CRR0047 | The type can be moved to a separate file | ![]() |
![]() |
CRR0049 | Environment. |
![]() |
![]() |
CRR0050 | String. |
![]() |
![]() |
CRR0051 | String. |
![]() |
![]() |
CRR0052 | String interpolation can be used. Convert an expression into string interpolation. | ![]() |
![]() |
Mistake Detection | |||
CRR0002 | The for-loop's condition expression may use an incorrect variable. | ![]() |
|
CRR0003 | The for-loop's iterator section may use an incorrect variable. | ![]() |
|
CRR0006 | The null comparison that follows the typecast may reference an incorrect variable. | ![]() |
![]() |
CRR0007 | The string. |
![]() |
![]() |
CRR0013 | The method's return statements appear to always return the same constant value. | ![]() |
![]() |
CRR0017 | The expression contains a variable that is checked for null after it is referenced. | ![]() |
![]() |
CRR0020 | The divide-by-integral operation internally casts to the integral type and rounding a floating point value may produce unexpected results. | ![]() |
![]() |
CRR0027 | The expression is not checked for null and can cause a System. |
![]() |
![]() |
CRR0028 | This event handler is empty and can be deleted. | ![]() |
![]() |
CRR0040 | The code element exceeds the specified metric threshold. | ![]() |
![]() |
CRR0048 | The type name does not correspond to the file name | ![]() |
![]() |
CRR1000 | The name of the declaration contradicts the existing naming conventions. Use a different name or add a new naming rule. | ![]() |
![]() |
Async/Await | |||
CRR0029 | You should always call the Configure |
![]() |
![]() |
CRR0030 | You can delete the await keyword. | ![]() |
![]() |
CRR0031 | The returned Task should never be null, use Task. |
![]() |
![]() |
CRR0033 | The async method which returns nothing should be in a try/catch block. Otherwise, that method's exceptions may cause a crash. | ![]() |
![]() |
CRR0034 | The async method should contain the "async" suffix | ![]() |
![]() |
CRR0035 | The async method has no Cancellation |
![]() |
![]() |
CRR0036 | The await keyword is not required for the Task. |
![]() |
![]() |
CRR0037 | Use the Task. |
![]() |
![]() |
CRR0038 | You should use the Cancellation |
![]() |
![]() |
CRR0039 | The cancellation token should be passed into the await expression. | ![]() |
![]() |
CRR0041 | You should use the Task. |
![]() |
![]() |
Unused Code Detection | |||
CRR0005 | An expression always resolves to the same value. | ![]() |
![]() |
CRR0008 | Both if statement child blocks appear to be identical. | ![]() |
![]() |
CRR0010 | Precede the instantiation with the throw keyword if you want to throw an exception (so other parts of the program can catch it). | ![]() |
![]() |
CRR0011 | The next if-statement has the same condition as the current one. However, this if-statement breaks the program flow and exits the method block. The next if-statement's body is never reached. | ![]() |
![]() |
CRR0014 | The variable receives two assignments in succession. The first assignment may not be needed. | ![]() |
![]() |
CRR0016 | The method call's return value is not used. This may be unintentional. | ![]() |
![]() |
CRR0018 | The assignment reversal is unusual and may be an attempt to bypass side-effects occurring between two assignment statements. This may also indicate brittle code, which cannot be easily maintained. | ![]() |
![]() |
CRR0021 | Nested if-else conditions are equivalent. The code in the nested if-block may never be reached. | ![]() |
![]() |
CRR0022 | The conditional expression appears to always evaluate to false. You should check the conditionals above for similar expressions that would prevent the current conditional from being evaluated to true. | ![]() |
![]() |
CRR0023 | The conditional expression appears to always evaluate to true. The conditional expressions above are likely to ensure that this conditional never evaluates to false. | ![]() |
![]() |
CRR0025 | The inverse of the current expression appears to be already satisfied in a parent conditional, so this expression likely always resolves to false (rendering its code block is never reached). | ![]() |
![]() |
CRR0026 | The member is never used and can be deleted. | ![]() |
![]() |
CRR0042 | This parameter is never used and can be deleted. | ![]() |
![]() |
CRR0043 | This type is not used and can be deleted. | ![]() |
![]() |
CRR0044 | The local variable is never used and can be deleted. | ![]() |
![]() |
CRR0045 | The local variable is never used and can be replaced with a discard. | ![]() |
![]() |
CRR0046 | Remove the redundant initialization to improve code readability. | ![]() |
![]() |
Spell Check | |||
CRRSP02 | A repeated word has been found. | ![]() |
![]() |
CRRSP03 | A misspelled word has been found in the file name. | ![]() |
![]() |
CRRSP04 | A misspelled word has been found in the XML documentation comment. | ![]() |
![]() |
CRRSP05 | A misspelled word has been found in the comment. | ![]() |
![]() |
CRRSP06 | A misspelled word has been found in the string. | ![]() |
![]() |
CRRSP07 | A misspelled word has been found in the verbatim string. | ![]() |
![]() |
CRRSP08 | A misspelled word has been found in the public identifier. | ![]() |
![]() |
CRRSP09 | A misspelled word has been found in the internal identifier. | ![]() |
![]() |
CRRSP10 | A misspelled word has been found in the protected internal identifier. | ![]() |
![]() |
CRRSP11 | A misspelled word has been found in the protected identifier. | ![]() |
![]() |
CRRSP12 | A misspelled word has been found in the private identifier. | ![]() |
![]() |
CRRSP13 | A misspelled word has been found in the local identifier. | ![]() |
![]() |