mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Java: add draft of generated vs manual MaD metrics query
This commit is contained in:
@@ -241,9 +241,19 @@ module Public {
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the summary is auto generated.
|
||||
* Holds if the summary is auto generated and not manually generated.
|
||||
*/
|
||||
predicate isAutoGenerated() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the summary is manually generated and not auto generated.
|
||||
*/
|
||||
predicate isManuallyGenerated() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the summary is both auto generated and manually generated.
|
||||
*/
|
||||
predicate isBothAutoAndManuallyGenerated() { none() }
|
||||
}
|
||||
|
||||
/** A callable with a flow summary stating there is no flow via the callable. */
|
||||
@@ -991,6 +1001,20 @@ module Private {
|
||||
not summaryElement(this, _, _, _, false)
|
||||
}
|
||||
|
||||
private predicate relevantSummaryElementManual(
|
||||
AccessPath inSpec, AccessPath outSpec, string kind
|
||||
) {
|
||||
summaryElement(this, inSpec, outSpec, kind, false) and
|
||||
not summaryElement(this, _, _, _, true)
|
||||
}
|
||||
|
||||
private predicate relevantSummaryElementBothGeneratedAndManual(
|
||||
AccessPath inSpec, AccessPath outSpec, string kind
|
||||
) {
|
||||
summaryElement(this, inSpec, outSpec, kind, true) and
|
||||
summaryElement(this, inSpec, outSpec, kind, false)
|
||||
}
|
||||
|
||||
private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {
|
||||
summaryElement(this, inSpec, outSpec, kind, false)
|
||||
or
|
||||
@@ -1012,6 +1036,12 @@ module Private {
|
||||
}
|
||||
|
||||
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
|
||||
|
||||
override predicate isManuallyGenerated() { this.relevantSummaryElementManual(_, _, _) }
|
||||
|
||||
override predicate isBothAutoAndManuallyGenerated() {
|
||||
this.relevantSummaryElementBothGeneratedAndManual(_, _, _)
|
||||
}
|
||||
}
|
||||
|
||||
/** Holds if component `c` of specification `spec` cannot be parsed. */
|
||||
|
||||
Reference in New Issue
Block a user