Files
codeql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql
2018-08-02 17:53:23 +01:00

19 lines
570 B
Plaintext

/**
* @name Unclear comparison precedence
* @description Using comparisons as operands of other comparisons is unusual
* in itself, and most readers will require parentheses to be sure
* of the precedence.
* @kind problem
* @problem.severity warning
* @precision very-high
* @id cpp/comparison-precedence
* @tags maintainability
* readability
*/
import cpp
from ComparisonOperation co, ComparisonOperation chco
where co.getAChild() = chco and not chco.isParenthesised()
select co, "Check the comparison operator precedence."