Mixed types in expressions 
ID | STAT-7 |
Title | Do not mix operand or operator types in an expression. |
Priority | Strongly recommended |
Severity level | 4 |
Description | Do not mix operand or operator types in an expression. For example, do not mix logical and numerical operators in an expression. |
Rationale | Mixing operand or operator types in expressions can cause unexpected results and may lead to errors in case of true incompatibilities. |
Avoid:
d = a * b && c;
Instead use:
isValid = a * b > 0;
d = isValid && c;