Merge pull request #12705 from igfoo/igfoo/integ-extractor-info

Java: Allow keys to be omitted from ExtractorInformation.ql
This commit is contained in:
Ian Lynagh
2023-03-30 14:06:41 +01:00
committed by GitHub
3 changed files with 21 additions and 9 deletions

View File

@@ -9,6 +9,8 @@
import java
import semmle.code.java.Diagnostics
extensible predicate extractorInformationSkipKey(string key);
predicate compilationInfo(string key, int value) {
exists(Compilation c, string infoKey |
key = infoKey + ": " + c.getInfo(infoKey) and
@@ -85,13 +87,16 @@ predicate extractorTotalDiagnostics(string key, int value) {
from string key, int value
where
compilationInfo(key, value) or
fileCount(key, value) or
fileCountByExtension(key, value) or
totalNumberOfLines(key, value) or
numberOfLinesOfCode(key, value) or
totalNumberOfLinesByExtension(key, value) or
numberOfLinesOfCodeByExtension(key, value) or
extractorDiagnostics(key, value) or
extractorTotalDiagnostics(key, value)
not extractorInformationSkipKey(key) and
(
compilationInfo(key, value) or
fileCount(key, value) or
fileCountByExtension(key, value) or
totalNumberOfLines(key, value) or
numberOfLinesOfCode(key, value) or
totalNumberOfLinesByExtension(key, value) or
numberOfLinesOfCodeByExtension(key, value) or
extractorDiagnostics(key, value) or
extractorTotalDiagnostics(key, value)
)
select key, value

View File

@@ -0,0 +1,5 @@
extensions:
- addsTo:
pack: codeql/java-queries
extensible: extractorInformationSkipKey
data: []

View File

@@ -10,3 +10,5 @@ dependencies:
codeql/java-all: ${workspace}
codeql/suite-helpers: ${workspace}
codeql/util: ${workspace}
dataExtensions:
- Telemetry/ExtractorInformation.yml