mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
Java: Allow keys to be omitted from ExtractorInformation.ql
This is useful in tests, as some keys contain unstable information.
This commit is contained in:
@@ -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
|
||||
|
||||
5
java/ql/src/Telemetry/ExtractorInformation.yml
Normal file
5
java/ql/src/Telemetry/ExtractorInformation.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/java-queries
|
||||
extensible: extractorInformationSkipKey
|
||||
data: []
|
||||
Reference in New Issue
Block a user