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
12
12
import codeql.swift.dataflow.DataFlow
13
13
import codeql.swift.dataflow.TaintTracking
14
14
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
+
15
24
/**
16
25
* A taint configuration for tainted data reaching any node.
17
26
*/
@@ -37,6 +46,8 @@ float taintReach() { result = (taintedNodesCount() * 1000000.0) / count(DataFlow
37
46
predicate statistic ( string what , string value ) {
38
47
what = "Files" and value = count ( File f ) .toString ( )
39
48
or
49
+ what = "Lines of code" and value = linesOfCode ( ) .toString ( )
50
+ or
40
51
what = "Expressions" and value = count ( Expr e | not e .getFile ( ) instanceof UnknownFile ) .toString ( )
41
52
or
42
53
what = "Local flow sources" and value = count ( LocalFlowSource s ) .toString ( )
You can’t perform that action at this time.
0 commit comments