Skip to content

Commit 6982522

Browse files
authored
Merge pull request github#3184 from jf205/migration-28
CodeQL docs: update query console link text
2 parents 48a09ce + 1ba7a4d commit 6982522

36 files changed

+148
-148
lines changed

docs/language/learn-ql/beginner/catch-the-fire-starter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Now try applying ``isAllowedIn(string region)`` to a person ``p``. If ``p`` is n
103103

104104
You know that the fire starters live in the south *and* that they must have been able to travel to the north. Write a query to find the possible suspects. You could also extend the ``select`` clause to list the age of the suspects. That way you can clearly see that all the children have been excluded from the list.
105105

106-
➤ `See the answer in the query console <https://lgtm.com/query/2551838470440192723/>`__
106+
➤ `See the answer in the query console on LGTM.com <https://lgtm.com/query/2551838470440192723/>`__
107107

108108
You can now continue to gather more clues and find out which of your suspects started the fire...
109109

@@ -140,7 +140,7 @@ The predicate ``isBald`` is defined to take a ``Person``, so it can also take a
140140

141141
You can now write a query to select the bald southerners who are allowed into the north.
142142

143-
➤ `See the answer in the query console <https://lgtm.com/query/2572701606358725253/>`__
143+
➤ `See the answer in the query console on LGTM.com <https://lgtm.com/query/2572701606358725253/>`__
144144

145145
You have found the two fire starters! They are arrested and the villagers are once again impressed with your work.
146146

docs/language/learn-ql/beginner/cross-the-river.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,15 @@ Here are some more example queries that solve the river crossing puzzle:
251251
#. This query uses a modified ``path`` variable to describe the resulting path in
252252
more detail.
253253

254-
➤ `See solution in the query console <https://lgtm.com/query/659603593702729237/>`__
254+
➤ `See solution in the query console on LGTM.com <https://lgtm.com/query/659603593702729237/>`__
255255

256256
#. This query models the man and the cargo items in a different way, using an
257257
`abstract <https://help.semmle.com/QL/ql-handbook/annotations.html#abstract>`__
258258
class and predicate. It also displays the resulting path in a more visual way.
259259

260-
➤ `See solution in the query console <https://lgtm.com/query/1025323464423811143/>`__
260+
➤ `See solution in the query console on LGTM.com <https://lgtm.com/query/1025323464423811143/>`__
261261

262262
#. This query introduces `algebraic datatypes <https://help.semmle.com/QL/ql-handbook/types.html#algebraic-datatypes>`__
263263
to model the situation, instead of defining everything as a subclass of ``string``.
264264

265-
➤ `See solution in the query console <https://lgtm.com/query/7260748307619718263/>`__
265+
➤ `See solution in the query console on LGTM.com <https://lgtm.com/query/7260748307619718263/>`__

docs/language/learn-ql/beginner/crown-the-rightful-heir.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Here is one way to define ``relativeOf()``:
127127
128128
Don't forget to use the predicate ``isDeceased()`` to find relatives that are still alive.
129129

130-
➤ `See the answer in the query console <https://lgtm.com/query/6710025057257064639/>`__
130+
➤ `See the answer in the query console on LGTM.com <https://lgtm.com/query/6710025057257064639/>`__
131131

132132
Select the true heir
133133
--------------------
@@ -140,7 +140,7 @@ To decide who should inherit the king's fortune, the villagers carefully read th
140140

141141
As your final challenge, define a predicate ``hasCriminalRecord`` so that ``hasCriminalRecord(p)`` holds if ``p`` is any of the criminals you unmasked earlier (in the :doc:`Find the thief <find-the-thief>` and :doc:`Catch the fire starter <catch-the-fire-starter>` tutorials).
142142

143-
➤ `See the answer in the query console <https://lgtm.com/query/1820692755164273290/>`__
143+
➤ `See the answer in the query console on LGTM.com <https://lgtm.com/query/1820692755164273290/>`__
144144

145145
Experimental explorations
146146
-------------------------

docs/language/learn-ql/beginner/find-the-thief.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You start asking some creative questions and making notes of the answers so you
4646

4747
There is too much information to search through by hand, so you decide to use your newly acquired QL skills to help you with your investigation...
4848

49-
#. Open the `query console <https://lgtm.com/query>`__ to get started.
49+
#. Open the `query console on LGTM.com <https://lgtm.com/query>`__ to get started.
5050
#. Select a language and a demo project. For this tutorial, any language and project will do.
5151
#. Delete the default code ``import <language> select "hello world"``.
5252

@@ -205,7 +205,7 @@ Hints
205205
206206
Once you have finished, you will have a list of possible suspects. One of those people must be the thief!
207207

208-
➤ `See the answer in the query console <https://lgtm.com/query/1505743955992/>`__
208+
➤ `See the answer in the query console on LGTM.com <https://lgtm.com/query/1505743955992/>`__
209209

