File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
ql/ql/src/queries/reports Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,21 @@ import codeql_ql.ast.internal.TreeSitter
13
13
14
14
date today ( ) { result = any ( Blame:: BlameInfo b ) .getToday ( ) .getValue ( ) .toDate ( ) }
15
15
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
+
16
23
class DatedDeprecation extends Annotation {
17
24
date lastModified ;
18
25
19
26
DatedDeprecation ( ) {
20
27
this .getName ( ) = "deprecated" and
21
28
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
23
30
f .getBlameEntry ( _) = b and
24
- b .getLine ( _) .getValue ( ) .toInt ( ) = this .getLocation ( ) .getStartLine ( ) and
25
31
lastModified = b .getDate ( ) .getValue ( ) .toDate ( )
26
32
)
27
33
}
You can’t perform that action at this time.
0 commit comments