From 9705e0067647c7a34274aa7c56de91d2cea609fe Mon Sep 17 00:00:00 2001 From: Shati Patel Date: Tue, 28 Apr 2020 13:48:46 +0100 Subject: [PATCH 1/2] Docs: Delete "Technical information" articles --- docs/language/learn-ql/database.rst | 33 ------------------- docs/language/learn-ql/index.rst | 1 - docs/language/learn-ql/technical-info.rst | 9 ----- .../slide-snippets/intro-ql-general.rst | 2 +- 4 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 docs/language/learn-ql/database.rst delete mode 100644 docs/language/learn-ql/technical-info.rst diff --git a/docs/language/learn-ql/database.rst b/docs/language/learn-ql/database.rst deleted file mode 100644 index 369b1d73fb0..00000000000 --- a/docs/language/learn-ql/database.rst +++ /dev/null @@ -1,33 +0,0 @@ -What's in a CodeQL database? -============================ - -A CodeQL database contains a variety of data related to a particular code base at a particular point in time. For details of how the database is generated see `Database generation `__ on LGTM.com. - -The database contains a full, hierarchical representation of the program defined by the code base. The database schema varies according to the language analyzed. The schema provides an interface between the initial lexical analysis during the extraction process, and the actual complex analysis using CodeQL. When the source code languages being analyzed change (such as Java 7 evolving into Java 8), this interface between the analysis phases can also change. - -For each language, a CodeQL library defines classes to provide a layer of abstraction over the database tables. This provides an object-oriented view of the data which makes it easier to write queries. This is easiest to explain using an example. - -Example -------- - -For a Java program, two key tables are: - -- The ``expressions`` table containing a row for every single expression in the source code that was analyzed during the build process. -- The ``statements`` table containing a row for every single statement in the source code that was analyzed during the build process. - -The CodeQL library defines classes to provide a layer of abstraction over each of these tables (and the related auxiliary tables): ``Expr`` and ``Stmt``. - -Most classes in the library are similar: they are abstractions over one or more database tables. Looking at one of the libraries illustrates this: - -.. code-block:: ql - - class Expr extends StmtParent, @expr { - ... - - /** the location of this expression */ - Location getLocation() { exprs(this,_,_,result) } - - ... - } - -The ``Expr`` class, shown here, extends from the database type ``@expr``. Member predicates of the ``Expr`` class are implemented in terms of the database-provided ``exprs`` table. diff --git a/docs/language/learn-ql/index.rst b/docs/language/learn-ql/index.rst index e5617299436..e62dfbb3c58 100644 --- a/docs/language/learn-ql/index.rst +++ b/docs/language/learn-ql/index.rst @@ -27,7 +27,6 @@ CodeQL is based on a powerful query language called QL. The following topics hel javascript/ql-for-javascript python/ql-for-python ql-training - technical-info .. toctree:: :hidden: diff --git a/docs/language/learn-ql/technical-info.rst b/docs/language/learn-ql/technical-info.rst deleted file mode 100644 index 7494011f7c6..00000000000 --- a/docs/language/learn-ql/technical-info.rst +++ /dev/null @@ -1,9 +0,0 @@ -Technical information -===================== - -.. toctree:: - :hidden: - - database - -- :doc:`What's in a CodeQL database? ` \ No newline at end of file diff --git a/docs/language/ql-training/slide-snippets/intro-ql-general.rst b/docs/language/ql-training/slide-snippets/intro-ql-general.rst index f03c0300e25..63c2a414451 100644 --- a/docs/language/ql-training/slide-snippets/intro-ql-general.rst +++ b/docs/language/ql-training/slide-snippets/intro-ql-general.rst @@ -103,7 +103,7 @@ Analysis overview CodeQL analysis works by extracting a queryable database from your project. For compiled languages, the tools observe an ordinary build of the source code. Each time a compiler is invoked to process a source file, a copy of that file is made, and all relevant information about the source code (syntactic data about the abstract syntax tree, semantic data like name binding and type information, data on the operation of the C preprocessor, etc.) is collected. For interpreted languages, the extractor gathers similar information by running directly on the source code. Multi-language code bases are analyzed one language at a time. - Once the extraction finishes, all this information is collected into a single `CodeQL database `__, which is then ready to query, possibly on a different machine. A copy of the source files, made at the time the database was created, is also included in the CodeQL database so analysis results can be displayed at the correct location in the code. The database schema is (source) language specific. + Once the extraction finishes, all this information is collected into a single `CodeQL database `__, which is then ready to query, possibly on a different machine. A copy of the source files, made at the time the database was created, is also included in the CodeQL database so analysis results can be displayed at the correct location in the code. The database schema is (source) language specific. Queries are written in QL and usually depend on one or more of the `standard CodeQL libraries `__ (and of course you can write your own custom libraries). They are compiled into an efficiently executable format by the QL compiler and then run on a CodeQL database by the QL evaluator, either on a remote worker machine or locally on a developer’s machine. From e18357525f7f136010e009970ff6999bc6767d65 Mon Sep 17 00:00:00 2001 From: Shati Patel Date: Tue, 28 Apr 2020 14:11:36 +0100 Subject: [PATCH 2/2] Fix link --- docs/language/learn-ql/terminology-note.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/language/learn-ql/terminology-note.rst b/docs/language/learn-ql/terminology-note.rst index 552d7b2789c..15dba5a6291 100644 --- a/docs/language/learn-ql/terminology-note.rst +++ b/docs/language/learn-ql/terminology-note.rst @@ -24,4 +24,4 @@ QL is a general-purpose, object-oriented language that can be used to query any CodeQL databases ---------------- -QL snapshots have been renamed CodeQL databases. :doc:`CodeQL databases ` contain relational data created and analyzed using CodeQL. They are the equivalent of QL snapshots, but have been optimized for use with the CodeQL tools. +QL snapshots have been renamed CodeQL databases. `CodeQL databases `__ contain relational data created and analyzed using CodeQL. They are the equivalent of QL snapshots, but have been optimized for use with the CodeQL tools.