Merge pull request #4756 from github/folder-restructure
[Docs] Review folder restructure
@@ -85,11 +85,11 @@ The following properties are supported in ``qlpack.yml`` files.
|
||||
* - ``suites``
|
||||
- ``suites``
|
||||
- Optional
|
||||
- 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>`."
|
||||
- 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>`."
|
||||
* - ``extractor``
|
||||
- ``javascript``
|
||||
- All test packs
|
||||
- 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>`."
|
||||
- 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>`."
|
||||
* - ``tests``
|
||||
- ``.``
|
||||
- Optional for test packs
|
||||
@@ -124,7 +124,7 @@ and ``libraryPathDependencies`` properties. If the pack contains query suites, y
|
||||
use the ``suites`` property to define their location. Query suites defined
|
||||
here are called "well-known" suites, and can be used on the command line by referring to
|
||||
their name only, rather than their full path.
|
||||
For more information about query suites, see ":doc:`Creating CodeQL query suites <../using-the-codeql-cli/creating-codeql-query-suites>`."
|
||||
For more information about query suites, see ":doc:`Creating CodeQL query suites <creating-codeql-query-suites>`."
|
||||
|
||||
For example, a ``qlpack.yml`` file for a QL pack featuring custom C++ queries
|
||||
and libraries may contain:
|
||||
@@ -154,10 +154,10 @@ For custom QL packs containing test files, you also need to include an
|
||||
``extractor`` property so that the ``test run`` command knows how to create test
|
||||
databases. You may also wish to specify the ``tests`` property.
|
||||
|
||||
.. include:: ../../reusables/test-qlpack.rst
|
||||
.. include:: ../reusables/test-qlpack.rst
|
||||
|
||||
For more information about running tests, see ":doc:`Testing custom queries
|
||||
<../using-the-codeql-cli/testing-custom-queries>`."
|
||||
<testing-custom-queries>`."
|
||||
|
||||
.. _standard-ql-packs:
|
||||
|
||||
@@ -11,7 +11,7 @@ CodeQL analyses produce :ref:`interpreted results
|
||||
For information about writing queries to run with ``database analyze``, see
|
||||
":doc:`Using custom queries with the CodeQL CLI <using-custom-queries-with-the-codeql-cli>`."
|
||||
|
||||
.. include:: ../../reusables/advanced-query-execution.rst
|
||||
.. include:: ../reusables/advanced-query-execution.rst
|
||||
|
||||
Before starting an analysis you must:
|
||||
|
||||
@@ -55,7 +55,7 @@ You must specify:
|
||||
|
||||
You can also specify:
|
||||
|
||||
- .. include:: ../../reusables/threads-query-execution.rst
|
||||
- .. include:: ../reusables/threads-query-execution.rst
|
||||
|
||||
|
||||
.. pull-quote::
|
||||
@@ -149,7 +149,7 @@ recursively, so any queries contained in subfolders will also be executed.
|
||||
Important
|
||||
|
||||
You shouldn't specify the root of a :doc:`QL pack
|
||||
<../codeql-cli-reference/about-ql-packs>` when executing ``database analyze``
|
||||
<about-ql-packs>` when executing ``database analyze``
|
||||
as it contains some special queries that aren't designed to be used with
|
||||
the command. Rather, to run a wide range of useful queries, run one of the
|
||||
LGTM.com query suites.
|
||||
@@ -171,7 +171,7 @@ You can save analysis results in a number of different formats, including SARIF
|
||||
and CSV.
|
||||
|
||||
The SARIF format is designed to represent the output of a broad range of static
|
||||
analysis tools. For more information, see :doc:`SARIF output <../codeql-cli-reference/sarif-output>`.
|
||||
analysis tools. For more information, see :doc:`SARIF output <sarif-output>`.
|
||||
|
||||
If you choose to generate results in CSV format, then each line in the output file
|
||||
corresponds to an alert. Each line is a comma-separated list with the following information:
|
||||
@@ -35,7 +35,7 @@ You must specify:
|
||||
- ``--language``: the identifier for the language to create a database for.
|
||||
CodeQL supports creating databases for the following languages:
|
||||
|
||||
.. include:: ../../reusables/extractors.rst
|
||||
.. include:: ../reusables/extractors.rst
|
||||
|
||||
Other options may be specified depending on the location of your source file and
|
||||
the language you want to analyze:
|
||||
@@ -75,7 +75,7 @@ CodeQL. For each project on LGTM.com, you can download an archived CodeQL
|
||||
database corresponding to the most recently analyzed revision of the code. These
|
||||
databases can also be analyzed using the CodeQL CLI.
|
||||
|
||||
.. include:: ../../reusables/download-lgtm-database.rst
|
||||
.. include:: ../reusables/download-lgtm-database.rst
|
||||
|
||||
Before running an analysis, unzip the databases and try :doc:`upgrading <upgrading-codeql-databases>` the
|
||||
unzipped databases to ensure they are compatible with your local copy of the
|
||||
@@ -85,7 +85,7 @@ CodeQL queries and libraries.
|
||||
|
||||
Note
|
||||
|
||||
.. include:: ../../reusables/index-files-note.rst
|
||||
.. include:: ../reusables/index-files-note.rst
|
||||
|
||||
Creating databases for non-compiled languages
|
||||
---------------------------------------------
|
||||
@@ -19,7 +19,7 @@ suite definition have been executed, the result is a set of selected queries.
|
||||
.. note::
|
||||
|
||||
Any custom queries that you want to add to a query suite must be in a :doc:`QL
|
||||
pack <../codeql-cli-reference/about-ql-packs>` and contain the correct query metadata.
|
||||
pack <about-ql-packs>` and contain the correct query metadata.
|
||||
For more information, see
|
||||
":doc:`Using custom queries with the CodeQL CLI <using-custom-queries-with-the-codeql-cli>`."
|
||||
|
||||
@@ -254,7 +254,7 @@ without providing their full path. This gives you a simple way of specifying a
|
||||
set of queries, without needing to search inside QL packs and distributions.
|
||||
To declare a directory that contains "well-known" query suites, add the directory
|
||||
to the ``suites`` property in the ``qlpack.yml`` file at the root of your QL pack.
|
||||
For more information, see "`About QL packs <../codeql-cli-reference/qlpack-overview.html#qlpack-yml-properties>`__."
|
||||
For more information, see "`About QL packs <qlpack-overview.html#qlpack-yml-properties>`__."
|
||||
|
||||
Using query suites with CodeQL
|
||||
------------------------------
|
||||
@@ -6,7 +6,7 @@ Getting started with the CodeQL CLI
|
||||
To run CodeQL commands, you need to set up the CLI so that it can access
|
||||
the tools, queries, and libraries required to create and analyze databases.
|
||||
|
||||
.. include:: ../../reusables/license-note.rst
|
||||
.. include:: ../reusables/license-note.rst
|
||||
|
||||
.. _setting-up-cli:
|
||||
|
||||
@@ -115,7 +115,7 @@ repository should be ``$HOME/codeql-home/codeql-go``.
|
||||
Within these repositories, the queries and libraries are organized into QL
|
||||
packs. Along with the queries themselves, QL packs contain important metadata
|
||||
that tells the CodeQL CLI how to process the query files. For more information,
|
||||
see ":doc:`About QL packs <../codeql-cli-reference/about-ql-packs>`."
|
||||
see ":doc:`About QL packs <about-ql-packs>`."
|
||||
|
||||
.. pull-quote:: Important
|
||||
|
||||
@@ -10,12 +10,12 @@ CodeQL CLI
|
||||
|
||||
- :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.
|
||||
|
||||
- `CodeQL CLI manual <codeql-cli-manual>`__: Detailed information about all the commands available with the CodeQL CLI.
|
||||
- `CodeQL CLI manual <../codeql-cli-manual>`__: Detailed information about all the commands available with the CodeQL CLI.
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
using-the-codeql-cli/index
|
||||
codeql-cli-reference/index
|
||||
using-the-codeql-cli
|
||||
codeql-cli-reference
|
||||
|
||||
|
||||
@@ -44,4 +44,4 @@ to the ``codeql-javascript`` QL pack::
|
||||
|
||||
AngularJS/DeadAngularJSEventListener.ql
|
||||
|
||||
For another example, see `Testing custom queries <../using-the-codeql-cli/test-queries.html#example>`__.
|
||||
For another example, see `Testing custom queries <test-queries.html#example>`__.
|
||||
@@ -44,7 +44,7 @@ file that defines:
|
||||
The ``libraryPathDependencies`` value specifies the CodeQL queries to test.
|
||||
The ``extractor`` defines which language the CLI will use
|
||||
to create test databases from the code files stored in this QL pack.
|
||||
For more information, see ":doc:`About QL packs <../codeql-cli-reference/about-ql-packs>`."
|
||||
For more information, see ":doc:`About QL packs <about-ql-packs>`."
|
||||
|
||||
You may find it useful to look at the way query tests are organized in the
|
||||
`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
|
||||
The location is defined relative to the root of the QL pack that contains the
|
||||
query. Usually, this is a QL pack specified by the
|
||||
``libraryPathDependencies`` for the test pack.
|
||||
For more information, see ":doc:`Query reference files <../codeql-cli-reference/query-reference-files>`."
|
||||
For more information, see ":doc:`Query reference files <query-reference-files>`."
|
||||
|
||||
You don't need to add a query reference file if the query you want to
|
||||
test is stored in the test directory,
|
||||
@@ -127,7 +127,7 @@ The ``<test|dir>`` argument can be one or more of the following:
|
||||
|
||||
You can also specify:
|
||||
|
||||
- .. include:: ../../reusables/threads-query-execution.rst
|
||||
- .. include:: ../reusables/threads-query-execution.rst
|
||||
|
||||
For full details of all the options you can use when testing queries,
|
||||
see the `test run reference documentation <../codeql-cli-manual/test-run.html>`__.
|
||||
@@ -172,13 +172,13 @@ Prepare a query and test files
|
||||
libraryPathDependencies: codeql-java
|
||||
|
||||
For more information about QL packs, see ":doc:`About QL packs
|
||||
<../codeql-cli-reference/about-ql-packs>`."
|
||||
<about-ql-packs>`."
|
||||
|
||||
#. Create a QL pack for your Java tests by adding a ``qlpack.yml`` file
|
||||
with the following contents to ``custom-queries/java/tests``,
|
||||
updating ``libraryPathDependencies`` to match the name of your QL pack of custom queries:
|
||||
|
||||
.. include:: ../../reusables/test-qlpack.rst
|
||||
.. include:: ../reusables/test-qlpack.rst
|
||||
|
||||
#. Within the Java test pack, create a directory to contain the test files
|
||||
associated with ``EmptyThen.ql``.
|
||||
@@ -10,7 +10,7 @@ This topic is specifically about writing
|
||||
queries to use with the `database analyze <../codeql-cli-manual/database-analyze.html>`__
|
||||
command to produce :ref:`interpreted results <interpret-query-results>`.
|
||||
|
||||
.. include:: ../../reusables/advanced-query-execution.rst
|
||||
.. include:: ../reusables/advanced-query-execution.rst
|
||||
|
||||
Writing a valid query
|
||||
---------------------
|
||||
@@ -3,7 +3,7 @@
|
||||
Using the CodeQL CLI
|
||||
====================
|
||||
|
||||
.. include:: ../../reusables/codeql-cli-overview.rst
|
||||
.. include:: ../reusables/codeql-cli-overview.rst
|
||||
|
||||
See the following links to learn how to get set up and run CodeQL commands:
|
||||
|
||||
@@ -5,7 +5,7 @@ Abstract syntax tree classes for working with Go programs
|
||||
|
||||
CodeQL has a large selection of classes for representing the abstract syntax tree of Go programs.
|
||||
|
||||
.. include:: ../../reusables/abstract-syntax-tree.rst
|
||||
.. include:: ../reusables/abstract-syntax-tree.rst
|
||||
|
||||
Statement classes
|
||||
-----------------
|
||||
@@ -481,5 +481,5 @@ The following classes organize expressions by the kind of entity they refer to.
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/go-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/go-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -5,7 +5,7 @@ Abstract syntax tree classes for working with Java programs
|
||||
|
||||
CodeQL has a large selection of classes for representing the abstract syntax tree of Java programs.
|
||||
|
||||
.. include:: ../../reusables/abstract-syntax-tree.rst
|
||||
.. include:: ../reusables/abstract-syntax-tree.rst
|
||||
|
||||
Statement classes
|
||||
-----------------
|
||||
@@ -274,8 +274,8 @@ Miscellaneous
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
.. _Expr: https://help.semmle.com/qldoc/java/semmle/code/java/Expr.qll/type.Expr$Expr.html
|
||||
.. _Stmt: https://help.semmle.com/qldoc/java/semmle/code/java/Statement.qll/type.Statement$Stmt.html
|
||||
@@ -5,7 +5,7 @@ Abstract syntax tree classes for working with JavaScript and TypeScript programs
|
||||
|
||||
CodeQL has a large selection of classes for representing the abstract syntax tree of JavaScript and TypeScript programs.
|
||||
|
||||
.. include:: ../../reusables/abstract-syntax-tree.rst
|
||||
.. include:: ../reusables/abstract-syntax-tree.rst
|
||||
|
||||
Statement classes
|
||||
-----------------
|
||||
@@ -364,5 +364,5 @@ All classes in this table are subclasses of `Expr <https://help.semmle.com/qldoc
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -32,7 +32,7 @@ An annotated flow graph:
|
||||
|
||||
|Python control flow graph|
|
||||
|
||||
.. |Python control flow graph| image:: ../../images/python-flow-graph.png
|
||||
.. |Python control flow graph| image:: ../images/python-flow-graph.png
|
||||
|
||||
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.
|
||||
|
||||
@@ -119,6 +119,6 @@ Example finding mutually exclusive blocks within the same function
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -17,7 +17,7 @@ Taint tracking differs from basic data flow in that it considers non-value-prese
|
||||
For example, in the assignment ``dir = path + "/"``, if ``path`` is tainted then ``dir`` is also tainted,
|
||||
even though there is no data flow from ``path`` to ``path + "/"``.
|
||||
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
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
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -143,7 +143,7 @@ Global data flow tracks data flow throughout the entire program, and is therefor
|
||||
|
||||
.. pull-quote:: Note
|
||||
|
||||
.. include:: ../../reusables/path-problem.rst
|
||||
.. include:: ../reusables/path-problem.rst
|
||||
|
||||
Using global data flow
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -395,5 +395,5 @@ Further reading
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -141,7 +141,7 @@ Global data flow tracks data flow throughout the entire program, and is therefor
|
||||
|
||||
.. pull-quote:: Note
|
||||
|
||||
.. include:: ../../reusables/path-problem.rst
|
||||
.. include:: ../reusables/path-problem.rst
|
||||
|
||||
Using global data flow
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -558,5 +558,5 @@ Further reading
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/csharp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/csharp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -151,7 +151,7 @@ Global data flow tracks data flow throughout the entire program, and is therefor
|
||||
|
||||
.. pull-quote:: Note
|
||||
|
||||
.. include:: ../../reusables/path-problem.rst
|
||||
.. include:: ../reusables/path-problem.rst
|
||||
|
||||
Using global data flow
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -363,5 +363,5 @@ Further reading
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -192,7 +192,7 @@ more time and memory than local analysis.
|
||||
|
||||
.. pull-quote:: Note
|
||||
|
||||
.. include:: ../../reusables/path-problem.rst
|
||||
.. include:: ../reusables/path-problem.rst
|
||||
|
||||
Using global data flow
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -559,5 +559,5 @@ Further reading
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -242,5 +242,5 @@ Now we can extend our query to filter out calls in methods carrying a ``Suppress
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -48,7 +48,7 @@ Running the query
|
||||
|
||||
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:
|
||||
|
||||
.. image:: ../../images/query-progress.png
|
||||
.. image:: ../images/query-progress.png
|
||||
:align: center
|
||||
|
||||
.. pull-quote::
|
||||
@@ -143,5 +143,5 @@ To exclude ``if`` statements that have an ``else`` branch:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -48,7 +48,7 @@ Running the query
|
||||
|
||||
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:
|
||||
|
||||
.. image:: ../../images/query-progress.png
|
||||
.. image:: ../images/query-progress.png
|
||||
:align: center
|
||||
|
||||
.. pull-quote::
|
||||
@@ -148,5 +148,5 @@ To exclude ``if`` statements that have an ``else`` branch:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/csharp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/csharp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -58,7 +58,7 @@ Running the query
|
||||
|
||||
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:
|
||||
|
||||
.. image:: ../../images/query-progress.png
|
||||
.. image:: ../images/query-progress.png
|
||||
:align: center
|
||||
|
||||
.. pull-quote::
|
||||
@@ -149,5 +149,5 @@ To exclude these values:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/go-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/go-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -48,7 +48,7 @@ Running the query
|
||||
|
||||
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:
|
||||
|
||||
.. image:: ../../images/query-progress.png
|
||||
.. image:: ../images/query-progress.png
|
||||
:align: center
|
||||
|
||||
.. pull-quote::
|
||||
@@ -143,5 +143,5 @@ To exclude ``if`` statements that have an ``else`` branch:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -46,7 +46,7 @@ Running the query
|
||||
|
||||
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:
|
||||
|
||||
.. image:: ../../images/query-progress.png
|
||||
.. image:: ../images/query-progress.png
|
||||
:align: center
|
||||
|
||||
.. pull-quote::
|
||||
@@ -134,5 +134,5 @@ As written, this statement compares ``point.bias`` against ``-1`` and then disca
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -48,7 +48,7 @@ Running the query
|
||||
|
||||
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:
|
||||
|
||||
.. image:: ../../images/query-progress.png
|
||||
.. image:: ../images/query-progress.png
|
||||
:align: center
|
||||
|
||||
.. pull-quote::
|
||||
@@ -142,5 +142,5 @@ To exclude ``if`` statements that have an ``else`` branch:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -527,5 +527,5 @@ This table lists `Preprocessor <https://help.semmle.com/qldoc/cpp/semmle/code/cp
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -1124,5 +1124,5 @@ Here is the fixed version:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/csharp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/csharp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -612,11 +612,11 @@ is to compare them to each other to determine whether two data-flow nodes have t
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/go-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/go-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
.. |ast| image:: ast.png
|
||||
.. |cfg| image:: cfg.png
|
||||
.. |dfg| image:: dfg.png
|
||||
.. |cfg2| image:: cfg2.png
|
||||
.. |ssa| image:: ssa.png
|
||||
.. |ast| image:: ../images/codeql-for-go/ast.png
|
||||
.. |cfg| image:: ../images/codeql-for-go/cfg.png
|
||||
.. |dfg| image:: ../images/codeql-for-go/dfg.png
|
||||
.. |cfg2| image:: ../images/codeql-for-go/cfg2.png
|
||||
.. |ssa| image:: ../images/codeql-for-go/ssa.png
|
||||
@@ -388,5 +388,5 @@ For more information about callables and calls, see the :doc:`article on the cal
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -1033,5 +1033,5 @@ Predicate ``YAMLMapping.maps(key, value)`` models the key-value relation represe
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -342,6 +342,6 @@ For more information about these classes, see ":doc:`Analyzing data flow and tra
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -451,5 +451,5 @@ A `LocalNamespaceName <https://help.semmle.com/qldoc/javascript/semmle/javascrip
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -225,5 +225,5 @@ There is a similar built-in `query <https://lgtm.com/rules/2158670642/>`__ on LG
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -225,5 +225,5 @@ Further reading
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -226,5 +226,5 @@ The completed query will now identify cases where the result of ``strlen`` is st
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -258,6 +258,6 @@ Here is the relevant part of the class hierarchy:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -134,5 +134,5 @@ Note that we replaced ``e.getEnclosingStmt()`` with ``e.getEnclosingStmt().getPa
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -94,5 +94,5 @@ The LGTM version of this query is considerably more complicated, but if you look
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -83,6 +83,6 @@ In a later tutorial we will see how to use the type-inference library to find ca
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -116,5 +116,5 @@ Example query
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -7,10 +7,10 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
|
||||
|
||||
.. toctree::
|
||||
|
||||
codeql-for-cpp/index
|
||||
codeql-for-csharp/index
|
||||
codeql-for-go/index
|
||||
codeql-for-java/index
|
||||
codeql-for-javascript/index
|
||||
codeql-for-python/index
|
||||
codeql-for-cpp
|
||||
codeql-for-csharp
|
||||
codeql-for-go
|
||||
codeql-for-java
|
||||
codeql-for-javascript
|
||||
codeql-for-python
|
||||
|
||||
@@ -223,5 +223,5 @@ Currently, ``visibleIn`` only considers single-type imports, but you could exten
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -166,5 +166,5 @@ Finally, on many Java projects there are methods that are invoked indirectly by
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -127,5 +127,5 @@ Now we rewrite our query to make use of these new classes:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -228,6 +228,6 @@ Then we can use ``Value.getACall()`` to identify calls to the ``eval`` function,
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/python-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/python-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -151,5 +151,5 @@ Finally we can simplify the query by using the transitive closure operator. In t
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -301,5 +301,5 @@ Adding these three improvements, our final query becomes:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -403,5 +403,5 @@ Further reading
|
||||
- ":ref:`Exploring data flow with path queries <exploring-data-flow-with-path-queries>`"
|
||||
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -47,5 +47,5 @@ This query uses ``upperBound`` to determine whether the result of ``snprintf`` i
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -98,6 +98,6 @@ The ``comparesLt`` predicate
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/cpp-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/cpp-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
||||
@@ -523,5 +523,5 @@ Type tracking is used in a few places in the standard libraries:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/javascript-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/javascript-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -188,5 +188,5 @@ Whitespace suggests that the programmer meant to toggle ``i`` between zero and o
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/java-further-reading.rst
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/java-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
@@ -149,4 +149,4 @@ You have found the two fire starters! They are arrested and the villagers are on
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -269,4 +269,4 @@ Here are some more example queries that solve the river crossing puzzle:
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -163,4 +163,4 @@ You could also try writing more of your own QL queries to find interesting facts
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -53,7 +53,7 @@ This basic select statement has two columns:
|
||||
#. Element to display the alert on: ``f`` corresponds to ``File``.
|
||||
#. String message to display: ``"This file is similar to another file."``
|
||||
|
||||
.. image:: ../../images/ql-select-statement-basic.png
|
||||
.. image:: ../images/ql-select-statement-basic.png
|
||||
:alt: Results of basic select statement
|
||||
:class: border
|
||||
|
||||
@@ -69,7 +69,7 @@ The alert message defined by the basic select statement is constant and doesn't
|
||||
#. Element: ``f`` as before.
|
||||
#. String message: ``"This file is similar to "``—the string text is combined with the file name for the ``other``, similar file, returned by ``getBaseName()``.
|
||||
|
||||
.. image:: ../../images/ql-select-statement-filename.png
|
||||
.. image:: ../images/ql-select-statement-filename.png
|
||||
:alt: Results of extended select statement
|
||||
:class: border
|
||||
|
||||
@@ -104,7 +104,7 @@ You could go further and change the ``select`` statement to report on the simila
|
||||
|
||||
The new elements added here don't need to be clickable, so we added them directly to the description string.
|
||||
|
||||
.. image:: ../../images/ql-select-statement-similarity.png
|
||||
.. image:: ../images/ql-select-statement-similarity.png
|
||||
:alt: Results showing the extent of similarity
|
||||
:class: border
|
||||
|
||||
@@ -294,4 +294,4 @@ Have you found the thief?
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||
@@ -12,5 +12,5 @@ Get to know more about queries and learn some key query-writing skills by solvin
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
ql-tutorials/index
|
||||
codeql-queries/index
|
||||
ql-tutorials
|
||||
codeql-queries
|
||||
|
||||
@@ -62,6 +62,6 @@ Here is the metadata for one of the standard Java queries:
|
||||
|
||||
|image0|
|
||||
|
||||
.. |image0| image:: ../../images/query-metadata.png
|
||||
.. |image0| image:: ../images/query-metadata.png
|
||||
|
||||
For more examples of query metadata, see the standard CodeQL queries in our `GitHub repository <https://github.com/github/codeql>`__.
|
||||
@@ -153,4 +153,4 @@ Now the structure we want is clearer. We've separated out the easy part into its
|
||||
Further reading
|
||||
---------------
|
||||
|
||||
.. include:: ../../reusables/codeql-ref-tools-further-reading.rst
|
||||
.. include:: ../reusables/codeql-ref-tools-further-reading.rst
|
||||