mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Rust: For now exclude top-level AST elements from LOC counts. This is not ideal.
This commit is contained in:
@@ -5,6 +5,7 @@ private import codeql.util.FileSystem
|
||||
private import codeql.rust.elements.SourceFile
|
||||
private import codeql.rust.elements.AstNode
|
||||
private import codeql.rust.elements.Comment
|
||||
private import codeql.rust.elements.internal.generated.ParentChild
|
||||
|
||||
private module Input implements InputSig {
|
||||
abstract class ContainerBase extends @container {
|
||||
@@ -47,6 +48,7 @@ class File extends Container, Impl::File {
|
||||
exists(AstNode node, Location loc |
|
||||
not node instanceof Comment and
|
||||
not node instanceof SourceFile and
|
||||
not getImmediateParent(node) instanceof SourceFile and // ignore top-level elements for now as we're getting their locations wrong when a comment is attached
|
||||
loc = node.getLocation()
|
||||
|
|
||||
node.getFile() = this and
|
||||
|
||||
@@ -1 +1 @@
|
||||
| 49 |
|
||||
| 46 |
|
||||
|
||||
@@ -1 +1 @@
|
||||
| 49 |
|
||||
| 46 |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
| my_struct.rs:0:0:0:0 | my_struct.rs | 21 |
|
||||
| main.rs:0:0:0:0 | main.rs | 8 |
|
||||
| my_macro.rs:0:0:0:0 | my_macro.rs | 8 |
|
||||
| my_struct.rs:0:0:0:0 | my_struct.rs | 20 |
|
||||
| main.rs:0:0:0:0 | main.rs | 7 |
|
||||
| my_macro.rs:0:0:0:0 | my_macro.rs | 7 |
|
||||
| lib.rs:0:0:0:0 | lib.rs | 6 |
|
||||
| does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 |
|
||||
| error.rs:0:0:0:0 | error.rs | 3 |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
| Elements extracted | 216 |
|
||||
| Elements unextracted | 0 |
|
||||
| Files extracted | 6 |
|
||||
| Lines of code extracted | 49 |
|
||||
| Lines of user code extracted | 49 |
|
||||
| Lines of code extracted | 46 |
|
||||
| Lines of user code extracted | 46 |
|
||||
|
||||
Reference in New Issue
Block a user