You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/codeql-cli/analyzing-databases-with-the-codeql-cli.rst
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,11 @@ You can also specify:
63
63
language to the GitHub code scanning API. For more information about this use case,
64
64
see `Configuring CodeQL CLI in your CI system <https://docs.github.com/en/code-security/secure-coding/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system>`__ in the GitHub documentation.
65
65
66
+
- ``--sarif-add-query-help``: (supported in version 2.7.1 onwards) adds any custom query help written
67
+
in markdown to SARIF files (v2.1.0 or later) generated by the analysis. Query help stored in ``.qhelp`` files must be
68
+
converted to ``.md`` before running the analysis. For further information,
69
+
see ":ref:`Including query help for custom CodeQL queries in SARIF files <including-query-help-for-custom-codeql-queries-in-sarif-files>`."
If you use the CodeQL CLI to to run code scanning analyses on third party CI/CD systems,
215
+
you can include the query help for your custom queries in SARIF files generated during an analysis.
216
+
After uploading the SARIF file to GitHub, the query help is shown in the code scanning UI for any
217
+
alerts generated by the custom queries.
218
+
219
+
From CodeQL CLI 2.7.1 onwards, you can include markdown-rendered query help in SARIF files
220
+
by providing the ``--sarif-add-query-help`` option when running
221
+
``codeql database analyze``.
222
+
For more information, see `Configuring CodeQL CLI in your CI system <https://docs.github.com/en/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system#analyzing-a-codeql-database>`
223
+
in the GitHub documentation.
224
+
225
+
You can write query help for custom queries directly in a markdown file and save it alongside the
226
+
corresponding query. Alternatively, for consistency with the standard CodeQL queries,
227
+
you can write query help in the ``.qhelp`` format. Query help written in ``.qhelp``
228
+
files can't be included in SARIF files, and they can't be processed by code
229
+
scanning so must be converted to markdown before running
230
+
the analysis. For more information, see ":ref:`Query help files <query-help-files>`"
231
+
and ":doc:`Testing query help files <testing-query-help-files>`."
Copy file name to clipboardExpand all lines: docs/codeql/writing-codeql-queries/debugging-data-flow-queries-using-partial-flow.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,6 @@ A typical data-flow query looks like this:
10
10
11
11
.. code-block:: ql
12
12
13
-
::
14
13
15
14
class MyConfig extends TaintTracking::Configuration {
16
15
MyConfig() { this = "MyConfig" }
@@ -79,7 +78,8 @@ To avoid these problems, a data-flow ``Configuration`` comes with a mechanism fo
79
78
*/
80
79
final predicate hasPartialFlow(PartialPathNode source, PartialPathNode node, int dist) {
81
80
82
-
As noted in the documentation for ``hasPartialFlow`` (for example, in the `CodeQL for Java documentation <https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/dataflow/internal/DataFlowImpl2.qll/predicate.DataFlowImpl2$Configuration$hasPartialFlow.3.html>__`) you must first enable this by adding an override of ``explorationLimit``. For example:
81
+
As noted in the documentation for ``hasPartialFlow`` (for example, in the
82
+
`CodeQL for Java documentation <https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/dataflow/internal/DataFlowImpl2.qll/predicate.DataFlowImpl2$Configuration$hasPartialFlow.3.html>`__) you must first enable this by adding an override of ``explorationLimit``. For example:
0 commit comments