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
.. |result-col-1| replace::The first column corresponds to the expression ``ifstmt`` and is linked to the location in the source code of the project where ``ifstmt`` occurs.
.. |result-col-1| replace::The first column corresponds to the expression ``ifstmt`` and is linked to the location in the source code of the project where ``ifstmt`` occurs.
Alternatively, you can go straight to the query console by clicking **Query console** (at the top of any page), selecting **Go** from the **Language** drop-down list, then choosing one or more projects to query from those displayed in the **Project** drop-down list.
#. Copy the following query into the text box in the query console:
34
+
#. In the quick query tab, delete ``select ""`` and paste the following query beneath the import statement ``import go``.
43
35
44
36
.. code-block:: ql
45
37
46
-
import go
47
-
48
38
from Method m, Variable recv, Write w, Field f
49
39
where
50
40
recv = m.getReceiver() and
51
41
w.writesField(recv.getARead(), f, _) and
52
42
not recv.getType() instanceof PointerType
53
43
select w, "This update to " + f + " has no effect, because " + recv + " is not a pointer."
54
44
55
-
LGTM checks whether your query compiles and, if all is well, the **Run** button changes to green to indicate that you can go ahead and run the query.
56
-
57
-
#. Click **Run**.
58
-
59
-
The name of the project you are querying, and the ID of the most recently analyzed commit to the project, are listed below the query box. To the right of this is an icon that indicates the progress of the query operation:
Your query is always run against the most recently analyzed commit to the selected project.
50
+
If any matching code is found, click a link in the ``w`` column to view it in the code viewer.
69
51
70
-
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 ``w``, which is the location in the source code where the receiver ``recv`` is modified. The second column is the alert message.
An ellipsis (…) at the bottom of the table indicates that the entire list is not displayed—click it to show more results.
79
-
80
-
#. If any matching code is found, click a link in the ``w`` column to view it in the code viewer.
81
-
82
-
The matching ``w`` is highlighted with a yellow background in the code viewer. If any code in the file also matches a query from the standard query library for that language, you will see a red alert message at the appropriate point within the code.
Copy file name to clipboardExpand all lines: docs/codeql/reusables/vs-code-basic-instructions/run-quick-query-2.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,4 @@
4
4
5
5
The query will take a few moments to return results. When the query completes, the results are displayed in a CodeQL Query Results window, alongside the query window.
6
6
7
-
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 |expression| and is linked to the location in the source code of the project where |expression| occurs. The second column is the alert message.
7
+
The query results are listed in two columns, corresponding to the expressions in the ``select`` clause of the query. |result-col-1| The second column is the alert message.
0 commit comments