mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Simplify definition of source and improve QLDoc
This is also slightly faster to evaluate (217s instead of 228s on apache/geode on my machine).
This commit is contained in:
@@ -8,12 +8,15 @@ import semmle.code.java.frameworks.android.Compose
|
||||
private import semmle.code.java.security.Sanitizers
|
||||
|
||||
/** A variable that may hold sensitive information, judging by its name. */
|
||||
class CredentialExpr extends Expr {
|
||||
class VariableWithSensitiveName extends Variable {
|
||||
VariableWithSensitiveName() { this.getName().regexpMatch(getCommonSensitiveInfoRegex()) }
|
||||
}
|
||||
|
||||
/** A reference to a variable that may hold sensitive information, judging by its name. */
|
||||
class CredentialExpr extends VarAccess {
|
||||
CredentialExpr() {
|
||||
exists(Variable v | this = v.getAnAccess() |
|
||||
v.getName().regexpMatch(getCommonSensitiveInfoRegex()) and
|
||||
not this instanceof CompileTimeConstantExpr
|
||||
)
|
||||
this.getVariable() instanceof VariableWithSensitiveName and
|
||||
not this instanceof CompileTimeConstantExpr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user