mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
16 lines
454 B
Plaintext
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)
|