File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
swift/ql/src/queries/Summary Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ import codeql.swift.security.SensitiveExprs
1212import codeql.swift.dataflow.DataFlow
1313import codeql.swift.dataflow.TaintTracking
1414
15+ int linesOfCode ( ) {
16+ // approximate number of lines of code in the database
17+ result = count ( File f , int line |
18+ exists ( Location loc |
19+ not loc instanceof UnknownLocation and loc .getFile ( ) = f and loc .getStartLine ( ) = line
20+ )
21+ )
22+ }
23+
1524/**
1625 * A taint configuration for tainted data reaching any node.
1726 */
@@ -37,6 +46,8 @@ float taintReach() { result = (taintedNodesCount() * 1000000.0) / count(DataFlow
3746predicate statistic ( string what , string value ) {
3847 what = "Files" and value = count ( File f ) .toString ( )
3948 or
49+ what = "Lines of code" and value = linesOfCode ( ) .toString ( )
50+ or
4051 what = "Expressions" and value = count ( Expr e | not e .getFile ( ) instanceof UnknownFile ) .toString ( )
4152 or
4253 what = "Local flow sources" and value = count ( LocalFlowSource s ) .toString ( )
You can’t perform that action at this time.
0 commit comments