We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50cfd9c commit 9b877dcCopy full SHA for 9b877dc
ql/examples/snippets/emptythen.ql
@@ -0,0 +1,18 @@
1
+/**
2
+ * @name If statements with empty then branch
3
+ * @description Finds 'if' statements where the 'then' branch is
4
+ * an empty block statement
5
+ * @id ruby/examples/emptythen
6
+ * @tags if
7
+ * then
8
+ * empty
9
+ * conditional
10
+ * branch
11
+ * statement
12
+ */
13
+
14
+import ruby
15
16
+from IfExpr i
17
+where not exists(i.getThen().getAChild())
18
+select i
0 commit comments