mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Kotlin/Java: Exclude generated code from java/missing-override-annotation
This commit is contained in:
@@ -23,6 +23,8 @@ where
|
||||
m.overrides(overridden) and
|
||||
not m.hasModifier("override") and
|
||||
not m.isOverrideAnnotated() and
|
||||
not exists(FunctionalExpr mref | mref.asMethod() = m)
|
||||
not exists(FunctionalExpr mref | mref.asMethod() = m) and
|
||||
// Ignore generated constructs, such as <clinit> functions extracted from Kotlin code:
|
||||
not m.isCompilerGenerated()
|
||||
select m, "This method overrides $@; it is advisable to add an Override annotation.", overridden,
|
||||
overridden.getDeclaringType() + "." + overridden.getName()
|
||||
|
||||
Reference in New Issue
Block a user