File tree Expand file tree Collapse file tree 3 files changed +24
-8
lines changed
Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ private import codeql.util.FileSystem
55private import codeql.rust.elements.SourceFile
66private import codeql.rust.elements.AstNode
77private import codeql.rust.elements.Comment
8+ private import codeql.rust.Diagnostics
89
910private module Input implements InputSig {
1011 abstract class ContainerBase extends @container {
@@ -56,3 +57,20 @@ class File extends Container, Impl::File {
5657 )
5758 }
5859}
60+
61+ /**
62+ * A successfully extracted file, that is, a file that was extracted and
63+ * contains no extraction errors or warnings.
64+ */
65+ class SuccessfullyExtractedFile extends File {
66+ SuccessfullyExtractedFile ( ) {
67+ not exists ( Diagnostic d |
68+ d .getLocation ( ) .getFile ( ) = this and
69+ (
70+ d instanceof ExtractionError
71+ or
72+ d instanceof ExtractionWarning
73+ )
74+ )
75+ }
76+ }
Original file line number Diff line number Diff line change 22 * @id rust/summary/number-of-files-extracted-with-errors
33 * @name Total number of Rust files that were extracted with errors
44 * @description The total number of Rust files in the source code directory that
5- * were extracted, but where at least one extraction error occurred in the process.
5+ * were extracted, but where at least one extraction error (or warning) occurred
6+ * in the process.
67 * @kind metric
78 * @tags summary
89 */
910
1011import codeql.files.FileSystem
11- import codeql.rust.Diagnostics
1212
1313select count ( File f |
14- exists ( ExtractionError e | e .getLocation ( ) .getFile ( ) = f ) and exists ( f .getRelativePath ( ) )
14+ exists ( f .getRelativePath ( ) ) and
15+ not f instanceof SuccessfullyExtractedFile
1516 )
Original file line number Diff line number Diff line change 22 * @id rust/summary/number-of-successfully-extracted-files
33 * @name Total number of Rust files that were extracted without error
44 * @description The total number of Rust files in the source code directory that
5- * were extracted without encountering any extraction errors.
5+ * were extracted without encountering any extraction errors (or warnings) .
66 * @kind metric
77 * @tags summary
88 */
99
10- import codeql.rust.Diagnostics
1110import codeql.files.FileSystem
1211
13- select count ( File f |
14- not exists ( ExtractionError e | e .getLocation ( ) .getFile ( ) = f ) and exists ( f .getRelativePath ( ) )
15- )
12+ select count ( SuccessfullyExtractedFile f | exists ( f .getRelativePath ( ) ) )
You can’t perform that action at this time.
0 commit comments