Files
codeql/python/ql/test/library-tests/ControlFlow/PointsToSupport/UseFromDefinition.ql
Taus Brock-Nannestad f07a7bf8cf Python: Autoformat everything using qlformat.
Will need subsequent PRs fixing up test failures (due to deprecated
methods moving around), but other than that everything should be
straight-forward.
2020-07-07 15:43:52 +02:00

16 lines
454 B
Plaintext

import python
/*Find any Definition, assigned value pairs that 'valueForDefinition' misses */
Expr assignedValue(Name n) {
exists(Assign a | a.getATarget() = n and result = a.getValue())
or
exists(Alias a | a.getAsname() = n and result = a.getValue())
}
from Name def, DefinitionNode d
where
d = def.getAFlowNode() and
exists(assignedValue(def)) and
not d.getValue().getNode() = assignedValue(def)
select def.toString(), assignedValue(def)