fix join-order of ql/outdated-deprecation

This commit is contained in:
erik-krogh
2023-02-18 12:28:06 +01:00
parent fcff18aa3c
commit 1a308316c6

View File

@@ -13,15 +13,21 @@ import codeql_ql.ast.internal.TreeSitter
date today() { result = any(Blame::BlameInfo b).getToday().getValue().toDate() }
pragma[nomagic]
Annotation getADeprecatedAnnotationAt(string filePath, int line) {
result.getLocation().getFile().getRelativePath() = filePath and
result.getLocation().getStartLine() = line and
result.getName() = "deprecated"
}
class DatedDeprecation extends Annotation {
date lastModified;
DatedDeprecation() {
this.getName() = "deprecated" and
exists(Blame::FileEntry f, Blame::BlameEntry b |
f.getFileName().getValue() = this.getLocation().getFile().getRelativePath() and
this = getADeprecatedAnnotationAt(f.getFileName().getValue(), b.getLine(_).getValue().toInt()) and
f.getBlameEntry(_) = b and
b.getLine(_).getValue().toInt() = this.getLocation().getStartLine() and
lastModified = b.getDate().getValue().toDate()
)
}