Skip to content

Commit 24615f2

Browse files
author
james
committed
docs: further review comments
1 parent 8d02a74 commit 24615f2

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

docs/language/ql-training/cpp/control-flow-cpp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Control flow graphs
8989
Modeling control flow
9090
=====================
9191

92-
The control flow is modeled with a QL class, ``ControlFlowNode``. Examples of control flow nodes include statements and expressions.
92+
The control flow is modeled with a CodeQL class, ``ControlFlowNode``. Examples of control flow nodes include statements and expressions.
9393

9494
- ``ControlFlowNode`` provides API for traversing the control flow graph:
9595

docs/language/ql-training/cpp/intro-ql-cpp.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ A simple CodeQL query
7070

7171
A `query <https://help.semmle.com/QL/ql-handbook/queries.html>`__ consists of a “select” clause that indicates what results should be returned. Typically it will also provide a “from” clause to declare some variables, and a “where” clause to state conditions over those variables. For more information on the structure of query files (including links to useful topics in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__), see `Introduction to query files <https://help.semmle.com/QL/learn-ql/ql/writing-queries/introduction-to-queries.html>`__.
7272

73-
In our example here, the first line of the query imports the `CodeQL for C/C++ standard library <https://help.semmle.com/qldoc/cpp/>`__, which defines concepts like ``IfStmt`` and ``Block``.
73+
In our example here, the first line of the query imports the `CodeQL library for C/C++ <https://help.semmle.com/qldoc/cpp/>`__, which defines concepts like ``IfStmt`` and ``Block``.
7474
The query proper starts by declaring two variables–ifStmt and block. These variables represent sets of values in the database, according to the type of each of the variables. For example, ifStmt has the type IfStmt, which means it represents the set of all if statements in the program.
7575

7676
If we simply selected these two variables::
@@ -135,10 +135,10 @@ A predicate allows you to pull out and name parts of a query.
135135

136136
You can imagine a predicate to be a self-contained from-where-select statement, that produces an intermediate relation, or table. In this case, the ``isEmpty`` predicate will be the set of all blocks which are empty.
137137

138-
Classes
139-
=======
138+
Classes in QL
139+
=============
140140

141-
A class allows you to name a set of values and define (member) predicates on them.
141+
A QL class allows you to name a set of values and define (member) predicates on them.
142142

143143
A class has at least one supertype and optionally a **characteristic predicate**; it contains the values that belong to *all* supertypes *and* satisfy the characteristic predicate, if provided.
144144

@@ -158,8 +158,8 @@ Member predicates are inherited and can be overridden.
158158

159159
In the example, declaring a variable “EmptyBlock e” will allow it to range over only those blocks that have zero statements.
160160

161-
Classes continued
162-
=================
161+
Classes in QL continued
162+
=======================
163163

164164
.. container:: column-left
165165

docs/language/ql-training/cpp/program-representation-cpp.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ Agenda
2121

2222
.. resume slides
2323
24-
AST classes
25-
===========
24+
AST CodeQL classes
25+
==================
2626

27-
Important AST classes include:
27+
Important AST CodeQL classes include:
2828

2929
- ``Expr``: expressions such as assignments, variable references, function calls, ...
3030
- ``Stmt``: statements such as conditionals, loops, try statements, ...
3131
- ``DeclarationEntry``: places where functions, variables or types are declared and/or defined
3232

33-
These three (and all other AST classes) are subclasses of ``Element``.
33+
These three (and all other AST CodeQL classes) are subclasses of ``Element``.
3434

3535
Symbol table
3636
============
@@ -64,7 +64,7 @@ Working with functions
6464

6565
Functions are represented by the Function class. Each declaration or definition of a function is represented by a ``FunctionDeclarationEntry``.
6666

67-
Calls to functions are modeled by class ``Call`` and its subclasses:
67+
Calls to functions are modeled by CodeQL class ``Call`` and its subclasses:
6868

6969
- ``Call.getTarget()`` gets the declared target of the call; undefined for calls through function pointers
7070
- ``Function.getACallToThisFunction()`` gets a call to this function

docs/language/ql-training/java/intro-ql-java.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ A simple CodeQL query
7070

7171
A `query <https://help.semmle.com/QL/ql-handbook/queries.html>`__ consists of a “select” clause that indicates what results should be returned. Typically it will also provide a “from” clause to declare some variables, and a “where” clause to state conditions over those variables. For more information on the structure of query files (including links to useful topics in the `QL language handbook <https://help.semmle.com/QL/ql-handbook/index.html>`__), see `Introduction to query files <https://help.semmle.com/QL/learn-ql/ql/writing-queries/introduction-to-queries.html>`__.
7272

73-
In our example here, the first line of the query imports the `CodeQL for Java library <https://help.semmle.com/qldoc/java/>`__, which defines concepts like ``IfStmt`` and ``Block``.
73+
In our example here, the first line of the query imports the `CodeQL library for Java <https://help.semmle.com/qldoc/java/>`__, which defines concepts like ``IfStmt`` and ``Block``.
7474
The query proper starts by declaring two variables–ifStmt and block. These variables represent sets of values in the database, according to the type of each of the variables. For example, ``ifStmt`` has the type ``IfStmt``, which means it represents the set of all if statements in the program.
7575

7676
If we simply selected these two variables::
@@ -135,10 +135,10 @@ A predicate allows you to pull out and name parts of a query.
135135
You can imagine a predicate to be a self-contained from-where-select statement, that produces an intermediate relation, or table. In this case, the ``isEmpty`` predicate will be the set of all blocks which are empty.
136136

