mirror of
https://github.com/github/codeql.git
synced 2026-04-20 22:44:52 +02:00
C++: Limit metrics to top 500
This commit is contained in:
@@ -9,4 +9,5 @@
|
||||
import Metrics
|
||||
|
||||
from CppMetrics::ErrorCount m
|
||||
where RankMetric<CppMetrics::ErrorCount>::getRank(m) <= 500
|
||||
select m.toString(), m.getValue()
|
||||
|
||||
@@ -60,6 +60,14 @@ class QualityMetric extends Metric {
|
||||
}
|
||||
}
|
||||
|
||||
signature class RankedMetric extends Metric {
|
||||
int getValue();
|
||||
}
|
||||
|
||||
module RankMetric<RankedMetric M> {
|
||||
int getRank(M s) { s = rank[result](M m | | m order by m.getValue() desc) }
|
||||
}
|
||||
|
||||
/** Various metrics we want to report. */
|
||||
module CppMetrics {
|
||||
class CompilationUnits extends BaseMetric {
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
import Metrics
|
||||
|
||||
from CppMetrics::MissingIncludeCount e
|
||||
where RankMetric<CppMetrics::MissingIncludeCount>::getRank(e) <= 500
|
||||
select e.getIncludeText(), e.getValue()
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
import Metrics
|
||||
|
||||
from CppMetrics::SucceededIncludeCount m
|
||||
where RankMetric<CppMetrics::SucceededIncludeCount>::getRank(m) <= 500
|
||||
select m.getIncludeText(), m.getValue()
|
||||
|
||||
Reference in New Issue
Block a user