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
5
5
private import codeql.rust.elements.SourceFile
6
6
private import codeql.rust.elements.AstNode
7
7
private import codeql.rust.elements.Comment
8
+ private import codeql.rust.Diagnostics
8
9
9
10
private module Input implements InputSig {
10
11
abstract class ContainerBase extends @container {
@@ -56,3 +57,20 @@ class File extends Container, Impl::File {
56
57
)
57
58
}
58
59
}
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 2
2
* @id rust/summary/number-of-files-extracted-with-errors
3
3
* @name Total number of Rust files that were extracted with errors
4
4
* @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.
6
7
* @kind metric
7
8
* @tags summary
8
9
*/
9
10
10
11
import codeql.files.FileSystem
11
- import codeql.rust.Diagnostics
12
12
13
13
select 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
15
16
)
Original file line number Diff line number Diff line change 2
2
* @id rust/summary/number-of-successfully-extracted-files
3
3
* @name Total number of Rust files that were extracted without error
4
4
* @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) .
6
6
* @kind metric
7
7
* @tags summary
8
8
*/
9
9
10
- import codeql.rust.Diagnostics
11
10
import codeql.files.FileSystem
12
11
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