mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
@@ -4,16 +4,6 @@ private import semmle.python.dataflow.new.internal.DataFlowPrivate as DataFlowPr
|
|||||||
|
|
||||||
/** Gets the EssaNode that holds the module imported by the fully qualified module name `name` */
|
/** Gets the EssaNode that holds the module imported by the fully qualified module name `name` */
|
||||||
DataFlow::CfgNode module_import(string name) {
|
DataFlow::CfgNode module_import(string name) {
|
||||||
// exists(Variable var, Import imp, Alias alias |
|
|
||||||
// alias = imp.getAName() and
|
|
||||||
// alias.getAsname() = var.getAStore() and
|
|
||||||
// (
|
|
||||||
// name = alias.getValue().(ImportMember).getImportedModuleName()
|
|
||||||
// or
|
|
||||||
// name = alias.getValue().(ImportExpr).getImportedModuleName()
|
|
||||||
// ) and
|
|
||||||
// result.getVar().(AssignmentDefinition).getSourceVariable() = var
|
|
||||||
// )
|
|
||||||
exists(Variable var, AssignmentDefinition def, Import imp, Alias alias |
|
exists(Variable var, AssignmentDefinition def, Import imp, Alias alias |
|
||||||
var = def.getSourceVariable() and
|
var = def.getSourceVariable() and
|
||||||
result.getNode() = def.getDefiningNode() and
|
result.getNode() = def.getDefiningNode() and
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ module TrackedTest implements TestSig {
|
|||||||
not e.getLocation().getStartLine() = 0 and
|
not e.getLocation().getStartLine() = 0 and
|
||||||
// We do not wish to annotate scope entry definitions,
|
// We do not wish to annotate scope entry definitions,
|
||||||
// as they do not appear in the source code.
|
// as they do not appear in the source code.
|
||||||
// not e.asVar() instanceof ScopeEntryDefinition and
|
|
||||||
not e.asCfgNode() = any(ScopeEntryDefinition def).getDefiningNode() and
|
not e.asCfgNode() = any(ScopeEntryDefinition def).getDefiningNode() and
|
||||||
tag = "tracked" and
|
tag = "tracked" and
|
||||||
location = e.getLocation() and
|
location = e.getLocation() and
|
||||||
|
|||||||
Reference in New Issue
Block a user