identical-if-branches |
The branches of the 'if' statement are identical. Remove the 'if' if it is on purpose, or change the branches if not.
|
Emitted when all branches of an ‘if’ statement contain identical code. |
identical-if-branches-part |
Identical code inside all if's branches, move %d lines %s the if.
|
Emitted when identical code starts or ends all branches of an if statement. |
identical-seq-ifs |
Identical code inside %d consecutive ifs, join their conditions using 'or'.
|
Emitted when several consecutive if statements have identical bodies and thus can be joined by or in their conditions. |
similar-block-to-function |
There are %d repetitions of %d similar statements, starting on lines %s. Extract them to a helper function.
|
Emitted when similar blocks can be deduplicated using a helper function. |
similar-block-to-loop-range |
There are %d repetitions of %d similar statements, which can be simplified using a loop. Consider iterating over '%s'.
|
Emitted when similar sequential blocks can be deduplicated using a loop. |
similar-block-to-loop-collection |
There are %d repetitions of %d similar statements, which can be simplified using a loop. Consider iterating over '%s'.
|
Emitted when similar sequential blocks can be deduplicated using a loop. |
similar-block-to-loop-merge |
The body of the loop contains duplicate blocks, starting on lines %s. Avoid the duplication by repeating the outer loop %s times.
|
Emitted when the body can be simplified using a loop and the extra iterations can be performed by iterating the outer loop more times. |
similar-block-to-call |
Call the existing function '%s' instead of repeating its body.
|
Emitted when a block can be replaced by a call to an existing function. |
similar-if-to-use |
Consider using condition directly instead of literals 'True'/'False', if the if's body has no effect on the condition's value.
|
Emitted when the two branches of an ‘if’ statement differ only in True/False, so the if’s condition can be used directly. |
similar-if-into-block |
The branches of the 'if' statement are similar. Move the 'if' into the branches, so that it only contains lines %s, but only if the if's body has no effect on the condition's value.
|
Emitted when an ‘if’ statement wraps too long part of a block (similar to identical-if-branches-part, but this one can suggest moving if into a for loop, for example). |
similar-if-to-untwisted |
The branches of the 'if' statement are similar. Use condition '%s' to avoid the duplication.
|
Emitted when an ‘if’ statement has an if statement in each branch and the nested statements have the same branches, only swapped. |
similar-if-to-expr |
The branches of the 'if' statement are similar. Use if expression to decide between the different values (i.e., "%s"), but only if the if's body has no effect on the condition's value.
|
Emitted when the duplication between if statement’s branches can be avoided using the if expression. |
similar-if-to-extracted |
The branches of the 'if' statement are similar. Use helper variables to store the values that differ between the branches, or create a helper function.
|
Emitted when the duplication between if statement’s branches can be avoided using helper variables or functions. |