From 91b1cb8a7676258a4c2632b54df8387657460334 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Tue, 12 Nov 2024 09:46:50 +0000 Subject: [PATCH] C++: Some renaming --- cpp/ql/src/Telemetry/Metrics.qll | 24 +++++++++---------- .../DatabaseQuality.expected | 2 +- .../ExtractionMetrics.expected | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cpp/ql/src/Telemetry/Metrics.qll b/cpp/ql/src/Telemetry/Metrics.qll index 41d817e4411..b3c90af8450 100644 --- a/cpp/ql/src/Telemetry/Metrics.qll +++ b/cpp/ql/src/Telemetry/Metrics.qll @@ -130,8 +130,8 @@ module CppMetrics { override int getValue() { result = count(Call c) } } - class SucceededCalls extends SuccessMetric { - SucceededCalls() { this = "calls with a target" } + class CallsWithExplicitTarget extends SuccessMetric { + CallsWithExplicitTarget() { this = "calls with an explicit target" } override int getValue() { result = count(Call c | not c.getTarget().getADeclarationEntry().isImplicit()) @@ -221,32 +221,32 @@ module CppMetrics { } class SucceededIncludeCount extends Metric { - string include_text; + string includeText; SucceededIncludeCount() { exists(Include i | - i.getIncludeText() = include_text and + i.getIncludeText() = includeText and exists(i.getFile().getRelativePath()) // Only report includes from the repo ) and - this = "Successfully included " + include_text + this = "Successfully included " + includeText } - int getValue() { result = count(Include i | i.getIncludeText() = include_text) } + int getValue() { result = count(Include i | i.getIncludeText() = includeText) } - string getIncludeText() { result = include_text } + string getIncludeText() { result = includeText } } class MissingIncludeCount extends Metric { - string include_text; + string includeText; MissingIncludeCount() { - exists(CannotOpenFileError e | e.getIncludedFile() = include_text) and - this = "Failed to include '" + include_text + "'" + exists(CannotOpenFileError e | e.getIncludedFile() = includeText) and + this = "Failed to include '" + includeText + "'" } - int getValue() { result = count(CannotOpenFileError e | e.getIncludedFile() = include_text) } + int getValue() { result = count(CannotOpenFileError e | e.getIncludedFile() = includeText) } - string getIncludeText() { result = include_text } + string getIncludeText() { result = includeText } } class CompilerErrors extends ExtractionMetric { diff --git a/cpp/ql/test/library-tests/extraction_errors/DatabaseQuality.expected b/cpp/ql/test/library-tests/extraction_errors/DatabaseQuality.expected index cd55ff43477..6d9cea2d734 100644 --- a/cpp/ql/test/library-tests/extraction_errors/DatabaseQuality.expected +++ b/cpp/ql/test/library-tests/extraction_errors/DatabaseQuality.expected @@ -1,4 +1,4 @@ -| Percentage of calls with a target | 50.0 | +| Percentage of calls with an explicit target | 50.0 | | Percentage of compilations without errors | 50.0 | | Percentage of expressions with a known type | 30.0 | | Percentage of functions without errors | 75.0 | diff --git a/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected b/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected index c0e97d037db..ee2cc0f9963 100644 --- a/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected +++ b/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected @@ -1,6 +1,6 @@ | #include directives | 2 | | calls | 2 | -| calls with a target | 1 | +| calls with an explicit target | 1 | | compilations | 2 | | compilations without errors | 1 | | compiler errors | 10 |