Incorrect Logic¶
Rule ID¶
MI105
Definition¶
The software attempts to execute code which is either logically incorrect or was likely not the original intention of the programmer.
Example¶
See one of the applicable code examples from CWE.
1 2 3 4 5 6 7 8 9 |
|
The condition for the second if statement is impossible to satisfy. It requires that the variables be non-null, while on the only path where s can be assigned a non-null value there is a return statement.