From ad713a7a937062d4363c8e0c1bf0aa86167db5ea Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Fri, 1 Dec 2023 22:35:00 +0000 Subject: [PATCH 1/3] Java: report any extracted file as successfully extracted --- java/ql/src/Diagnostics/DiagnosticsReporting.qll | 10 +++++++--- java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/java/ql/src/Diagnostics/DiagnosticsReporting.qll b/java/ql/src/Diagnostics/DiagnosticsReporting.qll index 63819fe02c2..77baf783f85 100644 --- a/java/ql/src/Diagnostics/DiagnosticsReporting.qll +++ b/java/ql/src/Diagnostics/DiagnosticsReporting.qll @@ -79,12 +79,16 @@ predicate reportableErrors(Diagnostic d, string msg, int sev) { */ predicate reportableWarnings(Diagnostic d, string msg, int sev) { knownWarnings(d, msg, sev) } +/** + * Holds if compilation unit `f` is a source file. + */ +predicate extracted(CompilationUnit f) { exists(f.getRelativePath()) and f.fromSource() } + /** * Holds if compilation unit `f` is a source file that has * no relevant extraction diagnostics associated with it. */ predicate successfullyExtracted(CompilationUnit f) { - not exists(Diagnostic d | reportableDiagnostics(d, _, _) and d.getLocation().getFile() = f) and - exists(f.getRelativePath()) and - f.fromSource() + extracted(f) and + not exists(Diagnostic d | reportableDiagnostics(d, _, _) and d.getLocation().getFile() = f) } diff --git a/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql b/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql index 0a1f2fd6caf..5551ca3140b 100644 --- a/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +++ b/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql @@ -1,7 +1,7 @@ /** - * @name Successfully extracted files + * @name Extracted files * @description A list of all files in the source code directory that - * were extracted without encountering an error in the file. + * were extracted. * @kind diagnostic * @id java/diagnostics/successfully-extracted-files * @tags successfully-extracted-files @@ -11,5 +11,5 @@ import java import DiagnosticsReporting from CompilationUnit f -where successfullyExtracted(f) +where extracted(f) select f, "" From 6d5a493e2d8040dfd2364480e352034a1271c59f Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Mon, 4 Dec 2023 11:48:51 +0000 Subject: [PATCH 2/3] Add change note --- .../change-notes/2023-12-04-java-successfully-extracted.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md diff --git a/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md b/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md new file mode 100644 index 00000000000..bd2e521d897 --- /dev/null +++ b/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* 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. The Tools Status Page will continue to indicate when there were partial extraction failures that may lead to false or missing alerts. From 97266c252e351cd4436427ca92bbb354d1a8657e Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Mon, 4 Dec 2023 12:36:04 +0000 Subject: [PATCH 3/3] Remove mention of TSP --- .../lib/change-notes/2023-12-04-java-successfully-extracted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md b/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md index bd2e521d897..6833e9c922d 100644 --- a/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md +++ b/java/ql/lib/change-notes/2023-12-04-java-successfully-extracted.md @@ -1,4 +1,4 @@ --- category: minorAnalysis --- -* 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. The Tools Status Page will continue to indicate when there were partial extraction failures that may lead to false or missing alerts. +* 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.