mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
24 lines
708 B
Plaintext
24 lines
708 B
Plaintext
import codeql.ruby.AST
|
|
import TestUtilities.InlineExpectationsTest
|
|
import codeql.ruby.security.ImproperMemoizationQuery
|
|
|
|
class ImproperMemoizationTest extends InlineExpectationsTest {
|
|
ImproperMemoizationTest() { this = "ImproperMemoizationTest" }
|
|
|
|
override string getARelevantTag() { result = "result" }
|
|
|
|
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
tag = "result" and
|
|
value = "BAD" and
|
|
exists(Expr e |
|
|
isImproperMemoizationMethod(e, _, _) and
|
|
location = e.getLocation() and
|
|
element = e.toString()
|
|
)
|
|
}
|
|
}
|
|
|
|
from Method m, Parameter p, AssignLogicalOrExpr s
|
|
where isImproperMemoizationMethod(m, p, s)
|
|
select m, p, s
|