mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
19 lines
372 B
Plaintext
19 lines
372 B
Plaintext
/**
|
|
* @id cpp/examples/eq-true
|
|
* @name Equality test on boolean
|
|
* @description Finds tests like `==true`, `!=true`
|
|
* @tags equal
|
|
* comparison
|
|
* test
|
|
* boolean
|
|
*/
|
|
|
|
import cpp
|
|
|
|
from EqualityOperation eq, Expr trueExpr
|
|
where
|
|
trueExpr = eq.getAnOperand() and
|
|
trueExpr.getType() instanceof BoolType and
|
|
trueExpr.getValue().toInt() = 1
|
|
select eq
|