Skip to content

Commit ec573bd

Browse files
committed
Swift: Clean up and improve consistency.
1 parent ee83ad7 commit ec573bd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

swift/ql/src/queries/Summary/FlowSources.ql

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@
99
* @tags summary
1010
*/
1111

12+
/*
13+
* Most queries compute data flow from one of the following sources:
14+
* - flow sources (listed by this query, `swift/summary/flow-sources`).
15+
* - sensitive expressions (see `swift/summary/sensitive-expressions`).
16+
* - constant values.
17+
* - custom per-query sources.
18+
*/
19+
1220
import swift
1321
import codeql.swift.dataflow.FlowSources
1422

1523
string sourceClass(FlowSource s) {
16-
s instanceof LocalFlowSource and result = "LocalFlowSource"
24+
s instanceof LocalFlowSource and result = "Local flow source"
1725
or
18-
s instanceof RemoteFlowSource and result = "RemoteFlowSource"
26+
s instanceof RemoteFlowSource and result = "Remote flow source"
1927
}
2028

2129
from FlowSource s

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name Summary statistics
2+
* @name Summary Statistics
33
* @description A table of summary statistics about a database.
44
* @kind table
55
* @id swift/summary/summary-statistics
@@ -59,6 +59,9 @@ predicate statistic(string what, string value) {
5959
what = "Taint reach (per million nodes)" and value = taintReach().toString()
6060
or
6161
what = "Regular expression evals" and value = count(RegexEval e).toString()
62+
or
63+
what = "Regular expression evals with associated regex" and
64+
value = count(RegexEval e | exists(e.getARegex())).toString()
6265
}
6366

6467
from string what, string value

0 commit comments

Comments
 (0)