mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Java: split extractor diagnostics query into two
This commit is contained in:
@@ -51,12 +51,26 @@ private predicate unknownErrors(@diagnostic d, string msg, int sev) {
|
||||
|
||||
/**
|
||||
* Holds if an extraction error or warning occurred that should be reported to end users,
|
||||
* with the error message `msg` and SARIF severity `sev`.
|
||||
* with the message `msg` and SARIF severity `sev`.
|
||||
*/
|
||||
predicate reportableDiagnostics(@diagnostic d, string msg, int sev) {
|
||||
knownWarnings(d, msg, sev) or knownErrors(d, msg, sev) or unknownErrors(d, msg, sev)
|
||||
reportableWarnings(d, msg, sev) or reportableErrors(d, msg, sev)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if an extraction error occurred that should be reported to end users,
|
||||
* with the message `msg` and SARIF severity `sev`.
|
||||
*/
|
||||
predicate reportableErrors(@diagnostic d, string msg, int sev) {
|
||||
knownErrors(d, msg, sev) or unknownErrors(d, msg, sev)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if an extraction warning occurred that should be reported to end users,
|
||||
* with the message `msg` and SARIF severity `sev`.
|
||||
*/
|
||||
predicate reportableWarnings(@diagnostic d, string msg, int sev) { knownWarnings(d, msg, sev) }
|
||||
|
||||
/**
|
||||
* Holds if compilation unit `f` is a source file that has
|
||||
* no relevant extraction diagnostics associated with it.
|
||||
|
||||
@@ -9,5 +9,5 @@ import java
|
||||
import DiagnosticsReporting
|
||||
|
||||
from string msg, int sev
|
||||
where reportableDiagnostics(_, msg, sev)
|
||||
where reportableErrors(_, msg, sev)
|
||||
select msg, sev
|
||||
|
||||
13
java/ql/src/Diagnostics/ExtractionWarnings.ql
Normal file
13
java/ql/src/Diagnostics/ExtractionWarnings.ql
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @name Extraction warnings
|
||||
* @description A list of extraction warnings for files in the source code directory.
|
||||
* @kind diagnostic
|
||||
* @id java/diagnostics/extraction-warnings
|
||||
*/
|
||||
|
||||
import java
|
||||
import DiagnosticsReporting
|
||||
|
||||
from string msg, int sev
|
||||
where reportableWarnings(_, msg, sev)
|
||||
select msg, sev
|
||||
Reference in New Issue
Block a user