Skip to content

Commit b267df0

Browse files
author
Shati Patel
committed
Address review comments + make article intro consistent with map topic
1 parent 26f15b8 commit b267df0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Introduction to QL
22
==================
33

4-
Work through some simple exercises to learn about the basics of QL and CodeQL.
4+
Work through some simple exercises and examples to learn about the basics of QL and CodeQL.
55

66
Basic syntax
77
------------
@@ -12,6 +12,9 @@ QL is a logic programming language, so it is built up of logical formulas. QL us
1212

1313
QL also supports recursion and aggregates. This allows you to write complex recursive queries using simple QL syntax and directly use aggregates such as ``count``, ``sum``, and ``average``.
1414

15+
Running a query
16+
---------------
17+
1518
You can try out the following examples and exercises using `CodeQL for VS Code <https://help.semmle.com/codeql/codeql-for-vscode.html>`__, or you can run them in the `query console on LGTM.com <https://lgtm.com/query>`__. Before you can run a query on LGTM.com, you need to select a language and project to query (for these logic examples, any language and project will do).
1619

1720
Once you have selected a language, the query console is populated with the query:
@@ -45,7 +48,7 @@ Note that ``int`` specifies that the **type** of ``x`` and ``y`` is 'integer'. T
4548
Simple exercises
4649
----------------
4750

48-
You can try to write simple queries using the some of the basic functions that are available for the ``int``, ``date``, ``float``, ``boolean`` and ``string`` types. To apply a function, append it to the argument. For example, ``1.toString()`` converts the value ``1`` to a string. Notice that as you start typing a function, a pop-up is displayed making it easy to select the function that you want. Also note that you can apply multiple functions in succession. For example, ``100.log().sqrt()`` first takes the natural logarithm of 100 and then computes the square root of the result.
51+
You can write simple queries using the some of the basic functions that are available for the ``int``, ``date``, ``float``, ``boolean`` and ``string`` types. To apply a function, append it to the argument. For example, ``1.toString()`` converts the value ``1`` to a string. Notice that as you start typing a function, a pop-up is displayed making it easy to select the function that you want. Also note that you can apply multiple functions in succession. For example, ``100.log().sqrt()`` first takes the natural logarithm of 100 and then computes the square root of the result.
4952

5053
Exercise 1
5154
~~~~~~~~~~
@@ -113,7 +116,8 @@ To simplify the query, we can introduce a class ``SmallInt`` representing the in
113116
Example CodeQL queries
114117
----------------------
115118

116-
The previous examples used the primitive types built in to QL. Although we chose a project to query, they did not use the project-specific database. The following example queries *do* use these databases and give you an idea of how CodeQL is used to analyze projects.
119+
The previous examples used the primitive types built in to QL. Although we chose a project to query, we didn't use the information in that project's database.
120+
The following example queries *do* use these databases and give you an idea of how to use CodeQL to analyze projects.
117121

118122
Queries using the CodeQL libraries can find errors and uncover variants of important security vulnerabilities in codebases.
119123
Visit `GitHub Security Lab <https://securitylab.github.com/>`__ to read about examples of vulnerabilities that we have recently found in open source projects.

0 commit comments

Comments
 (0)