Files
codeql/ruby/ql/examples/snippets/emptythen.ql
2021-10-15 11:47:28 +02:00

19 lines
367 B
Plaintext

/**
* @name If statements with empty then branch
* @description Finds 'if' statements where the 'then' branch is
* an empty block statement
* @id ruby/examples/emptythen
* @tags if
* then
* empty
* conditional
* branch
* statement
*/
import ruby
from IfExpr i
where not exists(i.getThen().getAChild())
select i