Skip to content

Js/Py/Rb: Report any extracted file as successfully extracted #15256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 3 additions & 5 deletions javascript/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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, ""
Original file line number Diff line number Diff line change
@@ -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 | |
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 3 additions & 6 deletions python/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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, ""
Original file line number Diff line number Diff line change
@@ -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 | |
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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, ""
Original file line number Diff line number Diff line change
@@ -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 | |