File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
swift/ql/lib/codeql/swift/security Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ private string regexpProbablySafe() {
91
91
private class SensitiveVarDecl extends VarDecl {
92
92
SensitiveDataType sensitiveType ;
93
93
94
+ cached
94
95
SensitiveVarDecl ( ) { this .getName ( ) .regexpMatch ( sensitiveType .getRegexp ( ) ) }
95
96
96
97
predicate hasInfo ( string label , SensitiveDataType type ) {
@@ -106,6 +107,7 @@ private class SensitiveFunction extends Function {
106
107
SensitiveDataType sensitiveType ;
107
108
string name ; // name of the function, not including the argument list.
108
109
110
+ cached
109
111
SensitiveFunction ( ) {
110
112
name = this .getShortName ( ) and
111
113
name .regexpMatch ( sensitiveType .getRegexp ( ) )
@@ -123,6 +125,7 @@ private class SensitiveFunction extends Function {
123
125
private class SensitiveArgument extends Argument {
124
126
SensitiveDataType sensitiveType ;
125
127
128
+ cached
126
129
SensitiveArgument ( ) { this .getLabel ( ) .regexpMatch ( sensitiveType .getRegexp ( ) ) }
127
130
128
131
predicate hasInfo ( string label , SensitiveDataType type ) {
@@ -174,6 +177,7 @@ class SensitiveExpr extends Expr {
174
177
* A function that is likely used to encrypt or hash data.
175
178
*/
176
179
private class EncryptionFunction extends Function {
180
+ cached
177
181
EncryptionFunction ( ) { this .getName ( ) .regexpMatch ( "(?is).*(crypt|hash|encode|protect).*" ) }
178
182
}
179
183
You can’t perform that action at this time.
0 commit comments