Files
codeql/java/ql/examples/snippets/emptythen.ql
2020-09-08 08:40:20 +02:00

18 lines
353 B
Plaintext

/**
* @id java/examples/emptythen
* @name If statements with empty then branch
* @description Finds 'if' statements where the 'then' branch is
* an empty block statement
* @tags if
* then
* empty
* conditional
* branch
*/
import java
from IfStmt i
where i.getThen().(BlockStmt).getNumStmt() = 0
select i