Skip to content

Commit 2140a03

Browse files
authored
Merge pull request #4756 from github/folder-restructure
[Docs] Review folder restructure
2 parents 9897a81 + 5002968 commit 2140a03

File tree

95 files changed

+149
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+149
-149
lines changed

docs/codeql/codeql-cli/codeql-cli-reference/about-ql-packs.rst docs/codeql/codeql-cli/about-ql-packs.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ The following properties are supported in ``qlpack.yml`` files.
8585
* - ``suites``
8686
- ``suites``
8787
- Optional
88-
- The path to a directory that contains the "well-known" query suites in the pack, defined relative to the pack directory. You can run "well-known" suites stored in this directory by specifying the pack name, without providing their full path. To use query suites stored in other directories in the pack, you must provide their full path. For more information about query suites, see ":doc:`Creating CodeQL query suites <../using-the-codeql-cli/creating-codeql-query-suites>`."
88+
- The path to a directory that contains the "well-known" query suites in the pack, defined relative to the pack directory. You can run "well-known" suites stored in this directory by specifying the pack name, without providing their full path. To use query suites stored in other directories in the pack, you must provide their full path. For more information about query suites, see ":doc:`Creating CodeQL query suites <creating-codeql-query-suites>`."
8989
* - ``extractor``
9090
- ``javascript``
9191
- All test packs
92-
- The CodeQL language extractor to use when the CLI creates a database from test files in the pack. For more information about testing queries, see ":doc:`Testing custom queries <../using-the-codeql-cli/testing-custom-queries>`."
92+
- The CodeQL language extractor to use when the CLI creates a database from test files in the pack. For more information about testing queries, see ":doc:`Testing custom queries <testing-custom-queries>`."
9393
* - ``tests``
9494
- ``.``
9595
- Optional for test packs
@@ -124,7 +124,7 @@ and ``libraryPathDependencies`` properties. If the pack contains query suites, y
124124
use the ``suites`` property to define their location. Query suites defined
125125
here are called "well-known" suites, and can be used on the command line by referring to
126126
their name only, rather than their full path.
127-
For more information about query suites, see ":doc:`Creating CodeQL query suites <../using-the-codeql-cli/creating-codeql-query-suites>`."
127+
For more information about query suites, see ":doc:`Creating CodeQL query suites <creating-codeql-query-suites>`."
128128

129129
For example, a ``qlpack.yml`` file for a QL pack featuring custom C++ queries
130130
and libraries may contain:
@@ -154,10 +154,10 @@ For custom QL packs containing test files, you also need to include an
154154
``extractor`` property so that the ``test run`` command knows how to create test
155155
databases. You may also wish to specify the ``tests`` property.
156156

157-
.. include:: ../../reusables/test-qlpack.rst
157+
.. include:: ../reusables/test-qlpack.rst
158158

159159
For more information about running tests, see ":doc:`Testing custom queries
160-
<../using-the-codeql-cli/testing-custom-queries>`."
160+
<testing-custom-queries>`."
161161

162162
.. _standard-ql-packs:
163163

docs/codeql/codeql-cli/using-the-codeql-cli/analyzing-databases-with-the-codeql-cli.rst docs/codeql/codeql-cli/analyzing-databases-with-the-codeql-cli.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CodeQL analyses produce :ref:`interpreted results
1111
For information about writing queries to run with ``database analyze``, see
1212
":doc:`Using custom queries with the CodeQL CLI <using-custom-queries-with-the-codeql-cli>`."
1313

14-
.. include:: ../../reusables/advanced-query-execution.rst
14+
.. include:: ../reusables/advanced-query-execution.rst
1515

1616
Before starting an analysis you must:
1717

@@ -55,7 +55,7 @@ You must specify:
5555

5656
You can also specify:
5757

58-
- .. include:: ../../reusables/threads-query-execution.rst
58+
- .. include:: ../reusables/threads-query-execution.rst
5959

6060

6161
.. pull-quote::
@@ -149,7 +149,7 @@ recursively, so any queries contained in subfolders will also be executed.
149149
Important
150150

151151
You shouldn't specify the root of a :doc:`QL pack
152-
<../codeql-cli-reference/about-ql-packs>` when executing ``database analyze``
152+
<about-ql-packs>` when executing ``database analyze``
153153
as it contains some special queries that aren't designed to be used with
154154
the command. Rather, to run a wide range of useful queries, run one of the
155155
LGTM.com query suites.
@@ -171,7 +171,7 @@ You can save analysis results in a number of different formats, including SARIF
171171
and CSV.
172172

