Files
codeql/java/ql/test-kotlin2/library-tests/extensions/methods.ql
2023-11-17 14:07:13 +00:00

17 lines
510 B
Plaintext

import java
// Stop external filepaths from appearing in the results
class ClassOrInterfaceLocation extends ClassOrInterface {
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
exists(string fullPath | super.hasLocationInfo(fullPath, sl, sc, el, ec) |
if exists(this.getFile().getRelativePath())
then path = fullPath
else path = fullPath.regexpReplaceAll(".*/", "<external>/")
)
}
}
from Method m
where m.fromSource()
select m, m.getReturnType()