mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #6520 from smowton/smowton/feature/allow-local-interfaces
Java: Allow local interfaces
This commit is contained in:
@@ -37,8 +37,8 @@ where
|
||||
// Remove local classes defined in the dead method - they are reported separately as a dead
|
||||
// class. We keep anonymous class counts, because anonymous classes are not reported
|
||||
// separately.
|
||||
sum(LocalClass localClass |
|
||||
localClass.getLocalClassDeclStmt().getEnclosingCallable() = deadMethod
|
||||
sum(LocalClassOrInterface localClass |
|
||||
localClass.getLocalTypeDeclStmt().getEnclosingCallable() = deadMethod
|
||||
|
|
||||
localClass.getNumberOfLinesOfCode()
|
||||
)
|
||||
|
||||
@@ -122,8 +122,8 @@ where
|
||||
not abortsControlFlow(s) and
|
||||
// Exclude the double semicolon case `if (cond) s;;`.
|
||||
not t instanceof EmptyStmt and
|
||||
// `LocalClassDeclStmt`s yield false positives since their `Location` doesn't include the `class` keyword.
|
||||
not t instanceof LocalClassDeclStmt
|
||||
// `LocalTypeDeclStmt`s yield false positives since their `Location` doesn't include the `class` keyword.
|
||||
not t instanceof LocalTypeDeclStmt
|
||||
select s,
|
||||
"Indentation suggests that $@ belongs to $@, but this is not the case; consider adding braces or adjusting indentation.",
|
||||
t, "the next statement", c, "the control structure"
|
||||
|
||||
@@ -11,7 +11,7 @@ import java
|
||||
abstract private class GeneratedType extends ClassOrInterface {
|
||||
GeneratedType() {
|
||||
not this instanceof AnonymousClass and
|
||||
not this instanceof LocalClass and
|
||||
not this.isLocal() and
|
||||
not this.getPackage() instanceof ExcludedPackage
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user