Skip to content

Commit e1c2f46

Browse files
authored
Merge pull request #8200 from RasmusWL/debug-partial-flow-snippet
Python: Add `debug partial flow` snippet
2 parents f047707 + b17c769 commit e1c2f46

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

python/.vscode/ql.code-snippets

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -222,26 +222,6 @@
222222
],
223223
"description": "Type tracking class (select full class path before inserting)",
224224
},
225-
"foo": {
226-
"scope": "ql",
227-
"prefix": "foo",
228-
"body": [
229-
" /**",
230-
" * Taint propagation for `$1`.",
231-
" */",
232-
" private class InstanceTaintSteps extends InstanceTaintStepsHelper {",
233-
" InstanceTaintSteps() { this = \"$1\" }",
234-
"",
235-
" override DataFlow::Node getInstance() { result = instance() }",
236-
"",
237-
" override string getAttributeName() { none() }",
238-
"",
239-
" override string getMethodName() { none() }",
240-
"",
241-
" override string getAsyncMethodName() { none() }",
242-
" }",
243-
],
244-
},
245225
"API graph .getMember chain": {
246226
"scope": "ql",
247227
"prefix": "api graph .getMember chain",
@@ -250,4 +230,22 @@
250230
],
251231
"description": "API graph .getMember chain (select full path before inserting)",
252232
},
233+
"debug partial flow": {
234+
"scope": "ql",
235+
"prefix": "debug partial flow",
236+
"body": [
237+
"// put the line below inside the configuration",
238+
"// override int explorationLimit() { result = 5 }",
239+
"// and then run quick evaluation on the predicate below",
240+
"// (and potentially limit the set of sources)",
241+
"predicate debugPartialFlow(Location loc, DataFlow::PartialPathNode node, int dist) {",
242+
" loc = node.getNode().getLocation() and",
243+
" exists(loc.getFile().getRelativePath()) and",
244+
" exists(Configuration config, DataFlow::PartialPathNode source |",
245+
" config.hasPartialFlow(source, node, dist)",
246+
" )",
247+
"}",
248+
],
249+
"description": "debug partial flow",
250+
},
253251
}

0 commit comments

Comments
 (0)