File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
ql/ql/src/queries/reports Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 2
2
* @name Outdated deprecation
3
3
* @description Deprecations that are over a year old should be removed.
4
4
* @kind problem
5
- * @problem.severity warning
5
+ * @problem.severity recommendation
6
6
* @id ql/outdated-deprecation
7
7
* @tags maintainability
8
8
* @precision high
@@ -32,9 +32,14 @@ class DatedDeprecation extends Annotation {
32
32
)
33
33
}
34
34
35
- date getLastModified ( ) { result = lastModified }
35
+ /** Gets how long ago this deprecation was added, in months. */
36
+ int getMonthsOld ( ) {
37
+ exists ( float month |
38
+ month = 365 / 12 and result = ( lastModified .daysTo ( today ( ) ) / month ) .floor ( )
39
+ )
40
+ }
36
41
}
37
42
38
43
from DatedDeprecation d
39
- where d .getLastModified ( ) . daysTo ( today ( ) ) > 365
40
- select d , "This deprecation is over a year old."
44
+ where d .getMonthsOld ( ) >= 14
45
+ select d , "This deprecation is over 14 months old."
You can’t perform that action at this time.
0 commit comments