137137

138-
Classes
139-
=======
138+
Classes in QL
139+
=============
140140

141-
A class allows you to name a set of values and define (member) predicates on them.
141+
A QL class allows you to name a set of values and define (member) predicates on them.
142142

143143
A class has at least one supertype and optionally a **characteristic predicate**; it contains the values that belong to *all* supertypes *and* satisfy the characteristic predicate, if provided.
144144

@@ -158,7 +158,7 @@ Member predicates are inherited and can be overridden.
158158

159159
In the example, declaring a variable “EmptyBlock e” will allow it to range over only those blocks that have zero statements.
160160

161-
Classes continued
161+
Classes in QL continued
162162
=======================
163163

164164
.. container:: column-left

docs/language/ql-training/java/program-representation-java.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Agenda
1212
- Abstract syntax trees
1313
- Database representation
1414
- Program elements
15-
- AST classes
15+
- AST CodeQL classes
1616

1717
.. insert abstract-syntax-tree.rst
1818
@@ -23,15 +23,15 @@ Agenda
2323
Program elements
2424
================
2525

26-
- The QL class ``Element`` represents program elements with a name.
26+
- The CodeQL class ``Element`` represents program elements with a name.
2727
- This includes: packages (``Package``), compilation units (``CompilationUnit``), types (``Type``), methods (``Method``), constructors (``Constructor``), and variables (``Variable``).
2828
- It is often convenient to refer to an element that might either be a method or a constructor; the class ``Callable``, which is a common superclass of ``Method`` and ``Constructor``, can be used for this purpose.
2929

3030

3131
AST
3232
===
3333

34-
There are two primary AST classes, used within ``Callables``:
34+
There are two primary AST CodeQL classes, used within ``Callables``:
3535

3636
- ``Expr``: expressions such as assignments, variable references, function calls, ...
3737
- ``Stmt``: statements such as conditionals, loops, try statements, ...
@@ -47,7 +47,7 @@ Types
4747

4848
The database also includes information about the types used in a program:
4949

50-
- ``PrimitiveType`` represents a `primitive type <http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html>`__, that is, one of ``boolean``, ``byte``, ``char``, ``double``, ``float``, ``int``, ``long``, ``short``. QL also classifies ``void`` and ``<nulltype>`` (the type of the ``null`` literal) as primitive types.
50+
- ``PrimitiveType`` represents a `primitive type <http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html>`__, that is, one of ``boolean``, ``byte``, ``char``, ``double``, ``float``, ``int``, ``long``, ``short``. CodeQL also classifies ``void`` and ``<nulltype>`` (the type of the ``null`` literal) as primitive types.
5151
- ``RefType`` represents a reference type; it has several subclasses:
5252

5353
- ``Class`` represents a Java class.
@@ -74,9 +74,9 @@ Working with variables
7474
Working with callables
7575
======================
7676

77-
Callables are represented by the ``Callable`` QL class.
77+
Callables are represented by the ``Callable`` CodeQL class.
7878

79-
Calls to callables are modeled by the QL class ``Call`` and its subclasses:
79+
Calls to callables are modeled by the CodeQL class ``Call`` and its subclasses:
8080

8181
- ``Call.getCallee()`` gets the declared target of the call
8282
- ``Call.getAReference()`` gets a call to this function

docs/language/ql-training/java/query-injection-java.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ Let’s start by looking for calls to methods with names of the form ``sparql*Qu
7777

7878
.. note::
7979

80-
- When performing `variant analysis <https://semmle.com/ variant-analysis>`__, it is usually helpful to write a simple query that finds the simple syntactic pattern, before trying to go on to describe the cases where it goes wrong.
81-
- In this case, we start by looking for all the method calls which appear to run, before trying to refine the query to find cases which are vulnerable to query injection.
80+
- When performing `variant analysis <https://semmle.com/variant-analysis>`__, it is usually helpful to write a simple query that finds the simple syntactic pattern, before trying to go on to describe the cases where it goes wrong.
81+
- In this case, we start by looking for all the method calls that appear to run, before trying to refine the query to find cases which are vulnerable to query injection.
8282
- The ``select`` clause defines what this query is looking for:
8383

8484
- a ``MethodAccess``: the call to a SPARQL query method
8585
- a ``Method``: the SPARQL query method.
8686

87-
- The ``where`` part of the query ties these variables together using `predicates <https://help.semmle.com/QL/ql-handbook/predicates.html>`__ defined in the `standard CodeQL for Java library <https://help.semmle.com/qldoc/java/>`__.
87+
- The ``where`` part of the query ties these variables together using `predicates <https://help.semmle.com/QL/ql-handbook/predicates.html>`__ defined in the `standard CodeQL library for Java <https://help.semmle.com/qldoc/java/>`__.
8888

8989
CodeQL query: find string concatenation
9090
=======================================

docs/language/ql-training/slide-snippets/local-data-flow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Local vs global data flow
7070

7171
For further information, see:
7272

73-
- `Introduction to data flow analysis in CodeQL <https://help.semmle.com/QL/learn-ql/ql/intro-to-data-flow.html>`__
73+
- `Introduction to data flow analysis with CodeQL <https://help.semmle.com/QL/learn-ql/ql/intro-to-data-flow.html>`__
7474

7575
.. rst-class:: background2
7676

0 commit comments

Comments
 (0)