Skip to content

Commit f07f618

Browse files
committed
Rust: Make rust/summary/summary-statistics a metric query so that we can access data in the DCA job.
1 parent f4d4925 commit f07f618

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Summary Statistics
33
* @description A table of summary statistics about a database.
4-
* @kind diagnostic
4+
* @kind metric
55
* @id rust/summary/summary-statistics
66
* @tags summary
77
*/
@@ -10,31 +10,30 @@ import rust
1010
import codeql.rust.Diagnostics
1111
import Stats
1212

13-
from string key, string value
13+
from string key, int value
1414
where
15-
key = "Elements extracted" and value = count(Element e | not e instanceof Unextracted).toString()
15+
key = "Elements extracted" and value = count(Element e | not e instanceof Unextracted)
1616
or
17-
key = "Elements unextracted" and value = count(Unextracted e).toString()
17+
key = "Elements unextracted" and value = count(Unextracted e)
1818
or
19-
key = "Extraction errors" and value = count(ExtractionError e).toString()
19+
key = "Extraction errors" and value = count(ExtractionError e)
2020
or
21-
key = "Extraction warnings" and value = count(ExtractionWarning w).toString()
21+
key = "Extraction warnings" and value = count(ExtractionWarning w)
2222
or
23-
key = "Files extracted - total" and value = count(File f | exists(f.getRelativePath())).toString()
23+
key = "Files extracted - total" and value = count(File f | exists(f.getRelativePath()))
2424
or
2525
key = "Files extracted - with errors" and
2626
value =
2727
count(File f | exists(f.getRelativePath()) and not f instanceof SuccessfullyExtractedFile)
28-
.toString()
2928
or
3029
key = "Files extracted - without errors" and
31-
value = count(SuccessfullyExtractedFile f | exists(f.getRelativePath())).toString()
30+
value = count(SuccessfullyExtractedFile f | exists(f.getRelativePath()))
3231
or
33-
key = "Lines of code extracted" and value = getLinesOfCode().toString()
32+
key = "Lines of code extracted" and value = getLinesOfCode()
3433
or
35-
key = "Lines of user code extracted" and value = getLinesOfUserCode().toString()
34+
key = "Lines of user code extracted" and value = getLinesOfUserCode()
3635
or
37-
key = "Inconsistencies - AST" and value = getTotalAstInconsistencies().toString()
36+
key = "Inconsistencies - AST" and value = getTotalAstInconsistencies()
3837
or
39-
key = "Inconsistencies - CFG" and value = getTotalCfgInconsistencies().toString()
38+
key = "Inconsistencies - CFG" and value = getTotalCfgInconsistencies()
4039
select key, value

0 commit comments

Comments
 (0)