Skip to content

Commit 30cc550

Browse files
committed
Rust: Add rust/diagnostics/data-flow-consistency-counts query for data flow inconsistency counts.
1 parent 91ebc0e commit 30cc550

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @name Data flow inconsistency counts
3+
* @description Counts the number of data flow inconsistencies of each type. This query is intended for internal use.
4+
* @kind diagnostic
5+
* @id rust/diagnostics/data-flow-consistency-counts
6+
*/
7+
8+
private import rust
9+
private import codeql.rust.dataflow.internal.DataFlowImpl
10+
private import codeql.rust.dataflow.internal.TaintTrackingImpl
11+
private import codeql.dataflow.internal.DataFlowImplConsistency
12+
13+
private module Input implements InputSig<Location, RustDataFlow> { }
14+
15+
// see also `rust/diagnostics/data-flow-consistency`, which lists the
16+
// individual inconsistency results.
17+
from string type, int num
18+
where
19+
num =
20+
MakeConsistency<Location, RustDataFlow, RustTaintTracking, Input>::getInconsistencyCounts(type)
21+
select type, num
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
| ArgumentNode is missing PostUpdateNode | 0 |
2+
| Call context for isUnreachableInCall is inconsistent with call graph | 0 |
3+
| Call context too large | 0 |
4+
| Call should have one enclosing callable | 7 |
5+
| Callable mismatch for parameter | 0 |
6+
| Lambda call enclosing callable mismatch | 0 |
7+
| Local flow step does not preserve enclosing callable | 0 |
8+
| Missing call for argument node | 0 |
9+
| Multiple calls for argument node | 0 |
10+
| Node and call does not share enclosing callable | 0 |
11+
| Node has multiple PostUpdateNodes | 0 |
12+
| Node should have one enclosing callable | 0 |
13+
| Node should have one location | 0 |
14+
| Node should have one toString | 0 |
15+
| Node should have one type | 0 |
16+
| Node steps to itself | 0 |
17+
| Nodes without location | 0 |
18+
| Non-unique content approximation | 0 |
19+
| Origin of readStep is missing a PostUpdateNode | 0 |
20+
| Parameter node with multiple positions | 0 |
21+
| Parameters with overlapping positions | 0 |
22+
| PostUpdateNode does not share callable with its pre-update node | 0 |
23+
| PostUpdateNode should have one pre-update node | 0 |
24+
| PostUpdateNode should not be the target of local flow | 0 |
25+
| PostUpdateNode should not equal its pre-update node | 0 |
26+
| Read step does not preserve enclosing callable | 0 |
27+
| Speculative step already hasM Model | 0 |
28+
| Store step does not preserve enclosing callable | 0 |
29+
| Type compatibility predicate is not reflexive | 0 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
queries/diagnostics/DataFlowConsistencyCounts.ql

0 commit comments

Comments
 (0)