@@ -93,9 +93,7 @@ module CleartextLogging {
93
93
* Gets the name of a method that would be falsely marked as non-sensitive
94
94
* by `notSensitiveRegexp`.
95
95
*/
96
- private predicate nonSensitiveMethodNameExclusion ( string name ) {
97
- name = [ "[]" , "[]=" ]
98
- }
96
+ private predicate nonSensitiveMethodNameExclusion ( string name ) { name = [ "[]" , "[]=" ] }
99
97
100
98
/**
101
99
* A call that might obfuscate a password, for example through hashing.
@@ -125,10 +123,8 @@ module CleartextLogging {
125
123
.getStringOrSymbol ( ) = name
126
124
or
127
125
// calling a non-sensitive method
128
- (
129
- this .( DataFlow:: CallNode ) .getMethodName ( ) = name and
130
- not nonSensitiveMethodNameExclusion ( name )
131
- )
126
+ this .( DataFlow:: CallNode ) .getMethodName ( ) = name and
127
+ not nonSensitiveMethodNameExclusion ( name )
132
128
)
133
129
or
134
130
// avoid i18n strings
@@ -215,8 +211,7 @@ module CleartextLogging {
215
211
// avoid safe values assigned to presumably unsafe names
216
212
not val instanceof NonCleartextPassword and
217
213
// hash = { name: val }
218
- exists ( Pair p |
219
- this .asExpr ( ) .getExpr ( ) = lit and p = lit .getAKeyValuePair ( ) |
214
+ exists ( Pair p | this .asExpr ( ) .getExpr ( ) = lit and p = lit .getAKeyValuePair ( ) |
220
215
p .getKey ( ) .getConstantValue ( ) .getStringOrSymbol ( ) = name and
221
216
p .getValue ( ) = val .asExpr ( ) .getExpr ( )
222
217
)
@@ -234,10 +229,9 @@ module CleartextLogging {
234
229
// avoid safe values assigned to presumably unsafe names
235
230
not this instanceof NonCleartextPassword and
236
231
name .regexpMatch ( maybePassword ( ) ) and
237
- (
238
- exists ( Assignment a |
239
- this .asExpr ( ) .getExpr ( ) = a .getRightOperand ( ) and
240
- a .getLeftOperand ( ) .getAVariable ( ) .getName ( ) = name )
232
+ exists ( Assignment a |
233
+ this .asExpr ( ) .getExpr ( ) = a .getRightOperand ( ) and
234
+ a .getLeftOperand ( ) .getAVariable ( ) .getName ( ) = name
241
235
)
242
236
}
243
237
0 commit comments