mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
19 lines
376 B
Plaintext
19 lines
376 B
Plaintext
/**
|
|
* @name If statements with empty then branch
|
|
* @description Finds 'if' statements where the 'then' branch is
|
|
* an empty block statement
|
|
* @id rb/examples/emptythen
|
|
* @tags if
|
|
* then
|
|
* empty
|
|
* conditional
|
|
* branch
|
|
* statement
|
|
*/
|
|
|
|
import codeql.ruby.AST
|
|
|
|
from IfExpr i
|
|
where not exists(i.getThen().getAChild())
|
|
select i
|