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 22 * @name Outdated deprecation
33 * @description Deprecations that are over a year old should be removed.
44 * @kind problem
5- * @problem.severity warning
5+ * @problem.severity recommendation
66 * @id ql/outdated-deprecation
77 * @tags maintainability
88 * @precision high
@@ -32,9 +32,14 @@ class DatedDeprecation extends Annotation {
3232 )
3333 }
3434
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+ }
3641}
3742
3843from 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