From 3da66b7fd9bc5c27f241b35d5388883e77623ed0 Mon Sep 17 00:00:00 2001 From: Shati Patel <42641846+shati-patel@users.noreply.github.com> Date: Wed, 6 Jan 2021 16:34:28 +0000 Subject: [PATCH] Fix broken links from Sphinx linkcheck --- docs/codeql/codeql-cli/about-ql-packs.rst | 4 +++- .../codeql-cli/creating-codeql-query-suites.rst | 2 +- .../codeql-library-for-cpp.rst | 4 ++-- .../codeql-library-for-javascript.rst | 4 ++-- .../codeql-library-for-typescript.rst | 2 +- .../data-flow-cheat-sheet-for-javascript.rst | 2 +- .../modeling-data-flow-in-go-libraries.rst | 2 +- .../using-type-tracking-for-api-modeling.rst | 12 ++++++------ docs/codeql/ql-language-reference/annotations.rst | 2 +- .../evaluation-of-ql-programs.rst | 4 ++-- docs/codeql/ql-language-reference/expressions.rst | 4 ++-- docs/codeql/ql-language-reference/formulas.rst | 2 +- docs/codeql/ql-language-reference/lexical-syntax.rst | 2 +- docs/codeql/ql-language-reference/modules.rst | 4 ++-- .../codeql/ql-language-reference/name-resolution.rst | 8 ++++---- docs/codeql/ql-language-reference/predicates.rst | 4 ++-- docs/codeql/ql-language-reference/types.rst | 6 +++--- docs/codeql/ql-language-reference/variables.rst | 2 +- .../writing-codeql-queries/about-codeql-queries.rst | 2 +- .../writing-codeql-queries/cross-the-river.rst | 2 +- .../writing-codeql-queries/introduction-to-ql.rst | 2 +- 21 files changed, 39 insertions(+), 37 deletions(-) diff --git a/docs/codeql/codeql-cli/about-ql-packs.rst b/docs/codeql/codeql-cli/about-ql-packs.rst index 8ed639d9de7..200dadc173b 100644 --- a/docs/codeql/codeql-cli/about-ql-packs.rst +++ b/docs/codeql/codeql-cli/about-ql-packs.rst @@ -57,6 +57,8 @@ from any location in the pack by declaring ``import mycompany.java.CustomSinks`` For more information, see ":ref:`Importing modules `" in the QL language reference. +.. _qlpack-yml-properties: + ``qlpack.yml`` properties ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -101,7 +103,7 @@ The following properties are supported in ``qlpack.yml`` files. * - ``upgrades`` - ``.`` - Packs with upgrades - - The path to a directory within the pack that contains upgrade scripts, defined relative to the pack directory. The ``database upgrade`` action uses these scripts to update databases that were created by an older version of an extractor so they're compatible with the current extractor (see `Upgrade scripts for a language `__ below.) + - The path to a directory within the pack that contains upgrade scripts, defined relative to the pack directory. The ``database upgrade`` action uses these scripts to update databases that were created by an older version of an extractor so they're compatible with the current extractor (see `Upgrade scripts for a language <#upgrade-scripts-for-a-language>`__ below.) .. _custom-ql-packs: diff --git a/docs/codeql/codeql-cli/creating-codeql-query-suites.rst b/docs/codeql/codeql-cli/creating-codeql-query-suites.rst index 9c3579acd4a..04de07c5c33 100644 --- a/docs/codeql/codeql-cli/creating-codeql-query-suites.rst +++ b/docs/codeql/codeql-cli/creating-codeql-query-suites.rst @@ -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 `__." +For more information, see ":ref:`About QL packs `." Using query suites with CodeQL ------------------------------ diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-cpp.rst b/docs/codeql/codeql-language-guides/codeql-library-for-cpp.rst index 0b0156d4da3..f7fa6751c3e 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-cpp.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-cpp.rst @@ -703,8 +703,8 @@ Further reading .. _SizeofPackOperator: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Cast.qll/type.Cast$SizeofPackOperator.html .. _StmtExpr: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Expr.qll/type.Expr$StmtExpr.html .. _ThisExpr: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Expr.qll/type.Expr$ThisExpr.html -.. _ThrowExpr: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Call.qll/type.Call$ThrowExpr.html -.. _ReThrowExpr: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Call.qll/type.Call$ReThrowExpr.html +.. _ThrowExpr: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Expr.qll/type.Expr$ThrowExpr.html +.. _ReThrowExpr: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Expr.qll/type.Expr$ReThrowExpr.html .. _TypeidOperator: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Cast.qll/type.Cast$TypeidOperator.html .. _UuidofOperator: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/exprs/Cast.qll/type.Cast$UuidofOperator.html .. _VoidType: https://codeql.github.com/codeql-standard-libraries/cpp/semmle/code/cpp/Type.qll/type.Type$VoidType.html diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-javascript.rst b/docs/codeql/codeql-language-guides/codeql-library-for-javascript.rst index 570e45401d6..1a3fd411dd6 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-javascript.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-javascript.rst @@ -215,7 +215,7 @@ From a syntactic point of view, each JavaScript program is composed of one or mo - `EventHandlerCode `__: code from an event handler attribute such as ``onload`` - `JavaScriptURL `__: code from a URL with the ``javascript:`` scheme - - `Externs `__: a JavaScript file containing `externs `__ definitions + - `Externs `__: a JavaScript file containing `externs `__ definitions Every `TopLevel `__ class is contained in a `File `__ class, but a single `File `__ may contain more than one `TopLevel `__. To go from a ``TopLevel tl`` to its `File `__, use ``tl.getFile()``; conversely, for a ``File f``, predicate ``f.getATopLevel()`` returns a top-level contained in ``f``. For every AST node, predicate ``ASTNode.getTopLevel()`` can be used to find the top-level it belongs to. @@ -361,7 +361,7 @@ JavaScript provides several ways of defining functions: in ECMAScript 5, there a - ``Function.getId()`` returns the `Identifier `__ naming the function, which may not be defined for function expressions. - ``Function.getParameter(i)`` and ``Function.getAParameter()`` access the ``i``\ th parameter or any parameter, respectively; parameters are modeled by the class `Parameter `__, which is a subclass of `BindingPattern `__ (see below). -- ``Function.getBody()`` returns the body of the function, which is usually a `Stmt `__, but may be an `Expr `__ for arrow function expressions and legacy `expression closures `__. +- ``Function.getBody()`` returns the body of the function, which is usually a `Stmt `__, but may be an `Expr `__ for arrow function expressions and legacy `expression closures `__. As an example, here is a query that finds all expression closures: diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-typescript.rst b/docs/codeql/codeql-language-guides/codeql-library-for-typescript.rst index 096e699d9ee..e729011a3e9 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-typescript.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-typescript.rst @@ -138,7 +138,7 @@ The CodeQL class `ClassOrInterface `__. -Also see the documentation for classes in the "`CodeQL libraries for JavaScript `__." +Also see the documentation for classes in the "`CodeQL libraries for JavaScript `__." To select the type references to a class or an interface, use ``getTypeName()``. diff --git a/docs/codeql/codeql-language-guides/data-flow-cheat-sheet-for-javascript.rst b/docs/codeql/codeql-language-guides/data-flow-cheat-sheet-for-javascript.rst index 25bb80c38fe..92eb35d4d2e 100644 --- a/docs/codeql/codeql-language-guides/data-flow-cheat-sheet-for-javascript.rst +++ b/docs/codeql/codeql-language-guides/data-flow-cheat-sheet-for-javascript.rst @@ -36,7 +36,7 @@ This query reports flow paths which: - Step through variables, function calls, properties, strings, arrays, promises, exceptions, and steps added by `isAdditionalTaintStep `__. - End at a node matched by `isSink `__. -See also: "`Global data flow `__" and ":ref:`Creating path queries `." +See also: "`Global data flow `__" and ":ref:`Creating path queries `." DataFlow module --------------- diff --git a/docs/codeql/codeql-language-guides/modeling-data-flow-in-go-libraries.rst b/docs/codeql/codeql-language-guides/modeling-data-flow-in-go-libraries.rst index b57b57820a6..9e3c068701e 100644 --- a/docs/codeql/codeql-language-guides/modeling-data-flow-in-go-libraries.rst +++ b/docs/codeql/codeql-language-guides/modeling-data-flow-in-go-libraries.rst @@ -27,7 +27,7 @@ example from ``Mux.qll``. } This has the effect that all calls to `the function Vars from the -package mux `__ are +package mux `__ are treated as sources of untrusted data. Flow propagation diff --git a/docs/codeql/codeql-language-guides/using-type-tracking-for-api-modeling.rst b/docs/codeql/codeql-language-guides/using-type-tracking-for-api-modeling.rst index 9debe98ae99..e1690397e63 100644 --- a/docs/codeql/codeql-language-guides/using-type-tracking-for-api-modeling.rst +++ b/docs/codeql/codeql-language-guides/using-type-tracking-for-api-modeling.rst @@ -11,9 +11,9 @@ The type-tracking library makes it possible to track values through properties a usually to recognize method calls and properties accessed on a specific type of object. This is an advanced topic and is intended for readers already familiar with the -`SourceNode `__ class as well as -`taint tracking `__. -For TypeScript analysis also consider reading about `static type information `__ first. +`SourceNode `__ class as well as +`taint tracking `__. +For TypeScript analysis also consider reading about `static type information `__ first. The problem of recognizing method calls @@ -458,7 +458,7 @@ Here's an example that the model from this tutorial won't find: let wrapper = wrapDB(firebase.database()) wrapper.db.ref("forecast"); // <-- not found -This is an example of where `data-flow configurations `__ are more powerful. +This is an example of where `data-flow configurations `__ are more powerful. When to use type tracking ------------------------- @@ -491,7 +491,7 @@ Prefer type tracking when: Prefer data-flow configurations when: -- Tracking user-controlled data -- use `taint tracking `__. +- Tracking user-controlled data -- use `taint tracking `__. - Differentiating between different kinds of user-controlled data -- see ":doc:`Using flow labels for precise data flow analysis `." - Tracking transformations of a value through generic utility functions. - Tracking values through string manipulation. @@ -499,7 +499,7 @@ Prefer data-flow configurations when: Lastly, depending on the code base being analyzed, some alternatives to consider are: -- Using `static type information `__, +- Using `static type information `__, if analyzing TypeScript code. - Relying on local data flow. diff --git a/docs/codeql/ql-language-reference/annotations.rst b/docs/codeql/ql-language-reference/annotations.rst index 58777e6ef93..b3dabb42bfb 100644 --- a/docs/codeql/ql-language-reference/annotations.rst +++ b/docs/codeql/ql-language-reference/annotations.rst @@ -47,7 +47,7 @@ Overview of annotations This section describes what the different annotations do, and when you can use them. You can also find a summary table in the Annotations section of the -`QL language specification `_. +`QL language specification `_. .. index:: abstract .. _abstract: diff --git a/docs/codeql/ql-language-reference/evaluation-of-ql-programs.rst b/docs/codeql/ql-language-reference/evaluation-of-ql-programs.rst index eeb7a678b98..4b94a957a04 100644 --- a/docs/codeql/ql-language-reference/evaluation-of-ql-programs.rst +++ b/docs/codeql/ql-language-reference/evaluation-of-ql-programs.rst @@ -23,7 +23,7 @@ A QL program is evaluated from the bottom up, so a predicate is usually only eva all the predicates it depends on are evaluated. The database includes sets of ordered tuples for the `built-in predicates -`_ and :ref:`external predicates `. +`_ and :ref:`external predicates `. Each evaluation starts from these sets of tuples. The remaining predicates and types in the program are organized into a number of layers, based on the dependencies between them. @@ -35,7 +35,7 @@ results of the program. The results are sorted according to any ordering directi (``order by``) in the queries. For more details about each step of the evaluation process, see the "`QL language specification -`_." +`_." Validity of programs ******************** diff --git a/docs/codeql/ql-language-reference/expressions.rst b/docs/codeql/ql-language-reference/expressions.rst index 0027ecd5e5f..f51983063fb 100644 --- a/docs/codeql/ql-language-reference/expressions.rst +++ b/docs/codeql/ql-language-reference/expressions.rst @@ -63,7 +63,7 @@ You can express certain values directly in QL, such as numbers, booleans, and st "hello" "They said, \"Please escape quotation marks!\"" - See `String literals `_ + See `String literals ` in the QL language specification for more details. Note: there is no "date literal" in QL. Instead, to specify a :ref:`date `, you should @@ -572,7 +572,7 @@ The following table lists some examples of different forms of ``any`` expression .. pull-quote:: Note - There is also a `built-in predicate `_ + There is also a `built-in predicate `_ ``any()``. This is a predicate that always holds. Unary operations diff --git a/docs/codeql/ql-language-reference/formulas.rst b/docs/codeql/ql-language-reference/formulas.rst index 9996f1c11fa..b4bc7481aeb 100644 --- a/docs/codeql/ql-language-reference/formulas.rst +++ b/docs/codeql/ql-language-reference/formulas.rst @@ -37,7 +37,7 @@ Order To compare two expressions using one of these order operators, each expression must have a type and those types must be :ref:`compatible ` and -`orderable `_. +`orderable `_. +--------------------------+--------+ | Name | Symbol | diff --git a/docs/codeql/ql-language-reference/lexical-syntax.rst b/docs/codeql/ql-language-reference/lexical-syntax.rst index 7553b7b92bc..9051e4cd5fb 100644 --- a/docs/codeql/ql-language-reference/lexical-syntax.rst +++ b/docs/codeql/ql-language-reference/lexical-syntax.rst @@ -8,7 +8,7 @@ Lexical syntax The QL syntax includes different kinds of keywords, identifiers, and comments. For an overview of the lexical syntax, see "`Lexical syntax -`_" in the QL language specification. +`_" in the QL language specification. .. index:: comment, QLDoc .. _comments: diff --git a/docs/codeql/ql-language-reference/modules.rst b/docs/codeql/ql-language-reference/modules.rst index a02a4f2a800..b9998b63248 100644 --- a/docs/codeql/ql-language-reference/modules.rst +++ b/docs/codeql/ql-language-reference/modules.rst @@ -29,7 +29,7 @@ a class ``OneTwoThree``: } } -The name of a module can be any `identifier `_ +The name of a module can be any `identifier `_ that starts with an uppercase or lowercase letter. ``.ql`` or ``.qll`` files also implicitly define modules. @@ -186,5 +186,5 @@ for example ``import javascript as js``. The ```` itself can be a module name, a selection, or a qualified reference. For more information, see ":ref:`name-resolution`." -For information about how import statements are looked up, see "`Module resolution `__" +For information about how import statements are looked up, see "`Module resolution `__" in the QL language specification. \ No newline at end of file diff --git a/docs/codeql/ql-language-reference/name-resolution.rst b/docs/codeql/ql-language-reference/name-resolution.rst index 6d4d4b96993..c8fc351cffb 100644 --- a/docs/codeql/ql-language-reference/name-resolution.rst +++ b/docs/codeql/ql-language-reference/name-resolution.rst @@ -80,7 +80,7 @@ statement as follows: #. If the compiler can't find the library file using the above two checks, it looks up ``examples/security/MyLibrary.qll`` relative to each library path entry. The library path is usually specified using the ``libraryPathDependencies`` of the ``qlpack.yml`` file, though it may also depend on the tools you use to run your query, and whether you have specified any extra settings. - For more information, see "`Library path `__" in the QL language specification. + For more information, see "`Library path `__" in the QL language specification. If the compiler cannot resolve an import statement, then it gives a compilation error. @@ -158,7 +158,7 @@ Namespaces ********** When writing QL, it's useful to understand how namespaces (also known as -`environments `_) work. +`environments `_) work. As in many other programming languages, a namespace is a mapping from **keys** to **entities**. A key is a kind of identifier, for example a name, and a QL entity is @@ -185,7 +185,7 @@ In particular: - The **global module namespace** is empty. - The **global type namespace** has entries for the :ref:`primitive types ` ``int``, ``float``, ``string``, ``boolean``, and ``date``, as well as any :ref:`database types ` defined in the database schema. - - The **global predicate namespace** includes all the `built-in predicates `_, + - The **global predicate namespace** includes all the `built-in predicates `_, as well as any :ref:`database predicates `. In practice, this means that you can use the built-in types and predicates directly in a QL module (without @@ -301,7 +301,7 @@ The type namespace of ``S`` has entries for: The predicate namespace of ``Villagers`` has entries for: - The predicate ``isBald``, with arity 1. - Any predicates (and their arities) exported by ``tutorial``. - - The `built-in predicates `_. + - The `built-in predicates `_. The predicate namespace of ``S`` has entries for: - All the above predicates. diff --git a/docs/codeql/ql-language-reference/predicates.rst b/docs/codeql/ql-language-reference/predicates.rst index 0b725d14a76..9b7bb4d9a60 100644 --- a/docs/codeql/ql-language-reference/predicates.rst +++ b/docs/codeql/ql-language-reference/predicates.rst @@ -37,7 +37,7 @@ The `arity `_ of these predicates is one an In general, all tuples in a predicate have the same number of elements. The **arity** of a predicate is that number of elements, not including a possible ``result`` variable. For more information, see ":ref:`predicates-with-result`." -There are a number of `built-in predicates `_ +There are a number of `built-in predicates `_ in QL. You can use these in any queries without needing to :ref:`import ` any additional modules. In addition to these built-in predicates, you can also define your own: @@ -51,7 +51,7 @@ When defining a predicate, you should specify: #. The keyword ``predicate`` (for a :ref:`predicate without result `), or the type of the result (for a :ref:`predicate with result `). -#. The name of the predicate. This is an `identifier `_ +#. The name of the predicate. This is an `identifier `_ starting with a lowercase letter. #. The arguments to the predicate, if any, separated by commas. For each argument, specify the argument type and an identifier for the argument variable. diff --git a/docs/codeql/ql-language-reference/types.rst b/docs/codeql/ql-language-reference/types.rst index 405723b706e..ae37230f05c 100644 --- a/docs/codeql/ql-language-reference/types.rst +++ b/docs/codeql/ql-language-reference/types.rst @@ -50,7 +50,7 @@ independent of the database that you are querying. QL has a range of built-in operations defined on primitive types. These are available by using dispatch on expressions of the appropriate type. For example, ``1.toString()`` is the string representation of the integer constant ``1``. For a full list of built-in operations available in QL, see the -section on `built-ins `__ in the QL language specification. +section on `built-ins `__ in the QL language specification. .. index:: class .. _classes: @@ -76,7 +76,7 @@ Defining a class To define a class, you write: #. The keyword ``class``. -#. The name of the class. This is an `identifier `_ +#. The name of the class. This is an `identifier `_ starting with an uppercase letter. #. The types to extend. #. The :ref:`body of the class `, enclosed in braces. @@ -449,7 +449,7 @@ The branch definitions have the following form: () { } -- The type name and the branch names must be `identifiers `_ +- The type name and the branch names must be `identifiers `_ starting with an uppercase letter. Conventionally, they start with ``T``. - The different branches of an algebraic datatype are separated by ``or``. - The arguments to a branch, if any, are :ref:`variable declarations ` diff --git a/docs/codeql/ql-language-reference/variables.rst b/docs/codeql/ql-language-reference/variables.rst index 7fdc7506580..7f151a362e9 100644 --- a/docs/codeql/ql-language-reference/variables.rst +++ b/docs/codeql/ql-language-reference/variables.rst @@ -23,7 +23,7 @@ Declaring a variable ******************** All variable declarations consist of a :ref:`type ` and a name for the variable. -The name can be any `identifier `_ +The name can be any `identifier `_ that starts with an uppercase or lowercase letter. For example, ``int i``, ``SsaDefinitionNode node``, and ``LocalScopeVariable lsv`` declare diff --git a/docs/codeql/writing-codeql-queries/about-codeql-queries.rst b/docs/codeql/writing-codeql-queries/about-codeql-queries.rst index 39442f1823e..09124a61f90 100644 --- a/docs/codeql/writing-codeql-queries/about-codeql-queries.rst +++ b/docs/codeql/writing-codeql-queries/about-codeql-queries.rst @@ -13,7 +13,7 @@ CodeQL includes queries to find the most relevant and interesting problems for e - **Alert queries**: queries that highlight issues in specific locations in your code. - **Path queries**: queries that describe the flow of information between a source and a sink in your code. -You can add custom queries to `custom query packs `__ to analyze your projects in `LGTM `__, use them to analyze a database with the ":ref:`CodeQL CLI `," or you can contribute to the standard CodeQL queries in our `open source repository on GitHub `__. +You can add custom queries to :doc:`QL packs <../codeql-cli/about-ql-packs>` to analyze your projects with "`Code scanning `__", use them to analyze a database with the ":ref:`CodeQL CLI `," or you can contribute to the standard CodeQL queries in our `open source repository on GitHub `__. This topic is a basic introduction to query files. You can find more information on writing queries for specific programming languages in the ":ref:`CodeQL language guides `," and detailed technical information about QL in the ":ref:`QL language reference `." For more information on how to format your code when contributing queries to the GitHub repository, see the `CodeQL style guide `__. diff --git a/docs/codeql/writing-codeql-queries/cross-the-river.rst b/docs/codeql/writing-codeql-queries/cross-the-river.rst index 97fc080fedc..c94806f90e9 100644 --- a/docs/codeql/writing-codeql-queries/cross-the-river.rst +++ b/docs/codeql/writing-codeql-queries/cross-the-river.rst @@ -213,7 +213,7 @@ the given path without revisiting any previously visited states. revisiting any previous states, and there is a ``safeFerry`` action from the intermediate state to the result state. (Hint: To check whether a state has previously been visited, you could check if - there is an `index of `__ + there is an `index of `__ ``visitedStates`` at which the state occurs.) .. container:: toggle diff --git a/docs/codeql/writing-codeql-queries/introduction-to-ql.rst b/docs/codeql/writing-codeql-queries/introduction-to-ql.rst index e730610ed2c..83006046c14 100644 --- a/docs/codeql/writing-codeql-queries/introduction-to-ql.rst +++ b/docs/codeql/writing-codeql-queries/introduction-to-ql.rst @@ -55,7 +55,7 @@ You can write simple queries using the some of the basic functions that are avai Exercise 1 ~~~~~~~~~~ -Write a query which returns the length of the string ``"lgtm"``. (Hint: `here `__ is the list of the functions that can be applied to strings.) +Write a query which returns the length of the string ``"lgtm"``. (Hint: `here `__ is the list of the functions that can be applied to strings.) ➤ `See answer in the query console on LGTM.com `__