From 4e651110e26f13e299d1115a091f39ce09c4d5b1 Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Mon, 6 Jan 2025 12:35:15 +0000 Subject: [PATCH] C++: Add build mode to the telemetry --- cpp/ql/src/Telemetry/Metrics.qll | 8 ++++++++ .../extraction_errors/ExtractionMetrics.expected | 1 + 2 files changed, 9 insertions(+) diff --git a/cpp/ql/src/Telemetry/Metrics.qll b/cpp/ql/src/Telemetry/Metrics.qll index b3c90af84501..dac935caf0cf 100644 --- a/cpp/ql/src/Telemetry/Metrics.qll +++ b/cpp/ql/src/Telemetry/Metrics.qll @@ -266,4 +266,12 @@ module CppMetrics { override int getValue() { result = count(SyntaxError e) } } + + class BuildModeNone extends ExtractionMetric { + BuildModeNone() { this = "build mode none" } + + override int getValue() { + if exists(Compilation c | c.buildModeNone()) then result = 1 else result = 0 + } + } } diff --git a/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected b/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected index ee2cc0f99630..90ffa5a0e98d 100644 --- a/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected +++ b/cpp/ql/test/library-tests/extraction_errors/ExtractionMetrics.expected @@ -1,4 +1,5 @@ | #include directives | 2 | +| build mode none | 0 | | calls | 2 | | calls with an explicit target | 1 | | compilations | 2 |