mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
cleanup in API-graphs
This commit is contained in:
@@ -374,15 +374,13 @@ module API {
|
||||
exists(SSA::implicitInit([nm.getModuleVariable(), nm.getExportsVariable()]))
|
||||
)
|
||||
)
|
||||
or
|
||||
m = any(CanonicalName n | isDefined(n)).getExternalModuleName()
|
||||
} or
|
||||
MkModuleImport(string m) {
|
||||
imports(_, m)
|
||||
or
|
||||
m = any(CanonicalName n | isUsed(n)).getExternalModuleName()
|
||||
or
|
||||
any(TypeAnnotation n).hasQualifiedName(m, _)
|
||||
or
|
||||
any(Type t).hasUnderlyingType(m, _)
|
||||
} or
|
||||
MkClassInstance(DataFlow::ClassNode cls) { cls = trackDefNode(_) and hasSemantics(cls) } or
|
||||
MkAsyncFuncResult(DataFlow::FunctionNode f) {
|
||||
@@ -431,20 +429,6 @@ module API {
|
||||
)
|
||||
}
|
||||
|
||||
private predicate isUsed(CanonicalName n) {
|
||||
exists(n.(TypeName).getAnAccess()) or
|
||||
exists(n.(Namespace).getAnAccess())
|
||||
}
|
||||
|
||||
private predicate isDefined(CanonicalName n) {
|
||||
exists(ASTNode def |
|
||||
def = n.(TypeName).getADefinition() or
|
||||
def = n.(Namespace).getADefinition()
|
||||
|
|
||||
not def.isAmbient()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `rhs` is the right-hand side of a definition of a node that should have an
|
||||
* incoming edge from `base` labeled `lbl` in the API graph.
|
||||
|
||||
Reference in New Issue
Block a user