Add an example snippet query

This commit is contained in:
Arthur Baars
2021-08-04 17:23:24 +02:00
committed by Alex Ford
parent 50cfd9c318
commit 9b877dc6e1

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