mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
Refactor to use SummarizedCallable, sourceElement and sinkElement
This commit is contained in:
committed by
Owen Mansel-Chan
parent
ec3dd1e1c0
commit
da8f8e2eef
@@ -396,6 +396,13 @@ SourceOrSinkElement interpretElement(
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if there is an external specification for `f`. */
|
||||
predicate hasExternalSpecification(Function f) {
|
||||
f = any(SummarizedCallable sc).asFunction()
|
||||
or
|
||||
exists(SourceOrSinkElement e | f = e.asEntity() | sourceElement(e, _, _) or sinkElement(e, _, _))
|
||||
}
|
||||
|
||||
private predicate parseField(string c, DataFlow::FieldContent f) {
|
||||
specSplit(_, c, _) and
|
||||
exists(string fieldRegex, string package, string className, string fieldName |
|
||||
|
||||
@@ -713,11 +713,7 @@ module Public {
|
||||
or
|
||||
exists(c.(MethodCallNode).getTarget().getBody())
|
||||
or
|
||||
exists(string package, string type, string name |
|
||||
c.(MethodCallNode).getTarget().hasQualifiedName(package, type, name)
|
||||
|
|
||||
exists(interpretElement(package, type, _, name, "", _))
|
||||
)
|
||||
hasExternalSpecification(c.(DataFlow::MethodCallNode).getTarget())
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user