Skip to content

Commit

Permalink
Merge pull request #18236 from geoffw0/percent
Browse files Browse the repository at this point in the history
Rust: Add % of files extracted without errors to summary stats.
  • Loading branch information
redsun82 authored Dec 6, 2024
2 parents 9513b6c + 1ceee76 commit a555a44
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions rust/ql/integration-tests/hello-project/summary.expected
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| Files extracted - total | 5 |
| Files extracted - with errors | 1 |
| Files extracted - without errors | 4 |
| Files extracted - without errors % | 80 |
| Inconsistencies - AST | 0 |
| Inconsistencies - CFG | 0 |
| Inconsistencies - data flow | 0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| Files extracted - total | 4 |
| Files extracted - with errors | 0 |
| Files extracted - without errors | 4 |
| Files extracted - without errors % | 100 |
| Inconsistencies - AST | 0 |
| Inconsistencies - CFG | 0 |
| Inconsistencies - data flow | 0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| Files extracted - total | 4 |
| Files extracted - with errors | 0 |
| Files extracted - without errors | 4 |
| Files extracted - without errors % | 100 |
| Inconsistencies - AST | 0 |
| Inconsistencies - CFG | 0 |
| Inconsistencies - data flow | 0 |
Expand Down
5 changes: 5 additions & 0 deletions rust/ql/src/queries/summary/SummaryStats.ql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ where
key = "Files extracted - without errors" and
value = count(SuccessfullyExtractedFile f | exists(f.getRelativePath()))
or
key = "Files extracted - without errors %" and
value =
(count(SuccessfullyExtractedFile f | exists(f.getRelativePath())) * 100) /
count(ExtractedFile f | exists(f.getRelativePath()))
or
key = "Lines of code extracted" and value = getLinesOfCode()
or
key = "Lines of user code extracted" and value = getLinesOfUserCode()
Expand Down
1 change: 1 addition & 0 deletions rust/ql/test/query-tests/diagnostics/SummaryStats.expected
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| Files extracted - total | 7 |
| Files extracted - with errors | 3 |
| Files extracted - without errors | 4 |
| Files extracted - without errors % | 57 |
| Inconsistencies - AST | 0 |
| Inconsistencies - CFG | 0 |
| Inconsistencies - data flow | 0 |
Expand Down

0 comments on commit a555a44

Please sign in to comment.