Skip to content

Commit d4c3e33

Browse files
committed
Rust: Add diagnostic query for CFG inconsistency counts.
1 parent 7b712f3 commit d4c3e33

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @name Control flow graph inconsistency counts
3+
* @description Counts the number of control flow graph inconsistencies of each type. This query is intended for internal use.
4+
* @kind diagnostic
5+
* @id rust/diagnostics/cfg-consistency-counts
6+
*/
7+
8+
import rust
9+
import codeql.rust.controlflow.internal.CfgConsistency as Consistency
10+
11+
// see also `rust/diagnostics/cfg-consistency`, which lists the
12+
// individual inconsistency results.
13+
from string type, int num
14+
where num = Consistency::getCfgInconsistencyCounts(type)
15+
select type, num
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
| CFG scope lacks initial AST node | 0 |
2+
| Dead end | 0 |
3+
| Multiple successors of the same type | 0 |
4+
| Multiple toStrings | 0 |
5+
| Non-PostOrderTree Expr node | 0 |
6+
| Non-unique list order | 0 |
7+
| Non-unique set representation | 0 |
8+
| Non-unique split kind | 0 |
9+
| Simple and normal successors | 0 |
10+
| Splitting invariant 2 | 0 |
11+
| Splitting invariant 3 | 0 |
12+
| Splitting invariant 4 | 0 |
13+
| Splitting invariant 5 | 0 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
queries/diagnostics/CfgConsistencyCounts.ql

0 commit comments

Comments
 (0)