mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
24 lines
623 B
Plaintext
24 lines
623 B
Plaintext
import codeql.ruby.AST
|
|
|
|
private string getValueText(MethodName m) {
|
|
result = m.getConstantValue().getStringlikeValue()
|
|
or
|
|
not exists(m.getConstantValue()) and result = "(none)"
|
|
}
|
|
|
|
query predicate undef(UndefStmt u, int i, MethodName m, string name, string pClass) {
|
|
pClass = m.getAPrimaryQlClass() and
|
|
u.getMethodName(i) = m and
|
|
name = getValueText(m)
|
|
}
|
|
|
|
query predicate alias(AliasStmt a, string prop, MethodName m, string name, string pClass) {
|
|
pClass = m.getAPrimaryQlClass() and
|
|
name = getValueText(m) and
|
|
(
|
|
a.getOldName() = m and prop = "old"
|
|
or
|
|
a.getNewName() = m and prop = "new"
|
|
)
|
|
}
|