Rename QL elements that refer to local classes

This commit is contained in:
Chris Smowton
2021-09-02 12:30:54 +01:00
parent 0a5410c2d3
commit 608d24f75e
11 changed files with 48 additions and 24 deletions

View File

@@ -38,7 +38,7 @@ where
// class. We keep anonymous class counts, because anonymous classes are not reported
// separately.
sum(LocalClassOrInterface localClass |
localClass.getLocalClassDeclStmt().getEnclosingCallable() = deadMethod
localClass.getLocalTypeDeclStmt().getEnclosingCallable() = deadMethod
|
localClass.getNumberOfLinesOfCode()
)

View File

@@ -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"