mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Rust: Use just end locations for now, to avoid all false positive lines caused by attached comments.
This commit is contained in:
@@ -47,11 +47,10 @@ class File extends Container, Impl::File {
|
||||
exists(AstNode node, Location loc |
|
||||
not node instanceof Comment and
|
||||
not node instanceof SourceFile and
|
||||
not node instanceof Item and // ignore Items for now as we're getting their locations wrong when a comment is attached
|
||||
loc = node.getLocation()
|
||||
|
|
||||
node.getFile() = this and
|
||||
line = [loc.getStartLine(), loc.getEndLine()] and
|
||||
line = [/*loc.getStartLine(), */loc.getEndLine()] and // ignore start locations for now as we're getting them wrong for things with a comment attached
|
||||
not loc instanceof EmptyLocation
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1 +1 @@
|
||||
| 68 |
|
||||
| 61 |
|
||||
|
||||
@@ -1 +1 @@
|
||||
| 68 |
|
||||
| 61 |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
| comments.rs:0:0:0:0 | comments.rs | 20 |
|
||||
| my_struct.rs:0:0:0:0 | my_struct.rs | 20 |
|
||||
| comments.rs:0:0:0:0 | comments.rs | 13 |
|
||||
| main.rs:0:0:0:0 | main.rs | 8 |
|
||||
| lib.rs:0:0:0:0 | lib.rs | 7 |
|
||||
| my_macro.rs:0:0:0:0 | my_macro.rs | 7 |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
| Elements extracted | 290 |
|
||||
| Elements unextracted | 0 |
|
||||
| Files extracted | 7 |
|
||||
| Lines of code extracted | 68 |
|
||||
| Lines of user code extracted | 68 |
|
||||
| Lines of code extracted | 61 |
|
||||
| Lines of user code extracted | 61 |
|
||||
|
||||
Reference in New Issue
Block a user