File tree Expand file tree Collapse file tree 4 files changed +17
-0
lines changed
Expand file tree Collapse file tree 4 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 99import Metrics
1010
1111from CppMetrics:: ErrorCount m
12+ where RankMetric< CppMetrics:: ErrorCount > :: getRank ( m ) <= 500
1213select m .toString ( ) , m .getValue ( )
Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ class QualityMetric extends Metric {
6060 }
6161}
6262
63+ signature class RankedMetric extends Metric {
64+ int getValue ( ) ;
65+ }
66+
67+ module RankMetric< RankedMetric M> {
68+ int getRank ( M s ) { s = rank [ result ] ( M m | | m order by m .getValue ( ) desc ) }
69+ }
70+
6371/** Various metrics we want to report. */
6472module CppMetrics {
6573 class CompilationUnits extends BaseMetric {
@@ -226,6 +234,8 @@ module CppMetrics {
226234 int getValue ( ) { result = count ( Include i | i .getIncludeText ( ) = include_text ) }
227235
228236 string getIncludeText ( ) { result = include_text }
237+
238+ int getLimit ( ) { result = 2 }
229239 }
230240
231241 class MissingIncludeCount extends Metric {
@@ -239,6 +249,8 @@ module CppMetrics {
239249 int getValue ( ) { result = count ( CannotOpenFile e | e .getIncludedFile ( ) = include_text ) }
240250
241251 string getIncludeText ( ) { result = include_text }
252+
253+ int getLimit ( ) { result = 20 }
242254 }
243255
244256 class CompilerErrors extends ExtractionMetric {
@@ -251,6 +263,8 @@ module CppMetrics {
251263 ErrorCount ( ) { exists ( CompilerError e | e .getMessage ( ) = this ) }
252264
253265 int getValue ( ) { result = count ( CompilerError e | e .getMessage ( ) = this ) }
266+
267+ int getLimit ( ) { result = 10 }
254268 }
255269
256270 class SyntaxErrorCount extends ExtractionMetric {
Original file line number Diff line number Diff line change 99import Metrics
1010
1111from CppMetrics:: MissingIncludeCount e
12+ where RankMetric< CppMetrics:: MissingIncludeCount > :: getRank ( e ) <= 500
1213select e .getIncludeText ( ) , e .getValue ( )
Original file line number Diff line number Diff line change 99import Metrics
1010
1111from CppMetrics:: SucceededIncludeCount m
12+ where RankMetric< CppMetrics:: SucceededIncludeCount > :: getRank ( m ) <= 500
1213select m .getIncludeText ( ) , m .getValue ( )
You can’t perform that action at this time.
0 commit comments