mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Rust: fix diagnostics tests
This commit is contained in:
committed by
Tom Hvitved
parent
457632e10e
commit
e90ab7b881
@@ -8,5 +8,5 @@
|
||||
import rust
|
||||
|
||||
from MacroCall mc
|
||||
where not mc.hasMacroCallExpansion()
|
||||
where mc.fromSource() and not mc.hasMacroCallExpansion()
|
||||
select mc, "Macro call was not resolved to a target."
|
||||
|
||||
@@ -28,7 +28,7 @@ private import codeql.rust.security.WeakSensitiveDataHashingExtensions
|
||||
/**
|
||||
* Gets a count of the total number of lines of code in the database.
|
||||
*/
|
||||
int getLinesOfCode() { result = sum(File f | | f.getNumberOfLinesOfCode()) }
|
||||
int getLinesOfCode() { result = sum(File f | f.fromSource() | f.getNumberOfLinesOfCode()) }
|
||||
|
||||
/**
|
||||
* Gets a count of the total number of lines of code from the source code directory in the database.
|
||||
@@ -109,9 +109,11 @@ predicate elementStats(string key, int value) {
|
||||
* Gets summary statistics about extraction.
|
||||
*/
|
||||
predicate extractionStats(string key, int value) {
|
||||
key = "Extraction errors" and value = count(ExtractionError e)
|
||||
key = "Extraction errors" and
|
||||
value = count(ExtractionError e | not exists(e.getLocation()) or e.getLocation().fromSource())
|
||||
or
|
||||
key = "Extraction warnings" and value = count(ExtractionWarning w)
|
||||
key = "Extraction warnings" and
|
||||
value = count(ExtractionWarning w | not exists(w.getLocation()) or w.getLocation().fromSource())
|
||||
or
|
||||
key = "Files extracted - total" and value = count(ExtractedFile f | exists(f.getRelativePath()))
|
||||
or
|
||||
@@ -133,11 +135,13 @@ predicate extractionStats(string key, int value) {
|
||||
or
|
||||
key = "Lines of user code extracted" and value = getLinesOfUserCode()
|
||||
or
|
||||
key = "Macro calls - total" and value = count(MacroCall mc)
|
||||
key = "Macro calls - total" and value = count(MacroCall mc | mc.fromSource())
|
||||
or
|
||||
key = "Macro calls - resolved" and value = count(MacroCall mc | mc.hasMacroCallExpansion())
|
||||
key = "Macro calls - resolved" and
|
||||
value = count(MacroCall mc | mc.fromSource() and mc.hasMacroCallExpansion())
|
||||
or
|
||||
key = "Macro calls - unresolved" and value = count(MacroCall mc | not mc.hasMacroCallExpansion())
|
||||
key = "Macro calls - unresolved" and
|
||||
value = count(MacroCall mc | mc.fromSource() and not mc.hasMacroCallExpansion())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1 +1 @@
|
||||
| 77 |
|
||||
| 60 |
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
| Inconsistencies - Path resolution | 0 |
|
||||
| Inconsistencies - SSA | 0 |
|
||||
| Inconsistencies - data flow | 0 |
|
||||
| Lines of code extracted | 77 |
|
||||
| Lines of code extracted | 60 |
|
||||
| Lines of user code extracted | 60 |
|
||||
| Macro calls - resolved | 8 |
|
||||
| Macro calls - total | 9 |
|
||||
|
||||
Reference in New Issue
Block a user