mirror of
https://github.com/github/codeql.git
synced 2026-03-28 02:08:17 +01:00
19 lines
570 B
Plaintext
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."
|