Files
codeql/swift/ql/test/library-tests/elements/decl/abstractfunctiondecl/abstractfunctiondecl.ql
2022-10-26 16:32:52 +01:00

29 lines
674 B
Plaintext

import swift
string describe(AbstractFunctionDecl f) {
result = "getName:" + f.getName()
or
exists(string a |
f.hasName(a) and
result = "hasName:" + a
)
or
result = "MethodDecl" and f instanceof MethodDecl
or
exists(string a, string b |
f.(MethodDecl).hasQualifiedName(a, b) and
result = "hasQualifiedName(2):" + a + "." + b
)
or
exists(string a, string b, string c |
f.(MethodDecl).hasQualifiedName(a, b, c) and
result = "hasQualifiedName(3):" + a + "." + b + "." + c
)
}
from AbstractFunctionDecl f
where
not f.getFile() instanceof UnknownFile and
not f.getName().matches("%init%")
select f, concat(describe(f), ", ")