@@ -47,16 +47,16 @@ abstract class SuccessMetric extends ExtractionMetric {
47
47
* A metric used to report database quality.
48
48
*/
49
49
class QualityMetric extends Metric {
50
- BaseMetric base_metric ;
51
- SuccessMetric relative_metric ;
50
+ BaseMetric baseMetric ;
51
+ SuccessMetric relativeMetric ;
52
52
53
53
QualityMetric ( ) {
54
- base_metric = relative_metric .getBaseline ( ) and this = "Percentage of " + relative_metric
54
+ baseMetric = relativeMetric .getBaseline ( ) and this = "Percentage of " + relativeMetric
55
55
}
56
56
57
57
float getValue ( ) {
58
- base_metric .getValue ( ) > 0 and
59
- result = 100.0 * relative_metric .getValue ( ) / base_metric .getValue ( )
58
+ baseMetric .getValue ( ) > 0 and
59
+ result = 100.0 * relativeMetric .getValue ( ) / baseMetric .getValue ( )
60
60
}
61
61
}
62
62
@@ -70,8 +70,8 @@ module RankMetric<RankedMetric M> {
70
70
71
71
/** Various metrics we want to report. */
72
72
module CppMetrics {
73
- class CompilationUnits extends BaseMetric {
74
- CompilationUnits ( ) { this = "compilation units " }
73
+ class Compilations extends BaseMetric {
74
+ Compilations ( ) { this = "compilations " }
75
75
76
76
override int getValue ( ) { result = count ( Compilation c ) }
77
77
}
@@ -92,14 +92,14 @@ module CppMetrics {
92
92
override SourceFiles getBaseline ( ) { any ( ) }
93
93
}
94
94
95
- class CompilationUnitsWithoutErrors extends SuccessMetric {
96
- CompilationUnitsWithoutErrors ( ) { this = "compilation units without errors" }
95
+ class CompilationsWithoutErrors extends SuccessMetric {
96
+ CompilationsWithoutErrors ( ) { this = "compilations without errors" }
97
97
98
98
override int getValue ( ) {
99
99
result = count ( Compilation c | not exists ( Diagnostic d | d .getFile ( ) = c .getAFileCompiled ( ) ) )
100
100
}
101
101
102
- override CompilationUnits getBaseline ( ) { any ( ) }
102
+ override Compilations getBaseline ( ) { any ( ) }
103
103
}
104
104
105
105
class Expressions extends BaseMetric {
@@ -186,7 +186,7 @@ module CppMetrics {
186
186
override int getValue ( ) {
187
187
result =
188
188
sum ( File f | | f .getMetrics ( ) .getNumberOfLinesOfCode ( ) ) -
189
- count ( File file , int line | errorLine ( file , line ) )
189
+ count ( File f , int line | errorLine ( f , line ) )
190
190
}
191
191
192
192
override LinesOfCode getBaseline ( ) { any ( ) }
@@ -209,7 +209,7 @@ module CppMetrics {
209
209
class Includes extends BaseMetric {
210
210
Includes ( ) { this = "#include directives" }
211
211
212
- override int getValue ( ) { result = count ( Include i ) + count ( CannotOpenFile e ) }
212
+ override int getValue ( ) { result = count ( Include i ) + count ( CannotOpenFileError e ) }
213
213
}
214
214
215
215
class SucceededIncludes extends SuccessMetric {
@@ -240,11 +240,11 @@ module CppMetrics {
240
240
string include_text ;
241
241
242
242
MissingIncludeCount ( ) {
243
- exists ( CannotOpenFile e | e .getIncludedFile ( ) = include_text ) and
243
+ exists ( CannotOpenFileError e | e .getIncludedFile ( ) = include_text ) and
244
244
this = "Failed to include '" + include_text + "'"
245
245
}
246
246
247
- int getValue ( ) { result = count ( CannotOpenFile e | e .getIncludedFile ( ) = include_text ) }
247
+ int getValue ( ) { result = count ( CannotOpenFileError e | e .getIncludedFile ( ) = include_text ) }
248
248
249
249
string getIncludeText ( ) { result = include_text }
250
250
}
0 commit comments