173173
The SARIF format is designed to represent the output of a broad range of static
174-
analysis tools. For more information, see :doc:`SARIF output <../codeql-cli-reference/sarif-output>`.
174+
analysis tools. For more information, see :doc:`SARIF output <sarif-output>`.
175175

176176
If you choose to generate results in CSV format, then each line in the output file
177177
corresponds to an alert. Each line is a comma-separated list with the following information:

docs/codeql/codeql-cli/using-the-codeql-cli/creating-codeql-databases.rst docs/codeql/codeql-cli/creating-codeql-databases.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You must specify:
3535
- ``--language``: the identifier for the language to create a database for.
3636
CodeQL supports creating databases for the following languages:
3737

38-
.. include:: ../../reusables/extractors.rst
38+
.. include:: ../reusables/extractors.rst
3939

4040
Other options may be specified depending on the location of your source file and
4141
the language you want to analyze:
@@ -75,7 +75,7 @@ CodeQL. For each project on LGTM.com, you can download an archived CodeQL
7575
database corresponding to the most recently analyzed revision of the code. These
7676
databases can also be analyzed using the CodeQL CLI.
7777

78-
.. include:: ../../reusables/download-lgtm-database.rst
78+
.. include:: ../reusables/download-lgtm-database.rst
7979

8080
Before running an analysis, unzip the databases and try :doc:`upgrading <upgrading-codeql-databases>` the
8181
unzipped databases to ensure they are compatible with your local copy of the
@@ -85,7 +85,7 @@ CodeQL queries and libraries.
8585

8686
Note
8787

88-
.. include:: ../../reusables/index-files-note.rst
88+
.. include:: ../reusables/index-files-note.rst
8989

9090
Creating databases for non-compiled languages
9191
---------------------------------------------

docs/codeql/codeql-cli/using-the-codeql-cli/creating-codeql-query-suites.rst docs/codeql/codeql-cli/creating-codeql-query-suites.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ suite definition have been executed, the result is a set of selected queries.
1919
.. note::
2020

2121
Any custom queries that you want to add to a query suite must be in a :doc:`QL
22-
pack <../codeql-cli-reference/about-ql-packs>` and contain the correct query metadata.
22+
pack <about-ql-packs>` and contain the correct query metadata.
2323
For more information, see
2424
":doc:`Using custom queries with the CodeQL CLI <using-custom-queries-with-the-codeql-cli>`."
2525

@@ -254,7 +254,7 @@ without providing their full path. This gives you a simple way of specifying a
254254
set of queries, without needing to search inside QL packs and distributions.
255255
To declare a directory that contains "well-known" query suites, add the directory
256256
to the ``suites`` property in the ``qlpack.yml`` file at the root of your QL pack.
257-
For more information, see "`About QL packs <../codeql-cli-reference/qlpack-overview.html#qlpack-yml-properties>`__."
257+
For more information, see "`About QL packs <qlpack-overview.html#qlpack-yml-properties>`__."
258258

259259
Using query suites with CodeQL
260260
------------------------------

docs/codeql/codeql-cli/using-the-codeql-cli/getting-started-with-the-codeql-cli.rst docs/codeql/codeql-cli/getting-started-with-the-codeql-cli.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Getting started with the CodeQL CLI
66
To run CodeQL commands, you need to set up the CLI so that it can access
77
the tools, queries, and libraries required to create and analyze databases.
88

9-
.. include:: ../../reusables/license-note.rst
9+
.. include:: ../reusables/license-note.rst
1010

1111
.. _setting-up-cli:
1212

@@ -115,7 +115,7 @@ repository should be ``$HOME/codeql-home/codeql-go``.
115115
Within these repositories, the queries and libraries are organized into QL
116116
packs. Along with the queries themselves, QL packs contain important metadata
117117
that tells the CodeQL CLI how to process the query files. For more information,
118-
see ":doc:`About QL packs <../codeql-cli-reference/about-ql-packs>`."
118+
see ":doc:`About QL packs <about-ql-packs>`."
119119

120120
.. pull-quote:: Important
121121

docs/codeql/codeql-cli/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ CodeQL CLI
1010

