Merge pull request #246 from github/aibaars/tweaks

Add an example snippet query
This commit is contained in:
Arthur Baars
2021-08-17 12:42:02 +02:00
committed by GitHub

View File

@@ -0,0 +1,18 @@
/**
* @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