Skip to content

Commit a555a44

Browse files
authored
Merge pull request github#18236 from geoffw0/percent
Rust: Add % of files extracted without errors to summary stats.
2 parents 9513b6c + 1ceee76 commit a555a44

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

rust/ql/integration-tests/hello-project/summary.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| Files extracted - total | 5 |
66
| Files extracted - with errors | 1 |
77
| Files extracted - without errors | 4 |
8+
| Files extracted - without errors % | 80 |
89
| Inconsistencies - AST | 0 |
910
| Inconsistencies - CFG | 0 |
1011
| Inconsistencies - data flow | 0 |

rust/ql/integration-tests/hello-workspace/summary.cargo.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| Files extracted - total | 4 |
66
| Files extracted - with errors | 0 |
77
| Files extracted - without errors | 4 |
8+
| Files extracted - without errors % | 100 |
89
| Inconsistencies - AST | 0 |
910
| Inconsistencies - CFG | 0 |
1011
| Inconsistencies - data flow | 0 |

rust/ql/integration-tests/hello-workspace/summary.rust-project.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| Files extracted - total | 4 |
66
| Files extracted - with errors | 0 |
77
| Files extracted - without errors | 4 |
8+
| Files extracted - without errors % | 100 |
89
| Inconsistencies - AST | 0 |
910
| Inconsistencies - CFG | 0 |
1011
| Inconsistencies - data flow | 0 |

rust/ql/src/queries/summary/SummaryStats.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ where
3232
key = "Files extracted - without errors" and
3333
value = count(SuccessfullyExtractedFile f | exists(f.getRelativePath()))
3434
or
35+
key = "Files extracted - without errors %" and
36+
value =
37+
(count(SuccessfullyExtractedFile f | exists(f.getRelativePath())) * 100) /
38+
count(ExtractedFile f | exists(f.getRelativePath()))
39+
or
3540
key = "Lines of code extracted" and value = getLinesOfCode()
3641
or
3742
key = "Lines of user code extracted" and value = getLinesOfUserCode()

rust/ql/test/query-tests/diagnostics/SummaryStats.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| Files extracted - total | 7 |
66
| Files extracted - with errors | 3 |
77
| Files extracted - without errors | 4 |
8+
| Files extracted - without errors % | 57 |
89
| Inconsistencies - AST | 0 |
910
| Inconsistencies - CFG | 0 |
1011
| Inconsistencies - data flow | 0 |

0 commit comments

Comments
 (0)