1111
- :ref:`CodeQL CLI reference <codeql-cli-reference>`: Learn more about the files you can use when running CodeQL processes and the results format and exit codes that CodeQL generates.
1212

13-
- `CodeQL CLI manual <codeql-cli-manual>`__: Detailed information about all the commands available with the CodeQL CLI.
13+
- `CodeQL CLI manual <../codeql-cli-manual>`__: Detailed information about all the commands available with the CodeQL CLI.
1414

1515
.. toctree::
1616
:titlesonly:
1717
:hidden:
1818

19-
using-the-codeql-cli/index
20-
codeql-cli-reference/index
19+
using-the-codeql-cli
20+
codeql-cli-reference
2121

docs/codeql/codeql-cli/codeql-cli-reference/query-reference-files.rst docs/codeql/codeql-cli/query-reference-files.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ to the ``codeql-javascript`` QL pack::
4444

4545
AngularJS/DeadAngularJSEventListener.ql
4646

47-
For another example, see `Testing custom queries <../using-the-codeql-cli/test-queries.html#example>`__.
47+
For another example, see `Testing custom queries <test-queries.html#example>`__.

docs/codeql/codeql-cli/using-the-codeql-cli/testing-custom-queries.rst docs/codeql/codeql-cli/testing-custom-queries.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ file that defines:
4444
The ``libraryPathDependencies`` value specifies the CodeQL queries to test.
4545
The ``extractor`` defines which language the CLI will use
4646
to create test databases from the code files stored in this QL pack.
47-
For more information, see ":doc:`About QL packs <../codeql-cli-reference/about-ql-packs>`."
47+
For more information, see ":doc:`About QL packs <about-ql-packs>`."
4848

4949
You may find it useful to look at the way query tests are organized in the
5050
`CodeQL repository <https://github.com/github/codeql>`__.
@@ -70,7 +70,7 @@ Then add the following files to the subdirectory before you run the test command
7070
The location is defined relative to the root of the QL pack that contains the
7171
query. Usually, this is a QL pack specified by the
7272
``libraryPathDependencies`` for the test pack.
73-
For more information, see ":doc:`Query reference files <../codeql-cli-reference/query-reference-files>`."
73+
For more information, see ":doc:`Query reference files <query-reference-files>`."
7474

7575
You don't need to add a query reference file if the query you want to
7676
test is stored in the test directory,
@@ -127,7 +127,7 @@ The ``<test|dir>`` argument can be one or more of the following:
127127

128128
You can also specify:
129129

130-
- .. include:: ../../reusables/threads-query-execution.rst
130+
- .. include:: ../reusables/threads-query-execution.rst
131131

132132
For full details of all the options you can use when testing queries,
133133
see the `test run reference documentation <../codeql-cli-manual/test-run.html>`__.
@@ -172,13 +172,13 @@ Prepare a query and test files
172172
libraryPathDependencies: codeql-java
173173
174174
For more information about QL packs, see ":doc:`About QL packs
175-
<../codeql-cli-reference/about-ql-packs>`."
175+
<about-ql-packs>`."
176176

177177
#. Create a QL pack for your Java tests by adding a ``qlpack.yml`` file
178178
with the following contents to ``custom-queries/java/tests``,
179179
updating ``libraryPathDependencies`` to match the name of your QL pack of custom queries:
180180

181-
.. include:: ../../reusables/test-qlpack.rst
181+
.. include:: ../reusables/test-qlpack.rst
182182

183183
#. Within the Java test pack, create a directory to contain the test files
184184
associated with ``EmptyThen.ql``.

docs/codeql/codeql-cli/using-the-codeql-cli/using-custom-queries-with-the-codeql-cli.rst docs/codeql/codeql-cli/using-custom-queries-with-the-codeql-cli.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This topic is specifically about writing
1010
queries to use with the `database analyze <../codeql-cli-manual/database-analyze.html>`__
1111
command to produce :ref:`interpreted results <interpret-query-results>`.
1212

13-
.. include:: ../../reusables/advanced-query-execution.rst
13+
.. include:: ../reusables/advanced-query-execution.rst
1414

1515
Writing a valid query
1616
---------------------

docs/codeql/codeql-cli/using-the-codeql-cli/index.rst docs/codeql/codeql-cli/using-the-codeql-cli.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Using the CodeQL CLI
44
====================
55

