Skip to content

Commit 7bd0f53

Browse files
committed
Swift: Update swift/summary/summary-statistics to DataFlow::ConfigSig.
1 parent 7f06109 commit 7bd0f53

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

swift/ql/src/queries/Summary/SummaryStats.ql

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,18 @@ import codeql.swift.dataflow.TaintTracking
1515
/**
1616
* A taint configuration for tainted data reaching any node.
1717
*/
18-
class TaintReachConfig extends TaintTracking::Configuration {
19-
TaintReachConfig() { this = "TaintReachConfig" }
18+
module TaintReachConfig implements DataFlow::ConfigSig {
19+
predicate isSource(DataFlow::Node node) { node instanceof FlowSource }
2020

21-
override predicate isSource(DataFlow::Node node) { node instanceof FlowSource }
22-
23-
override predicate isSink(DataFlow::Node node) { any() }
21+
predicate isSink(DataFlow::Node node) { any() }
2422
}
2523

24+
module TaintReachFlow = TaintTracking::Make<TaintReachConfig>;
25+
2626
/**
2727
* Gets the total number of dataflow nodes that taint reaches (from any source).
2828
*/
29-
int taintedNodesCount() {
30-
exists(TaintReachConfig config | result = count(DataFlow::Node n | config.hasFlowTo(n)))
31-
}
29+
int taintedNodesCount() { result = count(DataFlow::Node n | TaintReachFlow::hasFlowTo(n)) }
3230

3331
/**
3432
* Gets the proportion of dataflow nodes that taint reaches (from any source),

0 commit comments

Comments
 (0)