Skip to content

Commit 1d4978a

Browse files
authored
Merge pull request #4046 from jf205/link-quotes-learn-ql
Learning CodeQL docs: update links to match GitHub docs style
2 parents 4a07bd5 + 5fed92b commit 1d4978a

27 files changed

+98
-89
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ To decide who should inherit the king's fortune, the villagers carefully read th
138138

139139
*"The heir to the throne is the closest living relative of the king. Any person with a criminal record will not be considered. If there are multiple candidates, the oldest person is the heir."*
140140

141-
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).
141+
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

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

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can use data flow analysis to track the flow of potentially malicious or ins
66
About data flow
77
---------------
88

9-
Data flow analysis computes the possible values that a variable can hold at various points in a program, determining how those values propagate through the program, and where they are used. In CodeQL, you can model both local data flow and global data flow. For a more general introduction to modeling data flow, see :doc:`About data flow analysis <../intro-to-data-flow>`.
9+
Data flow analysis computes the possible values that a variable can hold at various points in a program, determining how those values propagate through the program, and where they are used. In CodeQL, you can model both local data flow and global data flow. For a more general introduction to modeling data flow, see ":doc:`About data flow analysis <../intro-to-data-flow>`."
1010

1111
Local data flow
1212
---------------
@@ -390,7 +390,8 @@ Exercise 4
390390
Further reading
391391
---------------
392392

393-
- `Exploring data flow with path queries <https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-paths.html>`__
393+
- "`Exploring data flow with path queries <https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-paths.html>`__"
394+
394395

395396
.. include:: ../../reusables/cpp-further-reading.rst
396397
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can improve the results generated by a CodeQL query by adding conditions to
66
Overview
77
--------
88

9-
This topic describes how a C++ query was developed. The example introduces recursive predicates and demonstrates the typical workflow used to refine a query. For a full overview of the topics available for learning to write queries for C/C++ code, see :doc:`CodeQL for C and C++ <ql-for-cpp>`.
9+
This topic describes how a C++ query was developed. The example introduces recursive predicates and demonstrates the typical workflow used to refine a query. For a full overview of the topics available for learning to write queries for C/C++ code, see ":doc:`CodeQL for C and C++ <ql-for-cpp>`."
1010

1111
Finding every private field and checking for initialization
1212
-----------------------------------------------------------
@@ -102,7 +102,7 @@ You may also wish to consider methods called by constructors that assign to the
102102
int m_value;
103103
};
104104
105-
This case can be excluded by creating a recursive predicate. The recursive predicate is given a function and a field, then checks whether the function assigns to the field. The predicate runs itself on all the functions called by the function that it has been given. By passing the constructor to this predicate, we can check for assignments of a field in all functions called by the constructor, and then do the same for all functions called by those functions all the way down the tree of function calls. For more information, see `Recursion <https://help.semmle.com/QL/ql-handbook/recursion.html>`__ in the QL language reference.
105+
This case can be excluded by creating a recursive predicate. The recursive predicate is given a function and a field, then checks whether the function assigns to the field. The predicate runs itself on all the functions called by the function that it has been given. By passing the constructor to this predicate, we can check for assignments of a field in all functions called by the constructor, and then do the same for all functions called by those functions all the way down the tree of function calls. For more information, see "`Recursion <https://help.semmle.com/QL/ql-handbook/recursion.html>`__" in the QL language reference.
106106

107107
.. code-block:: ql
108108
@@ -126,7 +126,7 @@ This case can be excluded by creating a recursive predicate. The recursive predi
126126
Refinement 4—simplifying the query
127127
----------------------------------
128128

129-
Finally we can simplify the query by using the transitive closure operator. In this final version of the query, ``c.calls*(fun)`` resolves to the set of all functions that are ``c`` itself, are called by ``c``, are called by a function that is called by ``c``, and so on. This eliminates the need to make a new predicate all together. For more information, see `Transitive closures <https://help.semmle.com/QL/ql-handbook/recursion.html#transitive-closures>`__ in the QL language reference.
129+
Finally we can simplify the query by using the transitive closure operator. In this final version of the query, ``c.calls*(fun)`` resolves to the set of all functions that are ``c`` itself, are called by ``c``, are called by a function that is called by ``c``, and so on. This eliminates the need to make a new predicate all together. For more information, see "`Transitive closures <https://help.semmle.com/QL/ql-handbook/recursion.html#transitive-closures>`__" in the QL language reference.
130130

131131
.. code-block:: ql
132132

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ About this article
88

99
This article describes how data flow analysis is implemented in the CodeQL libraries for C# and includes examples to help you write your own data flow queries.
1010
The following sections describe how to use the libraries for local data flow, global data flow, and taint tracking.
11-
For a more general introduction to modeling data flow, see :doc:`About data flow analysis <../intro-to-data-flow>`.
11+
For a more general introduction to modeling data flow, see ":doc:`About data flow analysis <../intro-to-data-flow>`."
1212

1313
Local data flow
1414
---------------
@@ -553,7 +553,8 @@ This can be adapted from the ``SystemUriFlow`` class:
553553
Further reading
554554
---------------
555555

556-
- `Exploring data flow with path queries <https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-paths.html>`__
556+
- "`Exploring data flow with path queries <https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-paths.html>`__"
557+
557558