6-
.. include:: ../../reusables/codeql-cli-overview.rst
6+
.. include:: ../reusables/codeql-cli-overview.rst
77

88
See the following links to learn how to get set up and run CodeQL commands:
99

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Abstract syntax tree classes for working with Go programs
55

66
CodeQL has a large selection of classes for representing the abstract syntax tree of Go programs.
77

8-
.. include:: ../../reusables/abstract-syntax-tree.rst
8+
.. include:: ../reusables/abstract-syntax-tree.rst
99

1010
Statement classes
1111
-----------------
@@ -481,5 +481,5 @@ The following classes organize expressions by the kind of entity they refer to.
481481
Further reading
482482
---------------
483483

484-
.. include:: ../../reusables/go-further-reading.rst
485-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
484+
.. include:: ../reusables/go-further-reading.rst
485+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Abstract syntax tree classes for working with Java programs
55

66
CodeQL has a large selection of classes for representing the abstract syntax tree of Java programs.
77

8-
.. include:: ../../reusables/abstract-syntax-tree.rst
8+
.. include:: ../reusables/abstract-syntax-tree.rst
99

1010
Statement classes
1111
-----------------
@@ -274,8 +274,8 @@ Miscellaneous
274274
Further reading
275275
---------------
276276

277-
.. include:: ../../reusables/java-further-reading.rst
278-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
277+
.. include:: ../reusables/java-further-reading.rst
278+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
279279

280280
.. _Expr: https://help.semmle.com/qldoc/java/semmle/code/java/Expr.qll/type.Expr$Expr.html
281281
.. _Stmt: https://help.semmle.com/qldoc/java/semmle/code/java/Statement.qll/type.Statement$Stmt.html
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Abstract syntax tree classes for working with JavaScript and TypeScript programs
55

66
CodeQL has a large selection of classes for representing the abstract syntax tree of JavaScript and TypeScript programs.
77

8-
.. include:: ../../reusables/abstract-syntax-tree.rst
8+
.. include:: ../reusables/abstract-syntax-tree.rst
99

1010
Statement classes
1111
-----------------
@@ -364,5 +364,5 @@ All classes in this table are subclasses of `Expr <https://help.semmle.com/qldoc
364364
Further reading
365365
---------------
366366

367-
.. include:: ../../reusables/javascript-further-reading.rst
368-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
367+
.. include:: ../reusables/javascript-further-reading.rst
368+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst

docs/codeql/codeql-language-guides/codeql-for-python/analyzing-control-flow-in-python.rst docs/codeql/codeql-language-guides/analyzing-control-flow-in-python.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ An annotated flow graph:
3232

3333
|Python control flow graph|
3434

35-
.. |Python control flow graph| image:: ../../images/python-flow-graph.png
35+
.. |Python control flow graph| image:: ../images/python-flow-graph.png
3636

3737
The simplest use of the ``ControlFlowNode`` and ``AstNode`` classes is to find unreachable code. There is one ``ControlFlowNode`` per path through any ``AstNode`` and any ``AstNode`` that is unreachable has no paths flowing through it. Therefore, any ``AstNode`` without a corresponding ``ControlFlowNode`` is unreachable.
3838

@@ -119,6 +119,6 @@ Example finding mutually exclusive blocks within the same function
119119
Further reading
120120
---------------
121121

122-
.. include:: ../../reusables/python-further-reading.rst
123-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
122+
.. include:: ../reusables/python-further-reading.rst
123+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
124124

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Taint tracking differs from basic data flow in that it considers non-value-prese
1717
For example, in the assignment ``dir = path + "/"``, if ``path`` is tainted then ``dir`` is also tainted,
1818
even though there is no data flow from ``path`` to ``path + "/"``.
1919

20-
Separate CodeQL libraries have been written to handle 'normal' data flow and taint tracking in :doc:`C/C++ <../codeql-for-cpp/analyzing-data-flow-in-cpp>`, :doc:`C# <../codeql-for-csharp/analyzing-data-flow-in-csharp>`, :doc:`Java <../codeql-for-java/analyzing-data-flow-in-java>`, and :doc:`JavaScript <../codeql-for-javascript/analyzing-data-flow-in-javascript>`. You can access the appropriate classes and predicates that reason about these different modes of data flow by importing the appropriate library in your query.
20+
Separate CodeQL libraries have been written to handle 'normal' data flow and taint tracking in :doc:`C/C++ <analyzing-data-flow-in-cpp>`, :doc:`C# <analyzing-data-flow-in-csharp>`, :doc:`Java <analyzing-data-flow-in-java>`, and :doc:`JavaScript <analyzing-data-flow-in-javascript>`. You can access the appropriate classes and predicates that reason about these different modes of data flow by importing the appropriate library in your query.
2121
In Python analysis, we can use the same taint tracking library to model both 'normal' data flow and taint flow, but we are still able make the distinction between steps that preserve values and those that don't by defining additional data flow properties.
2222

