From 429decd7b6b258ef060623ee409a5a11bed9ebd8 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 18 Aug 2021 11:38:03 +0100 Subject: [PATCH] tweak sojme text --- .../debugging-a-data-flow-query-using-partial-flow.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/codeql/writing-codeql-queries/debugging-a-data-flow-query-using-partial-flow.rst b/docs/codeql/writing-codeql-queries/debugging-a-data-flow-query-using-partial-flow.rst index c8ab639d744..fb69703dad8 100644 --- a/docs/codeql/writing-codeql-queries/debugging-a-data-flow-query-using-partial-flow.rst +++ b/docs/codeql/writing-codeql-queries/debugging-a-data-flow-query-using-partial-flow.rst @@ -5,6 +5,7 @@ Debugging data-flow queries using partial flow If a data-flow query unexpectedly produces no results, you can use partial flow to debug the problem. +In CodeQL, you can use :ref:`data flow analysis ` to compute the possible values that a variable can hold at various points in a program. A typical data-flow query looks like this: .. code-block:: ql @@ -31,10 +32,13 @@ Or slightly simpler without path explanations: where config.hasPath(source, sink) select sink, "Sink is reached from $@.", source.getNode(), "here" +If a data-flow query that you have written does not produce any results when you expect it to, there may be a problem with your query. +You can try to debug the potential problem by following the steps described below. + Checking sources and sinks -------------------------- -As a first step, make sure that the source and sink definitions contain what you expect. If one of these is empty then there can never be any data flow. The easiest way to verify this is using quick evaluation: Select the text ``node instanceof MySource``, right-click, and choose "CodeQL: Quick Evaluation". This will evaluate the highlighted text, which in this case means the set of sources. +As a first step, make sure that the source and sink definitions contain what you expect. If one of these is empty then there can never be any data flow. The easiest way to verify this is using quick evaluation in CodeQL for VS Code: Select the text ``node instanceof MySource``, right-click, and choose "CodeQL: Quick Evaluation". This will evaluate the highlighted text, which in this case means the set of sources. If both source and sink definitions look good then we will need to look for missing flow steps.