mirror of
https://github.com/github/codeql.git
synced 2026-01-21 02:14:45 +01:00
Merge pull request #10616 from erik-krogh/ql-consistencies
QL: adjust the consistency query to not be noisy on parameterised modules
This commit is contained in:
@@ -389,6 +389,7 @@ module ModConsistency {
|
||||
) >= 2 and
|
||||
// paramerized modules are not treated nicely, so we ignore them here.
|
||||
not i.getResolvedModule().getEnclosing*().asModule().hasParameter(_, _, _) and
|
||||
not i.getResolvedModule().asModule().hasAnnotation("signature") and
|
||||
not i.getLocation()
|
||||
.getFile()
|
||||
.getAbsolutePath()
|
||||
|
||||
@@ -211,7 +211,9 @@ module PredConsistency {
|
||||
c > 1 and
|
||||
resolvePredicateExpr(pe, p) and
|
||||
// parameterized modules are expected to resolve to multiple.
|
||||
not exists(ClasslessPredicate sig | not sig.isSignature() and resolvePredicateExpr(pe, sig))
|
||||
not exists(Predicate sig | sig.getParent*().hasAnnotation("signature") |
|
||||
resolvePredicateExpr(pe, sig)
|
||||
)
|
||||
}
|
||||
|
||||
query predicate multipleResolveCall(Call call, int c, PredicateOrBuiltin p) {
|
||||
@@ -227,6 +229,6 @@ module PredConsistency {
|
||||
c > 1 and
|
||||
resolveCall(call, p) and
|
||||
// parameterized modules are expected to resolve to multiple.
|
||||
not exists(ClasslessPredicate sig | not sig.isSignature() and resolveCall(call, sig))
|
||||
not exists(Predicate sig | sig.getParent*().hasAnnotation("signature") | resolveCall(call, sig))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,10 @@ where
|
||||
PredConsistency::noResolvePredicateExpr(node) and
|
||||
msg = "PredConsistency::noResolvePredicateExpr"
|
||||
or
|
||||
PredConsistency::multipleResolveCall(node, _, _) and
|
||||
msg = "PredConsistency::multipleResolveCall"
|
||||
or
|
||||
// This went out the window with parameterised modules.
|
||||
// PredConsistency::multipleResolveCall(node, _, _) and
|
||||
// msg = "PredConsistency::multipleResolveCall"
|
||||
// or
|
||||
PredConsistency::multipleResolvePredicateExpr(node, _, _) and
|
||||
msg = "PredConsistency::multipleResolvePredicateExpr"
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user