cleanup in API-graphs

This commit is contained in:
Erik Krogh Kristensen
2021-03-19 19:32:21 +01:00
parent 63f087a8e9
commit 91d28fb8b0

View File

@@ -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.