C++: Limit metrics to top 500

This commit is contained in:
Calum Grant
2024-11-08 14:37:59 +00:00
parent 067ecdeea0
commit faeff396eb
4 changed files with 11 additions and 0 deletions

View File

@@ -9,4 +9,5 @@
import Metrics
from CppMetrics::ErrorCount m
where RankMetric<CppMetrics::ErrorCount>::getRank(m) <= 500
select m.toString(), m.getValue()

View File

@@ -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 {

View File

@@ -9,4 +9,5 @@
import Metrics
from CppMetrics::MissingIncludeCount e
where RankMetric<CppMetrics::MissingIncludeCount>::getRank(e) <= 500
select e.getIncludeText(), e.getValue()

View File

@@ -9,4 +9,5 @@
import Metrics
from CppMetrics::SucceededIncludeCount m
where RankMetric<CppMetrics::SucceededIncludeCount>::getRank(m) <= 500
select m.getIncludeText(), m.getValue()