210210
.. pull-quote::
211211

@@ -287,7 +287,7 @@ You can now translate the remaining questions into QL:
287287

288288
Have you found the thief?
289289

290-
➤ `See the answer in the query console <https://lgtm.com/query/1505744186085/>`__
290+
➤ `See the answer in the query console on LGTM.com <https://lgtm.com/query/1505744186085/>`__
291291

292292
What next?
293293
----------

docs/language/learn-ql/cpp/conversions-classes.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Our starting point for the query is pairs of a base class and a derived class, c
163163
where derived.getABaseClass+() = base
164164
select base, derived, "The second class is derived from the first."
165165
166-
➤ `See this in the query console <https://lgtm.com/query/1505902347211/>`__
166+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505902347211/>`__
167167

168168
Note that the transitive closure symbol ``+`` indicates that ``Class.getABaseClass()`` may be followed one or more times, rather than only accepting a direct base class.
169169

@@ -175,7 +175,7 @@ A lot of the results are uninteresting template parameters. You can remove those
175175
and not exists(base.getATemplateArgument())
176176
and not exists(derived.getATemplateArgument())
177177
178-
➤ `See this in the query console <https://lgtm.com/query/1505907047251/>`__
178+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505907047251/>`__
179179

180180
Finding derived classes with destructors
181181
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -194,7 +194,7 @@ Now we can extend the query to find derived classes with destructors, using the
194194
and d2 = derived.getDestructor()
195195
select base, derived, "The second class is derived from the first, and both have a destructor."
196196
197-
➤ `See this in the query console <https://lgtm.com/query/1505901767389/>`__
197+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505901767389/>`__
198198

199199
Notice that getting the destructor implicitly asserts that one exists. As a result, this version of the query returns fewer results than before.
200200

@@ -214,7 +214,7 @@ Our last change is to use ``Function.isVirtual()`` to find cases where the base
214214
and not d1.isVirtual()
215215
select d1, "This destructor should probably be virtual."
216216
217-
➤ `See this in the query console <https://lgtm.com/query/1505908156827/>`__
217+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505908156827/>`__
218218

219219
That completes the query.
220220

@@ -227,4 +227,4 @@ Further reading
227227
- Take a look at the :doc:`Analyzing data flow in C and C++ <dataflow>` tutorial.
228228
- Try the worked examples in the following topics: :doc:`Refining a query to account for edge cases <private-field-initialization>`, and :doc:`Detecting a potential buffer overflow <zero-space-terminator>`.
229229
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
230-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.
230+
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__ on LGTM.com.

docs/language/learn-ql/cpp/dataflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Further reading
300300

301301
- Try the worked examples in the following topics: :doc:`Refining a query to account for edge cases <private-field-initialization>` and :doc:`Detecting a potential buffer overflow <zero-space-terminator>`.
302302
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
303-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.
303+
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__ on LGTM.com.
304304

305305
Answers
306306
-------

docs/language/learn-ql/cpp/expressions-types.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In the following example we find instances of ``AssignExpr`` which assign the co
2121
where e.getRValue().getValue().toInt() = 0
2222
select e, "Assigning the value 0 to something."
2323
24-
➤ `See this in the query console <https://lgtm.com/query/1505908086530/>`__
24+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505908086530/>`__
2525

2626
The ``where`` clause in this example gets the expression on the right side of the assignment, ``getRValue()``, and compares it with zero. Notice that there are no checks to make sure that the right side of the assignment is an integer or that it has a value (that is, it is compile-time constant, rather than a variable). For expressions where either of these assumptions is wrong, the associated predicate simply does not return anything and the ``where`` clause will not produce a result. You could think of it as if there is an implicit ``exists(e.getRValue().getValue().toInt())`` at the beginning of this line.
2727

@@ -47,7 +47,7 @@ We can make the query more specific by defining a condition for the left side of
4747
and e.getLValue().getType().getUnspecifiedType() instanceof IntegralType
4848
select e, "Assigning the value 0 to an integer."
4949
50-
➤ `See this in the query console <https://lgtm.com/query/1505906986578/>`__
50+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505906986578/>`__
5151

5252
This checks that the left side of the assignment has a type that is some kind of integer. Note the call to ``Type.getUnspecifiedType()``. This resolves ``typedef`` types to their underlying types so that the query finds assignments like this one:
5353

@@ -107,7 +107,7 @@ Unfortunately this would not quite work, because the loop initialization is actu
107107
and e.getLValue().getType().getUnspecifiedType() instanceof IntegralType
108108
select e, "Assigning the value 0 to an integer, inside a for loop initialization."
109109
110-
➤ `See this in the query console <https://lgtm.com/query/1505909016965/>`__
110+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505909016965/>`__
111111

112112
Finding assignments of 0 within the loop body
113113
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -125,7 +125,7 @@ We can find assignments inside the loop body using similar code with the predica
125125
and e.getLValue().getType().getUnderlyingType() instanceof IntegralType
126126
select e, "Assigning the value 0 to an integer, inside a for loop body."
127127
128-
➤ `See this in the query console <https://lgtm.com/query/1505901437190/>`__
128+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505901437190/>`__
129129

130130
Note that we replaced ``e.getEnclosingStmt()`` with ``e.getEnclosingStmt().getParentStmt*()``, to find an assignment expression that is deeply nested inside the loop body. The transitive closure modifier ``*`` here indicates that ``Stmt.getParentStmt()`` may be followed zero or more times, rather than just once, giving us the statement, its parent statement, its parent's parent statement etc.
131131

@@ -135,4 +135,4 @@ Further reading
135135
- Explore other ways of finding types and statements using examples from the C/C++ cookbook for `types <https://help.semmle.com/wiki/label/CBCPP/type>`__ and `statements <https://help.semmle.com/wiki/label/CBCPP/statement>`__.
136136
- Take a look at the :doc:`Conversions and classes in C and C++ <conversions-classes>` and :doc:`Analyzing data flow in C and C++ <dataflow>` tutorials.
137137
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
138-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.
138+
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__ on LGTM.com.

