Skip to main content

CRR0019 - Expression contains redundant subsets

This analyzer detects logical expressions that can be simplified. For instance, refer to the following example.

if(v == 2 && v != 10) // CRR0019
    return;

In the expression above, the second part (v != 10) is redundant, because it will always be satisfied in case the first part (v == 2) is true.

To fix this issue, use the Simplify Expression refactoring or manually remove the redundant part(s) if the refactoring is not available on your expression.

if(v == 2)
    return;