File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
ql/ql/src/queries/reports Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ import ql
2
+ import codeql_ql.ast.internal.TreeSitter
3
+
4
+ date today ( ) { result = any ( Blame:: BlameInfo b ) .getToday ( ) .getValue ( ) .toDate ( ) }
5
+
6
+ class DatedDeprecation extends Annotation {
7
+ date lastModified ;
8
+
9
+ DatedDeprecation ( ) {
10
+ this .getName ( ) = "deprecated" and
11
+ exists ( Blame:: FileEntry f , Blame:: BlameEntry b |
12
+ f .getFileName ( ) .getValue ( ) = this .getLocation ( ) .getFile ( ) .getRelativePath ( ) and
13
+ f .getBlameEntry ( _) = b and
14
+ b .getLine ( _) .getValue ( ) .toInt ( ) = this .getLocation ( ) .getStartLine ( ) and
15
+ lastModified = b .getDate ( ) .getValue ( ) .toDate ( )
16
+ )
17
+ }
18
+
19
+ date getLastModified ( ) { result = lastModified }
20
+ }
21
+
22
+ from DatedDeprecation d
23
+ where d .getLastModified ( ) .daysTo ( today ( ) ) > 365
24
+ select d , "This deprecation is over a year old."
You can’t perform that action at this time.
0 commit comments