Skip to content

Commit f5a2853

Browse files
authored
Merge pull request github#12705 from igfoo/igfoo/integ-extractor-info
Java: Allow keys to be omitted from ExtractorInformation.ql
2 parents 9173e08 + 4fa1bbf commit f5a2853

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

java/ql/src/Telemetry/ExtractorInformation.ql

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import java
1010
import semmle.code.java.Diagnostics
1111

12+
extensible predicate extractorInformationSkipKey(string key);
13+
1214
predicate compilationInfo(string key, int value) {
1315
exists(Compilation c, string infoKey |
1416
key = infoKey + ": " + c.getInfo(infoKey) and
@@ -85,13 +87,16 @@ predicate extractorTotalDiagnostics(string key, int value) {
8587

8688
from string key, int value
8789
where
88-
compilationInfo(key, value) or
89-
fileCount(key, value) or
90-
fileCountByExtension(key, value) or
91-
totalNumberOfLines(key, value) or
92-
numberOfLinesOfCode(key, value) or
93-
totalNumberOfLinesByExtension(key, value) or
94-
numberOfLinesOfCodeByExtension(key, value) or
95-
extractorDiagnostics(key, value) or
96-
extractorTotalDiagnostics(key, value)
90+
not extractorInformationSkipKey(key) and
91+
(
92+
compilationInfo(key, value) or
93+
fileCount(key, value) or
94+
fileCountByExtension(key, value) or
95+
totalNumberOfLines(key, value) or
96+
numberOfLinesOfCode(key, value) or
97+
totalNumberOfLinesByExtension(key, value) or
98+
numberOfLinesOfCodeByExtension(key, value) or
99+
extractorDiagnostics(key, value) or
100+
extractorTotalDiagnostics(key, value)
101+
)
97102
select key, value
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/java-queries
4+
extensible: extractorInformationSkipKey
5+
data: []

java/ql/src/qlpack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ dependencies:
1010
codeql/java-all: ${workspace}
1111
codeql/suite-helpers: ${workspace}
1212
codeql/util: ${workspace}
13+
dataExtensions:
14+
- Telemetry/ExtractorInformation.yml

0 commit comments

Comments
 (0)