Java: Exclude qualifier argument for existing models

Excludes candadites for `Argument[this]` where we already have a model that covers a
different argument of the containing call.
This commit is contained in:
Taus
2023-07-14 14:26:21 +02:00
parent 9193de6898
commit 6793bc6c6b

View File

@@ -329,9 +329,10 @@ private class OtherArgumentToModeledMethodCharacteristic extends Characteristics
override predicate appliesToEndpoint(Endpoint e) {
not ApplicationCandidatesImpl::isSink(e, _) and
exists(DataFlow::Node otherSink |
exists(DataFlow::Node otherSink, Call c |
ApplicationCandidatesImpl::isSink(otherSink, _) and
e.asExpr() = otherSink.asExpr().(Argument).getCall().getAnArgument() and
c = otherSink.asExpr().(Argument).getCall() and
e.asExpr() in [c.getQualifier(), c.getAnArgument()] and
e != otherSink
)
}