mirror of
https://github.com/github/codeql.git
synced 2026-02-16 23:13:43 +01:00
With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests.
26 lines
807 B
Plaintext
26 lines
807 B
Plaintext
import swift
|
|
|
|
string describe(Decl d) {
|
|
d instanceof EnumDecl and result = "(EnumDecl)"
|
|
or
|
|
d instanceof EnumCaseDecl and result = "(EnumCaseDecl)"
|
|
or
|
|
d instanceof EnumElementDecl and result = "(EnumElementDecl)"
|
|
or
|
|
result = ".getType = " + d.(EnumDecl).getType().toString()
|
|
or
|
|
result = ".getDeclaringDecl = " + d.getDeclaringDecl().toString()
|
|
or
|
|
exists(int i |
|
|
result = ".getElement(" + i.toString() + ") = " + d.(EnumCaseDecl).getElement(i).toString()
|
|
or
|
|
result = ".getParam(" + i.toString() + ") = " + d.(EnumElementDecl).getParam(i).toString()
|
|
or
|
|
result = ".getEnumElement(" + i.toString() + ") = " + d.(EnumDecl).getEnumElement(i).toString()
|
|
)
|
|
}
|
|
|
|
from Decl d
|
|
where exists(d.getLocation().getFile().getRelativePath())
|
|
select d, strictconcat(describe(d), ", ")
|