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) {
189189 or
190190 key = "Taint reach - nodes tainted" and value = getTaintedNodesCount ( )
191191 or
192+ key = "Taint reach - total non-summary nodes" and value = getTotalNodesCount ( )
193+ or
192194 key = "Taint reach - per million nodes" and value = getTaintReach ( ) .floor ( )
193195 or
194196 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>;
2626 * We don't include flow summary nodes, as their number is unstable (varies when models
2727 * are added).
2828 */
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 ) }
3040
3141/**
3242 * 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
3545 * We don't include flow summary nodes, as their number is unstable (varies when models
3646 * are added).
3747 */
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