You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/codeql-language-guides/basic-query-for-java-code.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Running the query
37
37
38
38
import java
39
39
40
-
from IfStmt ifstmt, Block block
40
+
from IfStmt ifstmt, BlockStmt block
41
41
where ifstmt.getThen() = block and
42
42
block.getNumStmt() = 0
43
43
select ifstmt, "This 'if' statement is redundant."
@@ -59,7 +59,7 @@ Running the query
59
59
60
60
The query will take a few moments to return results. When the query completes, the results are displayed below the project name. The query results are listed in two columns, corresponding to the two expressions in the ``select`` clause of the query. The first column corresponds to the expression ``ifstmt`` and is linked to the location in the source code of the project where ``ifstmt`` occurs. The second column is the alert message.
| ``where ifstmt.getThen() = block and block.getNumStmt() = 0`` | Defines a condition on the variables. | ``ifstmt.getThen() = block`` relates the two variables. The block must be the ``then`` branch of the ``if`` statement. |
90
90
||||
@@ -138,7 +138,7 @@ To exclude ``if`` statements that have an ``else`` branch:
138
138
139
139
There are now fewer results because ``if`` statements with an ``else`` branch are no longer included.
140
140
141
-
➤ `See this in the query console <https://lgtm.com/query/6382189874776576029/>`__
141
+
➤ `See this in the query console <https://lgtm.com/query/2005778170075484819/>`__
0 commit comments