2323
For further information on data flow and taint tracking with CodeQL, see ":ref:`Introduction to data flow <about-data-flow-analysis>`."
@@ -264,6 +264,6 @@ Further reading
264264
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
265265

266266

267-
.. include:: ../../reusables/python-further-reading.rst
268-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
267+
.. include:: ../reusables/python-further-reading.rst
268+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
269269

docs/codeql/codeql-language-guides/codeql-for-cpp/analyzing-data-flow-in-cpp.rst docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Global data flow tracks data flow throughout the entire program, and is therefor
143143

144144
.. pull-quote:: Note
145145

146-
.. include:: ../../reusables/path-problem.rst
146+
.. include:: ../reusables/path-problem.rst
147147

148148
Using global data flow
149149
~~~~~~~~~~~~~~~~~~~~~~
@@ -395,5 +395,5 @@ Further reading
395395
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
396396

397397

398-
.. include:: ../../reusables/cpp-further-reading.rst
399-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
398+
.. include:: ../reusables/cpp-further-reading.rst
399+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst

docs/codeql/codeql-language-guides/codeql-for-csharp/analyzing-data-flow-in-csharp.rst docs/codeql/codeql-language-guides/analyzing-data-flow-in-csharp.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Global data flow tracks data flow throughout the entire program, and is therefor
141141

142142
.. pull-quote:: Note
143143

144-
.. include:: ../../reusables/path-problem.rst
144+
.. include:: ../reusables/path-problem.rst
145145

146146
Using global data flow
147147
~~~~~~~~~~~~~~~~~~~~~~
@@ -558,5 +558,5 @@ Further reading
558558
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
559559

560560

561-
.. include:: ../../reusables/csharp-further-reading.rst
562-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
561+
.. include:: ../reusables/csharp-further-reading.rst
562+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst

docs/codeql/codeql-language-guides/codeql-for-java/analyzing-data-flow-in-java.rst docs/codeql/codeql-language-guides/analyzing-data-flow-in-java.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Global data flow tracks data flow throughout the entire program, and is therefor
151151

152152
.. pull-quote:: Note
153153

154-
.. include:: ../../reusables/path-problem.rst
154+
.. include:: ../reusables/path-problem.rst
155155

156156
Using global data flow
157157
~~~~~~~~~~~~~~~~~~~~~~
@@ -363,5 +363,5 @@ Further reading
363363
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
364364

365365

366-
.. include:: ../../reusables/java-further-reading.rst
367-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
366+
.. include:: ../reusables/java-further-reading.rst
367+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst

docs/codeql/codeql-language-guides/codeql-for-javascript/analyzing-data-flow-in-javascript.rst docs/codeql/codeql-language-guides/analyzing-data-flow-in-javascript.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ more time and memory than local analysis.
192192

193193
.. pull-quote:: Note
194194

195-
.. include:: ../../reusables/path-problem.rst
195+
.. include:: ../reusables/path-problem.rst
196196

197197
Using global data flow
198198
~~~~~~~~~~~~~~~~~~~~~~
@@ -559,5 +559,5 @@ Further reading
559559
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
560560
561561
562-
.. include:: ../../reusables/java-further-reading.rst
563-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
562+
.. include:: ../reusables/java-further-reading.rst
563+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst

docs/codeql/codeql-language-guides/codeql-for-java/annotations-in-java.rst docs/codeql/codeql-language-guides/annotations-in-java.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,5 @@ Now we can extend our query to filter out calls in methods carrying a ``Suppress
242242
Further reading
243243
---------------
244244

245-
.. include:: ../../reusables/java-further-reading.rst
246-
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
245+
.. include:: ../reusables/java-further-reading.rst
246+
.. include:: ../reusables/codeql-ref-tools-further-reading.rst

0 commit comments

Comments
 (0)