Skip to content

Commit e09774b

Browse files
committed
Address technical review feedback
1 parent 2a9904d commit e09774b

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

docs/codeql/codeql-cli/analyzing-databases-with-the-codeql-cli.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ These are stored alongside the code scanning suites with names of the form: ``<l
143143
For information about creating custom query suites, see ":doc:`Creating
144144
CodeQL query suites <creating-codeql-query-suites>`."
145145

146-
Diagnostic information
147-
......................
146+
Diagnostic and summary information
147+
..................................
148148

149-
The code scanning query suites include additional diagnostic queries. When the database analysis is complete, the CLI generates the results file and reports any diagnostic data to standard output. If you choose to generate SARIF output, the diagnostic data is also included as `notification objects <https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317894>`__ in the SARIF file.
149+
The code scanning query suites include additional diagnostic and summary queries. When the database analysis is complete, the CLI generates the results file and reports any diagnostic and summary data to standard output. If you choose to generate SARIF output, the additional data is also included in the SARIF file.
150150

151-
If the analysis found fewer results for standard queries than you expected, review the results of the diagnostic queries to check whether the CodeQL database is likely to be a good representation of the codebase that you want to analyze.
151+
If the analysis found fewer results for standard queries than you expected, review the results of the diagnostic and summary queries to check whether the CodeQL database is likely to be a good representation of the codebase that you want to analyze.
152152

153153
Running all queries in a directory
154154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/codeql/codeql-cli/using-custom-queries-with-the-codeql-cli.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ following two properties to ensure that the results are interpreted correctly:
3333

3434
- Query identifier (``@id``): a sequence of words composed of lowercase letters or
3535
digits, delimited by ``/`` or ``-``, identifying and classifying the query.
36-
- Query type (``@kind``): identifies the query is an alert (``@kind problem``),
37-
a path (``@kind path-problem``), or a diagnostic metric (``@kind diagnostic``).
36+
- Query type (``@kind``): identifies the query as a simple alert (``@kind problem``),
37+
an alert documented by a sequence of code locations (``@kind path-problem``),
38+
for extractor troubleshooting (``@kind diagnostic``), or a summary metric
39+
(``@kind metric`` and ``@tags summary``).
3840

3941
For more information about these metadata properties, see ":ref:`Metadata for CodeQL queries
4042
<metadata-for-codeql-queries>`" and the `Query metadata style guide

docs/codeql/writing-codeql-queries/about-codeql-queries.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ Query metadata is used to identify your custom queries when they are added to th
5757

5858
Queries that are contributed to the open source repository, added to a query pack in LGTM, or used to analyze a database with the :ref:`CodeQL CLI <codeql-cli>` must have a query type (``@kind``) specified. The ``@kind`` property indicates how to interpret and display the results of the query analysis:
5959

60-
- Alert query metadata must contain ``@kind problem``.
61-
- Diagnostic query metadata must contain ``@kind diagnostic``.
62-
- Path query metadata must contain ``@kind path-problem``.
60+
- Alert query metadata must contain ``@kind problem`` to identify the results as a simple alert.
61+
- Path query metadata must contain ``@kind path-problem`` to identify the results as an alert documented by a sequence of code locations.
62+
- Diagnostic query metadata must contain ``@kind diagnostic`` to identify the results as troubleshooting data about the extraction process.
63+
- Summary query metadata must contain ``@kind metric`` and ``@tags summary`` to identify the results as summary metrics for the CodeQL database.
6364

6465
When you define the ``@kind`` property of a custom query you must also ensure that the rest of your query has the correct structure in order to be valid, as described below.
6566

@@ -115,7 +116,7 @@ You can modify the alert message defined in the final column of the ``select`` s
115116

116117
Select clauses for path queries (``@kind path-problem``) are crafted to display both an alert and the source and sink of an associated path graph. For more information, see ":doc:`Creating path queries <creating-path-queries>`."
117118

118-
Select clauses for diagnostic queries (``@kind diagnostic``) have different requirements. For examples, see the `diagnostic queries in the CodeQL repository <https://github.com/github/codeql/search?q=%22%40kind+diagnostic%22>`__.
119+
Select clauses for diagnostic queries (``@kind diagnostic``) and summary metric queries (``@kind metric`` and ``@tags summary``) have different requirements. For examples, see the `diagnostic queries <https://github.com/github/codeql/search?q=%22%40kind+diagnostic%22>`__ and the `summary metric queries <https://github.com/github/codeql/search?q=%22%40kind+metric%22+%22%40tags+summary%22>`__ in the CodeQL repository.
119120

120121
Viewing the standard CodeQL queries
121122
***********************************

0 commit comments

Comments
 (0)