8000 Merge pull request #14988 from github/smowton/admin/report-more-files… · github/codeql@78e0f69 · GitHub
[go: up one dir, main page]

Skip to content

Commit 78e0f69

Browse files
authored
Merge pull request #14988 from github/smowton/admin/report-more-files-extracted
Java: report any extracted file as successfully extracted
2 parents 2fed0ad + 97266c2 commit 78e0f69

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The diagnostic query `java/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Java files, now considers any Java file seen during extraction, even one with some errors, to be extracted / scanned.

java/ql/src/Diagnostics/DiagnosticsReporting.qll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,16 @@ predicate reportableErrors(Diagnostic d, string msg, int sev) {
7979
*/
8080
predicate reportableWarnings(Diagnostic d, string msg, int sev) { knownWarnings(d, msg, sev) }
8181

82+
/**
83+
* Holds if compilation unit `f` is a source file.
84+
*/
85+
predicate extracted(CompilationUnit f) { exists(f.getRelativePath()) and f.fromSource() }
86+
8287
/**
8388
* Holds if compilation unit `f` is a source file that has
8489
* no relevant extraction diagnostics associated with it.
8590
*/
8691
predicate successfullyExtracted(CompilationUnit f) {
87-
not exists(Diagnostic d | reportableDiagnostics(d, _, _) and d.getLocation().getFile() = f) and
88-
exists(f.getRelativePath()) and
89-
f.fromSource()
92+
extracted(f) and
93+
not exists(Diagnostic d | reportableDiagnostics(d, _, _) and d.getLocation().getFile() = f)
9094
}
Lines changed: 3 additions & 3 del 9383 etions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* @name Successfully extracted files
2+
* @name Extracted files
33
* @description A list of all files in the source code directory that
4-
* were extracted without encountering an error in the file.
4+
* were extracted.
55
* @kind diagnostic
66
* @id java/diagnostics/successfully-extracted-files
77
* @tags successfully-extracted-files
@@ -11,5 +11,5 @@ import java
1111
import DiagnosticsReporting
1212

1313
from CompilationUnit f
14-
where successfullyExtracted(f)
14+
where extracted(f)
1515
select f, ""

0 commit comments

Comments
 (0)
0