Skip to content

Commit 8d2cef6

Browse files
committed
C++: Minor edits
1 parent 6c402ad commit 8d2cef6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cpp/ql/src/Telemetry/Metrics.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ class QualityMetric extends Metric {
5454
base_metric = relative_metric.getBaseline() and this = "Percentage of " + relative_metric
5555
}
5656

57-
override float getValue() { result = 100 * relative_metric.getValue() / base_metric.getValue() }
57+
override float getValue() {
58+
base_metric.getValue() > 0 and
59+
result = 100 * relative_metric.getValue() / base_metric.getValue()
60+
}
5861
}
5962

6063
/** Various metrics we want to report. */

cpp/ql/src/Telemetry/MissingIncludes.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
import Metrics
1010

1111
from CppMetrics::MissingIncludeCount e
12-
select e.getIncludeText(), e.getValue() as c order by c desc
12+
select e.getIncludeText(), e.getValue()

0 commit comments

Comments
 (0)