From c325ff8a237d6c5fa860a1eed288ee508b5c46bf Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 11 Mar 2024 16:38:33 +0000 Subject: [PATCH 1/2] Mark lines of code queries as telemetry queries The new file coverage metrics are available in all supported GHES versions. This PR tags lines of code queries as telemetry queries. Lines of code information will still be available in the SARIF file, but it will no longer be displayed in the logging output of the CLI. The one exception is the metric queries for Java/Kotlin that provides separate lines of code information for Java and Kotlin. I've kept these since separate file coverage information for languages like Java and Kotlin is only available for GHES 3.12 and later. --- cpp/ql/src/Summary/LinesOfUserCode.ql | 1 + csharp/ql/src/Metrics/Summaries/LinesOfCode.ql | 1 + go/ql/src/Summary/LinesOfCode.ql | 1 + java/ql/src/Metrics/Summaries/LinesOfCode.ql | 1 + javascript/ql/src/Summary/LinesOfUserCode.ql | 1 + python/ql/src/Summary/LinesOfUserCode.ql | 1 + ql/ql/src/queries/summary/LinesOfCode.ql | 1 + ql/ql/src/queries/summary/LinesOfUserCode.ql | 1 + ruby/ql/src/queries/summary/LinesOfCode.ql | 1 + ruby/ql/src/queries/summary/LinesOfUserCode.ql | 1 + swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql | 1 + 11 files changed, 11 insertions(+) diff --git a/cpp/ql/src/Summary/LinesOfUserCode.ql b/cpp/ql/src/Summary/LinesOfUserCode.ql index 67d3aa6a8e05..2c198a1488dd 100644 --- a/cpp/ql/src/Summary/LinesOfUserCode.ql +++ b/cpp/ql/src/Summary/LinesOfUserCode.ql @@ -4,6 +4,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry * @id cpp/summary/lines-of-user-code */ diff --git a/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql b/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql index 2115cd60d2be..4c6eb55e5abd 100644 --- a/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql +++ b/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql @@ -5,6 +5,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry */ import csharp diff --git a/go/ql/src/Summary/LinesOfCode.ql b/go/ql/src/Summary/LinesOfCode.ql index 383d7c5021ee..04864e5c4a01 100644 --- a/go/ql/src/Summary/LinesOfCode.ql +++ b/go/ql/src/Summary/LinesOfCode.ql @@ -5,6 +5,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry */ import go diff --git a/java/ql/src/Metrics/Summaries/LinesOfCode.ql b/java/ql/src/Metrics/Summaries/LinesOfCode.ql index 769a3476ed21..1ead46f1b200 100644 --- a/java/ql/src/Metrics/Summaries/LinesOfCode.ql +++ b/java/ql/src/Metrics/Summaries/LinesOfCode.ql @@ -7,6 +7,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry */ import java diff --git a/javascript/ql/src/Summary/LinesOfUserCode.ql b/javascript/ql/src/Summary/LinesOfUserCode.ql index 61ad13519cb7..83fbb9b32da7 100644 --- a/javascript/ql/src/Summary/LinesOfUserCode.ql +++ b/javascript/ql/src/Summary/LinesOfUserCode.ql @@ -6,6 +6,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry * @id js/summary/lines-of-user-code */ diff --git a/python/ql/src/Summary/LinesOfUserCode.ql b/python/ql/src/Summary/LinesOfUserCode.ql index 528ae948cd79..a30ba7afd199 100644 --- a/python/ql/src/Summary/LinesOfUserCode.ql +++ b/python/ql/src/Summary/LinesOfUserCode.ql @@ -8,6 +8,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry * @id py/summary/lines-of-user-code */ diff --git a/ql/ql/src/queries/summary/LinesOfCode.ql b/ql/ql/src/queries/summary/LinesOfCode.ql index cb5ef6174769..c0dbe8319670 100644 --- a/ql/ql/src/queries/summary/LinesOfCode.ql +++ b/ql/ql/src/queries/summary/LinesOfCode.ql @@ -8,6 +8,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry */ import ql diff --git a/ql/ql/src/queries/summary/LinesOfUserCode.ql b/ql/ql/src/queries/summary/LinesOfUserCode.ql index 1701af1a5c9c..8f49ce27d2fc 100644 --- a/ql/ql/src/queries/summary/LinesOfUserCode.ql +++ b/ql/ql/src/queries/summary/LinesOfUserCode.ql @@ -6,6 +6,7 @@ * query counts the lines of code, excluding whitespace or comments. * @kind metric * @tags summary + * telemetry */ import ql diff --git a/ruby/ql/src/queries/summary/LinesOfCode.ql b/ruby/ql/src/queries/summary/LinesOfCode.ql index 74994d773470..34e7438bab1e 100644 --- a/ruby/ql/src/queries/summary/LinesOfCode.ql +++ b/ruby/ql/src/queries/summary/LinesOfCode.ql @@ -8,6 +8,7 @@ * @kind metric * @tags summary * lines-of-code + * telemetry */ import codeql.ruby.AST diff --git a/ruby/ql/src/queries/summary/LinesOfUserCode.ql b/ruby/ql/src/queries/summary/LinesOfUserCode.ql index d8025088ceb9..121124862a1f 100644 --- a/ruby/ql/src/queries/summary/LinesOfUserCode.ql +++ b/ruby/ql/src/queries/summary/LinesOfUserCode.ql @@ -6,6 +6,7 @@ * query counts the lines of code, excluding whitespace or comments. * @kind metric * @tags summary + * telemetry */ import codeql.ruby.AST diff --git a/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql b/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql index 373b6c4bd0f3..9fc406808528 100644 --- a/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql +++ b/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql @@ -4,6 +4,7 @@ * @kind metric * @id swift/diagnostics/successfully-extracted-lines * @tags summary + * telemetry */ import swift From a76832f4e0ee375adda4904f090e68aab064d8e1 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 20 Mar 2024 21:15:23 +0000 Subject: [PATCH 2/2] Mark LOC queries as `debug` instead --- cpp/ql/src/Summary/LinesOfUserCode.ql | 2 +- csharp/ql/src/Metrics/Summaries/LinesOfCode.ql | 2 +- go/ql/src/Summary/LinesOfCode.ql | 2 +- java/ql/src/Metrics/Summaries/LinesOfCode.ql | 2 +- javascript/ql/src/Summary/LinesOfUserCode.ql | 2 +- python/ql/src/Summary/LinesOfUserCode.ql | 2 +- ql/ql/src/queries/summary/LinesOfCode.ql | 2 +- ql/ql/src/queries/summary/LinesOfUserCode.ql | 2 +- ruby/ql/src/queries/summary/LinesOfCode.ql | 2 +- ruby/ql/src/queries/summary/LinesOfUserCode.ql | 2 +- swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cpp/ql/src/Summary/LinesOfUserCode.ql b/cpp/ql/src/Summary/LinesOfUserCode.ql index 2c198a1488dd..468dbda4ffbc 100644 --- a/cpp/ql/src/Summary/LinesOfUserCode.ql +++ b/cpp/ql/src/Summary/LinesOfUserCode.ql @@ -4,7 +4,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug * @id cpp/summary/lines-of-user-code */ diff --git a/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql b/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql index 4c6eb55e5abd..ca4da7bd4b96 100644 --- a/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql +++ b/csharp/ql/src/Metrics/Summaries/LinesOfCode.ql @@ -5,7 +5,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug */ import csharp diff --git a/go/ql/src/Summary/LinesOfCode.ql b/go/ql/src/Summary/LinesOfCode.ql index 04864e5c4a01..987648f604cd 100644 --- a/go/ql/src/Summary/LinesOfCode.ql +++ b/go/ql/src/Summary/LinesOfCode.ql @@ -5,7 +5,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug */ import go diff --git a/java/ql/src/Metrics/Summaries/LinesOfCode.ql b/java/ql/src/Metrics/Summaries/LinesOfCode.ql index 1ead46f1b200..e2e83b356315 100644 --- a/java/ql/src/Metrics/Summaries/LinesOfCode.ql +++ b/java/ql/src/Metrics/Summaries/LinesOfCode.ql @@ -7,7 +7,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug */ import java diff --git a/javascript/ql/src/Summary/LinesOfUserCode.ql b/javascript/ql/src/Summary/LinesOfUserCode.ql index 83fbb9b32da7..1f8f2b9fef7a 100644 --- a/javascript/ql/src/Summary/LinesOfUserCode.ql +++ b/javascript/ql/src/Summary/LinesOfUserCode.ql @@ -6,7 +6,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug * @id js/summary/lines-of-user-code */ diff --git a/python/ql/src/Summary/LinesOfUserCode.ql b/python/ql/src/Summary/LinesOfUserCode.ql index a30ba7afd199..f6d6f25872ff 100644 --- a/python/ql/src/Summary/LinesOfUserCode.ql +++ b/python/ql/src/Summary/LinesOfUserCode.ql @@ -8,7 +8,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug * @id py/summary/lines-of-user-code */ diff --git a/ql/ql/src/queries/summary/LinesOfCode.ql b/ql/ql/src/queries/summary/LinesOfCode.ql index c0dbe8319670..7a552137cf31 100644 --- a/ql/ql/src/queries/summary/LinesOfCode.ql +++ b/ql/ql/src/queries/summary/LinesOfCode.ql @@ -8,7 +8,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug */ import ql diff --git a/ql/ql/src/queries/summary/LinesOfUserCode.ql b/ql/ql/src/queries/summary/LinesOfUserCode.ql index 8f49ce27d2fc..b1d8481a564b 100644 --- a/ql/ql/src/queries/summary/LinesOfUserCode.ql +++ b/ql/ql/src/queries/summary/LinesOfUserCode.ql @@ -6,7 +6,7 @@ * query counts the lines of code, excluding whitespace or comments. * @kind metric * @tags summary - * telemetry + * debug */ import ql diff --git a/ruby/ql/src/queries/summary/LinesOfCode.ql b/ruby/ql/src/queries/summary/LinesOfCode.ql index 34e7438bab1e..f90cf34d0467 100644 --- a/ruby/ql/src/queries/summary/LinesOfCode.ql +++ b/ruby/ql/src/queries/summary/LinesOfCode.ql @@ -8,7 +8,7 @@ * @kind metric * @tags summary * lines-of-code - * telemetry + * debug */ import codeql.ruby.AST diff --git a/ruby/ql/src/queries/summary/LinesOfUserCode.ql b/ruby/ql/src/queries/summary/LinesOfUserCode.ql index 121124862a1f..91471c417ee1 100644 --- a/ruby/ql/src/queries/summary/LinesOfUserCode.ql +++ b/ruby/ql/src/queries/summary/LinesOfUserCode.ql @@ -6,7 +6,7 @@ * query counts the lines of code, excluding whitespace or comments. * @kind metric * @tags summary - * telemetry + * debug */ import codeql.ruby.AST diff --git a/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql b/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql index 9fc406808528..5aec16da4ef4 100644 --- a/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql +++ b/swift/ql/src/diagnostics/SuccessfullyExtractedLines.ql @@ -4,7 +4,7 @@ * @kind metric * @id swift/diagnostics/successfully-extracted-lines * @tags summary - * telemetry + * debug */ import swift