tweak sojme text

This commit is contained in:
james
2021-08-18 11:38:03 +01:00
parent ad2850dd5d
commit 429decd7b6

View File

@@ -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 <about-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.