diff --git a/javascript/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md b/javascript/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md new file mode 100644 index 00000000000..16eb835b3a0 --- /dev/null +++ b/javascript/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The diagnostic query `js/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned JavaScript and TypeScript files, now considers any JavaScript and TypeScript file seen during extraction, even one with some errors, to be extracted / scanned. \ No newline at end of file diff --git a/javascript/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql b/javascript/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql index 80397e3392f..b1aed67da87 100644 --- a/javascript/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +++ b/javascript/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql @@ -1,6 +1,6 @@ /** - * @name Successfully extracted files - * @description Lists all files in the source code directory that were extracted without encountering an error in the file. + * @name Extracted files + * @description Lists all files in the source code directory that were extracted. * @kind diagnostic * @id js/diagnostics/successfully-extracted-files * @tags successfully-extracted-files @@ -9,7 +9,5 @@ import javascript from File f -where - not exists(Error e | e.isFatal() and e.getFile() = f) and - exists(f.getRelativePath()) +where exists(f.getRelativePath()) select f, "" diff --git a/javascript/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected b/javascript/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected index 493e7abac8b..9a17e5162b5 100644 --- a/javascript/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected +++ b/javascript/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected @@ -1,3 +1,6 @@ +| bad1.js:0:0:0:0 | bad1.js | | +| bad2.ts:0:0:0:0 | bad2.ts | | +| bad3.html:0:0:0:0 | bad3.html | | | contains-template.js:0:0:0:0 | contains-template.js | | | good1.js:0:0:0:0 | good1.js | | | good2.ts:0:0:0:0 | good2.ts | | diff --git a/python/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md b/python/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md new file mode 100644 index 00000000000..0bf607e7343 --- /dev/null +++ b/python/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The diagnostic query `py/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Python files, now considers any Python file seen during extraction, even one with some errors, to be extracted / scanned. \ No newline at end of file diff --git a/python/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql b/python/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql index a4885cab469..6bba71b675f 100644 --- a/python/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +++ b/python/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql @@ -1,7 +1,6 @@ /** - * @name Successfully extracted Python files - * @description Lists all Python files in the source code directory that were extracted - * without encountering an error. + * @name Extracted Python files + * @description Lists all Python files in the source code directory that were extracted. * @kind diagnostic * @id py/diagnostics/successfully-extracted-files * @tags successfully-extracted-files @@ -10,7 +9,5 @@ import python from File file -where - not exists(SyntaxError e | e.getFile() = file) and - exists(file.getRelativePath()) +where exists(file.getRelativePath()) select file, "" diff --git a/python/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected b/python/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected index 7214acd8b88..1eed3744a78 100644 --- a/python/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected +++ b/python/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected @@ -1 +1,3 @@ +| bad_encoding.py:0:0:0:0 | bad_encoding.py | | | good_file.py:0:0:0:0 | good_file.py | | +| syntax_error.py:0:0:0:0 | syntax_error.py | | diff --git a/ruby/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md b/ruby/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md new file mode 100644 index 00000000000..7e1ce1c3488 --- /dev/null +++ b/ruby/ql/lib/change-notes/2024-01-17-successfully-extracted-diagnostic.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The diagnostic query `rb/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Ruby files, now considers any Ruby file seen during extraction, even one with some errors, to be extracted / scanned. \ No newline at end of file diff --git a/ruby/ql/src/queries/diagnostics/SuccessfullyExtractedFiles.ql b/ruby/ql/src/queries/diagnostics/SuccessfullyExtractedFiles.ql index e3d648256c4..a597b8af824 100644 --- a/ruby/ql/src/queries/diagnostics/SuccessfullyExtractedFiles.ql +++ b/ruby/ql/src/queries/diagnostics/SuccessfullyExtractedFiles.ql @@ -1,7 +1,6 @@ /** - * @name Successfully extracted files - * @description Lists all files in the source code directory that were extracted - * without encountering an error in the file. + * @name Extracted files + * @description Lists all files in the source code directory that were extracted. * @kind diagnostic * @id rb/diagnostics/successfully-extracted-files * @tags successfully-extracted-files @@ -11,7 +10,5 @@ import codeql.ruby.AST import codeql.ruby.Diagnostics from File f -where - not exists(ExtractionError e | e.getLocation().getFile() = f) and - exists(f.getRelativePath()) +where exists(f.getRelativePath()) select f, "" diff --git a/ruby/ql/test/query-tests/diagnostics/SuccessfullyExtractedFiles.expected b/ruby/ql/test/query-tests/diagnostics/SuccessfullyExtractedFiles.expected index ccb442a930a..67df5213c29 100644 --- a/ruby/ql/test/query-tests/diagnostics/SuccessfullyExtractedFiles.expected +++ b/ruby/ql/test/query-tests/diagnostics/SuccessfullyExtractedFiles.expected @@ -1,3 +1,4 @@ | src/bar.erb:0:0:0:0 | src/bar.erb | | | src/foo.rb:0:0:0:0 | src/foo.rb | | +| src/not_ruby.rb:0:0:0:0 | src/not_ruby.rb | | | src/vendor/cache/lib.rb:0:0:0:0 | src/vendor/cache/lib.rb | |