Files
codeql/javascript/ql/examples/snippets/emptythen.ql
2019-08-02 15:33:40 +02:00

18 lines
357 B
Plaintext

/**
* @id js/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 javascript
from IfStmt i
where i.getThen().(BlockStmt).getNumStmt() = 0
select i