docs/language/learn-ql/cpp/function-classes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ It might be more interesting to find functions that are not called, using the st
3838
where not exists(FunctionCall fc | fc.getTarget() = f)
3939
select f, "This function is never called."
4040
41-
➤ `See this in the query console <https://lgtm.com/query/1505891246456/>`__
41+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505891246456/>`__
4242

4343
The new query finds functions that are not the target of any ``FunctionCall``—in other words, functions that are never called. You may be surprised by how many results the query finds. However, if you examine the results, you can see that many of the functions it finds are used indirectly. To create a query that finds only unused functions, we need to refine the query and exclude other ways of using a function.
4444

@@ -56,7 +56,7 @@ You can modify the query to remove functions where a function pointer is used to
5656
and not exists(FunctionAccess fa | fa.getTarget() = f)
5757
select f, "This function is never called, or referenced with a function pointer."
5858
59-
➤ `See this in the query console <https://lgtm.com/query/1505890446605/>`__
59+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505890446605/>`__
6060

6161
This query returns fewer results. However, if you examine the results then you can probably still find potential refinements.
6262

@@ -78,7 +78,7 @@ This query uses ``Function`` and ``FunctionCall`` to find calls to the function
7878
and not fc.getArgument(1) instanceof StringLiteral
7979
select fc, "sprintf called with variable format string."
8080
81-
➤ `See this in the query console <https://lgtm.com/query/1505889506751/>`__
81+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505889506751/>`__
8282

8383
This uses:
8484

@@ -95,4 +95,4 @@ Further reading
9595
- Explore other ways of finding functions using examples from the `C/C++ cookbook <https://help.semmle.com/wiki/label/CBCPP/function>`__.
9696
- Take a look at some other tutorials: :doc:`Expressions, types and statements in C and C++ <introduce-libraries-cpp>`, :doc:`Conversions and classes in C and C++ <conversions-classes>`, and :doc:`Analyzing data flow in C and C++ <dataflow>`.
9797
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
98-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.
98+
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__ on LGTM.com.

docs/language/learn-ql/cpp/introduce-libraries-cpp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,4 @@ Further reading
525525

526526
- Experiment with the worked examples in the CodeQL for C/C++ topics: :doc:`Functions in C and C++ <function-classes>`, :doc:`Expressions, types, and statements in C and C++ <expressions-types>`, :doc:`Conversions and classes in C and C++ <conversions-classes>`, and :doc:`Analyzing data flow in C and C++ <dataflow>`.
527527
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
528-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.
528+
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__ on LGTM.com.

docs/language/learn-ql/cpp/private-field-initialization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ Finally we can simplify the query by using the transitive closure operator. In t
144144
and exists(c.getBlock())
145145
select c, "Constructor does not initialize fields $@.", f, f.getName()
146146
147-
➤ `See this in the query console <https://lgtm.com/query/1505896968215/>`__
147+
➤ `See this in the query console on LGTM.com <https://lgtm.com/query/1505896968215/>`__
148148

149149
Further reading
150150
---------------
151151

152152
- Take a look at another example: :doc:`Detecting a potential buffer overflow <zero-space-terminator>`.
153153
- Find out more about QL in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__ and `QL language specification <https://help.semmle.com/QL/ql-spec/language.html>`__.
154-
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__.
154+
- Learn more about the query console in `Using the query console <https://lgtm.com/help/lgtm/using-query-console>`__ on LGTM.com.

0 commit comments

Comments
 (0)