mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #8200 from RasmusWL/debug-partial-flow-snippet
Python: Add `debug partial flow` snippet
This commit is contained in:
38
python/.vscode/ql.code-snippets
vendored
38
python/.vscode/ql.code-snippets
vendored
@@ -222,26 +222,6 @@
|
||||
],
|
||||
"description": "Type tracking class (select full class path before inserting)",
|
||||
},
|
||||
"foo": {
|
||||
"scope": "ql",
|
||||
"prefix": "foo",
|
||||
"body": [
|
||||
" /**",
|
||||
" * Taint propagation for `$1`.",
|
||||
" */",
|
||||
" private class InstanceTaintSteps extends InstanceTaintStepsHelper {",
|
||||
" InstanceTaintSteps() { this = \"$1\" }",
|
||||
"",
|
||||
" override DataFlow::Node getInstance() { result = instance() }",
|
||||
"",
|
||||
" override string getAttributeName() { none() }",
|
||||
"",
|
||||
" override string getMethodName() { none() }",
|
||||
"",
|
||||
" override string getAsyncMethodName() { none() }",
|
||||
" }",
|
||||
],
|
||||
},
|
||||
"API graph .getMember chain": {
|
||||
"scope": "ql",
|
||||
"prefix": "api graph .getMember chain",
|
||||
@@ -250,4 +230,22 @@
|
||||
],
|
||||
"description": "API graph .getMember chain (select full path before inserting)",
|
||||
},
|
||||
"debug partial flow": {
|
||||
"scope": "ql",
|
||||
"prefix": "debug partial flow",
|
||||
"body": [
|
||||
"// put the line below inside the configuration",
|
||||
"// override int explorationLimit() { result = 5 }",
|
||||
"// and then run quick evaluation on the predicate below",
|
||||
"// (and potentially limit the set of sources)",
|
||||
"predicate debugPartialFlow(Location loc, DataFlow::PartialPathNode node, int dist) {",
|
||||
" loc = node.getNode().getLocation() and",
|
||||
" exists(loc.getFile().getRelativePath()) and",
|
||||
" exists(Configuration config, DataFlow::PartialPathNode source |",
|
||||
" config.hasPartialFlow(source, node, dist)",
|
||||
" )",
|
||||
"}",
|
||||
],
|
||||
"description": "debug partial flow",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user