558559
.. include:: ../../reusables/csharp-further-reading.rst
559560
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ There is an extensive core library for analyzing CodeQL databases extracted from
1414
1515
Since this is required for all C# queries, it's omitted from code snippets below.
1616

17-
The core library contains all the program elements, including `files <#files>`__, `types <#types>`__, methods, `variables <#variables>`__, `statements <#statements>`__, and `expressions <#expressions>`__. This is sufficient for most queries, however additional libraries can be imported for bespoke functionality such as control flow and data flow. For information about these additional libraries, see :doc:`CodeQL for C# <ql-for-csharp>`.
17+
The core library contains all the program elements, including `files <#files>`__, `types <#types>`__, methods, `variables <#variables>`__, `statements <#statements>`__, and `expressions <#expressions>`__. This is sufficient for most queries, however additional libraries can be imported for bespoke functionality such as control flow and data flow. For information about these additional libraries, see ":doc:`CodeQL for C# <ql-for-csharp>`."
1818

1919
Class hierarchies
2020
~~~~~~~~~~~~~~~~~

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ taint, you can define a subclass of ``TaintTracking::Configuration``, which work
502502
data-flow configurations.
503503

504504
A detailed exposition of global data flow and taint tracking is out of scope for this brief
505-
introduction. For a general overview of data flow and taint tracking, see `About data flow analysis <https://help.semmle.com/QL/learn-ql/intro-to-data-flow.html>`__.
505+
introduction. For a general overview of data flow and taint tracking, see "`About data flow analysis <https://help.semmle.com/QL/learn-ql/intro-to-data-flow.html>`__."
506506

507507
Advanced libraries
508508
------------------

docs/language/learn-ql/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CodeQL is based on a powerful query language called QL. The following topics hel
1313

1414
Important
1515

16-
If you've previously used QL, you may notice slight changes in terms we use to describe some important concepts. For more information, see our note about :doc:`Recent terminology changes <terminology-note>`.
16+
If you've previously used QL, you may notice slight changes in terms we use to describe some important concepts. For more information, see our note about ":doc:`Recent terminology changes <terminology-note>`."
1717

1818
.. toctree::
1919
:maxdepth: 1

docs/language/learn-ql/intro-to-data-flow.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ The following sections provide a brief introduction to data flow analysis with C
1414

1515
See the following tutorials for more information about analyzing data flow in specific languages:
1616

17-
- :doc:`Analyzing data flow in C/C++ <cpp/dataflow>`
18-
- :doc:`Analyzing data flow in C# <csharp/dataflow>`
19-
- :doc:`Analyzing data flow in Java <java/dataflow>`
20-
- :doc:`Analyzing data flow in JavaScript/TypeScript <javascript/dataflow>`
21-
- :doc:`Analyzing data flow and tracking tainted data in Python <python/taint-tracking>`
17+
- ":doc:`Analyzing data flow in C/C++ <cpp/dataflow>`"
18+
- ":doc:`Analyzing data flow in C# <csharp/dataflow>`"
19+
- ":doc:`Analyzing data flow in Java <java/dataflow>`"
20+
- ":doc:`Analyzing data flow in JavaScript/TypeScript <javascript/dataflow>`"
21+
- ":doc:`Analyzing data flow and tracking tainted data in Python <python/taint-tracking>`"
2222

2323
.. pull-quote::
2424

2525
Note
2626

27-
Data flow analysis is used extensively in path queries. To learn more about path queries, see :doc:`Creating path queries <writing-queries/path-queries>`.
27+
Data flow analysis is used extensively in path queries. To learn more about path queries, see ":doc:`Creating path queries <writing-queries/path-queries>`."
2828

2929
.. _data-flow-graph:
3030

@@ -82,4 +82,5 @@ These flow steps are modeled in the taint-tracking library using predicates that
8282
Further reading
8383
***************
8484

85-
- `Exploring data flow with path queries <https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-paths.html>`__
85+
- "`Exploring data flow with path queries <https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-paths.html>`__"
86+

docs/language/learn-ql/introduction-to-ql.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ To import the CodeQL library for a specific programming language, type ``import
157157
Further reading
158158
---------------
159159

160-
- To find out more about how to write your own queries, try working through the :doc:`QL tutorials <beginner/ql-tutorials>`.
161-
- For an overview of the other available resources, see :doc:`Learning CodeQL <../index>`.
162-
- For a more technical description of the underlying language, see the `QL language reference <https://help.semmle.com/QL/ql-handbook>`__.
160+
- To find out more about how to write your own queries, try working through the ":doc:`QL tutorials <beginner/ql-tutorials>`."
161+
- For an overview of the other available resources, see ":doc:`Learning CodeQL <../index>`."
162+
- For a more technical description of the underlying language, see the "`QL language reference <https://help.semmle.com/QL/ql-handbook>`__."

docs/language/learn-ql/java/annotations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Finally, we use these classes to find calls to deprecated methods, excluding cal
180180
181181
In our example, this query flags the call to ``A.m`` in ``A.r``, but not the one in ``A.n``.
182182

183-
For more information about the class ``Call``, see :doc:`Navigating the call graph <call-graph>`.
183+
For more information about the class ``Call``, see ":doc:`Navigating the call graph <call-graph>`."
184184

185185
Improvements
186186
~~~~~~~~~~~~

0 commit comments

Comments
 (0)