Skip to content

Commit 1a30831

Browse files
committed
fix join-order of ql/outdated-deprecation
1 parent fcff18a commit 1a30831

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ql/ql/src/queries/reports/OutdatedDeprecations.ql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@ import codeql_ql.ast.internal.TreeSitter
1313

1414
date today() { result = any(Blame::BlameInfo b).getToday().getValue().toDate() }
1515

16+
pragma[nomagic]
17+
Annotation getADeprecatedAnnotationAt(string filePath, int line) {
18+
result.getLocation().getFile().getRelativePath() = filePath and
19+
result.getLocation().getStartLine() = line and
20+
result.getName() = "deprecated"
21+
}
22+
1623
class DatedDeprecation extends Annotation {
1724
date lastModified;
1825

1926
DatedDeprecation() {
2027
this.getName() = "deprecated" and
2128
exists(Blame::FileEntry f, Blame::BlameEntry b |
22-
f.getFileName().getValue() = this.getLocation().getFile().getRelativePath() and
29+
this = getADeprecatedAnnotationAt(f.getFileName().getValue(), b.getLine(_).getValue().toInt()) and
2330
f.getBlameEntry(_) = b and
24-
b.getLine(_).getValue().toInt() = this.getLocation().getStartLine() and
2531
lastModified = b.getDate().getValue().toDate()
2632
)
2733
}

0 commit comments

Comments
 (0)