Skip to content

Commit 5626427

Browse files
committed
Python: Add "debug partial flow" snippet
1 parent 7d55771 commit 5626427

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

python/.vscode/ql.code-snippets

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,22 @@
250250
],
251251
"description": "API graph .getMember chain (select full path before inserting)",
252252
},
253+
"debug partial flow": {
254+
"scope": "ql",
255+
"prefix": "debug partial flow",
256+
"body": [
257+
"// put the line below inside the configuration",
258+
"// override int explorationLimit() { result = 5 }",
259+
"// and then run quick evaluation on the predicate below",
260+
"// (and potentially limit the set of sources)",
261+
"predicate debugPartialFlow(Location loc, DataFlow::PartialPathNode node, int dist) {",
262+
" loc = node.getNode().getLocation() and",
263+
" exists(loc.getFile().getRelativePath()) and",
264+
" exists(Configuration config, DataFlow::PartialPathNode source |",
265+
" config.hasPartialFlow(source, node, dist)",
266+
" )",
267+
"}",
268+
],
269+
"description": "debug partial flow",
270+
},
253271
}

0 commit comments

Comments
 (0)