File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
rust/ql/src/queries/summary Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ predicate taintStats(string key, int value) {
189
189
or
190
190
key = "Taint reach - nodes tainted" and value = getTaintedNodesCount ( )
191
191
or
192
+ key = "Taint reach - total non-summary nodes" and value = getTotalNodesCount ( )
193
+ or
192
194
key = "Taint reach - per million nodes" and value = getTaintReach ( ) .floor ( )
193
195
or
194
196
key = "Taint sinks - query sinks" and value = getQuerySinksCount ( )
Original file line number Diff line number Diff line change @@ -26,7 +26,17 @@ private module TaintReachFlow = TaintTracking::Global<TaintReachConfig>;
26
26
* We don't include flow summary nodes, as their number is unstable (varies when models
27
27
* are added).
28
28
*/
29
- int getTaintedNodesCount ( ) { result = count ( DataFlow:: Node n | TaintReachFlow:: flowTo ( n ) and not n instanceof FlowSummaryNode ) }
29
+ int getTaintedNodesCount ( ) {
30
+ result = count ( DataFlow:: Node n | TaintReachFlow:: flowTo ( n ) and not n instanceof FlowSummaryNode )
31
+ }
32
+
33
+ /**
34
+ * Gets the total number of data flow nodes.
35
+ *
36
+ * We don't include flow summary nodes, as their number is unstable (varies when models
37
+ * are added).
38
+ */
39
+ int getTotalNodesCount ( ) { result = count ( DataFlow:: Node n | not n instanceof FlowSummaryNode ) }
30
40
31
41
/**
32
42
* Gets the proportion of data flow nodes that taint reaches (from any source),
@@ -35,4 +45,4 @@ int getTaintedNodesCount() { result = count(DataFlow::Node n | TaintReachFlow::f
35
45
* We don't include flow summary nodes, as their number is unstable (varies when models
36
46
* are added).
37
47
*/
38
- float getTaintReach ( ) { result = ( getTaintedNodesCount ( ) * 1000000.0 ) / count ( DataFlow :: Node n | not n instanceof FlowSummaryNode ) }
48
+ float getTaintReach ( ) { result = ( getTaintedNodesCount ( ) * 1000000.0 ) / getTotalNodesCount ( ) }
You can’t perform that action at this time.
0 commit comments