mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Java: add hasProvenance predicate, remove isManuallyGenerated and isBothAutoAndManuallyGenerated
This commit is contained in:
@@ -246,14 +246,10 @@ module Public {
|
||||
predicate isAutoGenerated() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the summary is manually generated and not auto generated.
|
||||
* Holds if the summary has the given provenance where `true` is
|
||||
* `generated` and `false` is `manual`.
|
||||
*/
|
||||
predicate isManuallyGenerated() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the summary is both auto generated and manually generated.
|
||||
*/
|
||||
predicate isBothAutoAndManuallyGenerated() { none() }
|
||||
predicate hasProvenance(boolean generated) { summaryElement(this, _, _, _, generated) }
|
||||
}
|
||||
|
||||
/** A callable with a flow summary stating there is no flow via the callable. */
|
||||
@@ -1022,16 +1018,6 @@ module Private {
|
||||
}
|
||||
|
||||
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
|
||||
|
||||
override predicate isManuallyGenerated() {
|
||||
summaryElement(this, _, _, _, false) and
|
||||
not summaryElement(this, _, _, _, true)
|
||||
}
|
||||
|
||||
override predicate isBothAutoAndManuallyGenerated() {
|
||||
summaryElement(this, _, _, _, true) and
|
||||
summaryElement(this, _, _, _, false)
|
||||
}
|
||||
}
|
||||
|
||||
/** Holds if component `c` of specification `spec` cannot be parsed. */
|
||||
|
||||
@@ -25,10 +25,10 @@ private float getNumMadModeledApis(string package, string provenance) {
|
||||
sc.isAutoGenerated() and // "auto-only"
|
||||
provenance = "generated"
|
||||
or
|
||||
sc.isManuallyGenerated() and // "manual-only"
|
||||
(sc.hasProvenance(false) and not sc.hasProvenance(true)) and // "manual-only"
|
||||
provenance = "manual"
|
||||
or
|
||||
sc.isBothAutoAndManuallyGenerated() and // "both"
|
||||
(sc.hasProvenance(false) and sc.hasProvenance(true)) and // "both"
|
||||
provenance = "both"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user