Add org.apache.commons.lang.RandomStringUtils as a source

This commit is contained in:
Ed Minnix
2023-07-11 17:18:31 -04:00
parent 1daa83bf46
commit bf0123d6ae

View File

@@ -29,6 +29,21 @@ private class JavaRandomSource extends WeakRandomnessSource {
}
}
private class ApacheRandomStringUtilsMethodAccessSource extends WeakRandomnessSource {
ApacheRandomStringUtilsMethodAccessSource() {
exists(MethodAccess ma | this.asExpr() = ma |
ma.getMethod()
.hasName([
"random", "randomAlphabetic", "randomAlphanumeric", "randomAscii", "randomGraph",
"randomNumeric", "randomPrint"
]) and
ma.getMethod()
.getDeclaringType()
.hasQualifiedName("org.apache.commons.lang", "RandomStringUtils")
)
}
}
/**
* The `random` method of `java.lang.Math`.
*/