Filter result by number of steps in path #19981
Unanswered
Hug0Vincent
asked this question in
Q&A
Replies: 1 comment
-
I made this but is there a better way to do this ? Because it takes a lot of time on some databases. I tried to pass an integer as a parameter but I got some issues regarding inlining / recursion and constraints. int pathLengthBetweenNodes(MyFlow::PathNode src, MyFlow::PathNode dst) {
(result = 0 and src = dst)
or
exists(MyFlow::PathNode intermediate |
intermediate.getASuccessor() = dst and
result <= 42 and
result = pathLengthBetweenNodes(src, intermediate) + 1
)
}
module MyFlow = TaintTracking::Global<MyConfig>; // or DataFlow::Global<..>
from MyFlow::PathNode source, MyFlow::PathNode sink
where MyFlow::flowPath(source, sink)
pathLengthBetweenNodes(source, sink) <= 42
select sink.getNode(), source, sink, "Sample TaintTracking query" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to filter path-based problem query results by the number of steps in the path from the source to the sink? I have numerous results, making it impossible to display them all in VSCode. I want to retain only those paths with a length of 30 steps or fewer. Is this feasible? In VSCode, the number of steps is displayed, but I'm unsure if I can directly filter this in my CodeQL query.
Beta Was this translation helpful? Give feedback.
All reactions