Third pass

This commit is contained in:
Owen Mansel-Chan
2026-06-11 21:53:01 +02:00
parent 3693185b6b
commit a375e186ed
67 changed files with 130 additions and 73 deletions

View File

@@ -1 +1,2 @@
Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql
query: Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql
query: Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/legacy/AutoBoxing.ql
query: Violations of Best Practice/legacy/AutoBoxing.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Resource Leaks/CloseReader.ql
query: Likely Bugs/Resource Leaks/CloseReader.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Resource Leaks/CloseWriter.ql
query: Likely Bugs/Resource Leaks/CloseWriter.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql
query: Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -2,21 +2,21 @@ fun fn0(f: Function0<Unit>) = f()
fun fn1() {
var c = true
while (c) { // TODO: false positive
while (c) { // $ SPURIOUS: Alert // TODO: false positive
fn0 {
c = false
}
}
var d = true
while (d) {
while (d) { // $ Alert
fn0 {
println(d)
}
}
val e = true
while (e) {
while (e) { // $ Alert
fn0 {
println(e)
}

View File

@@ -1 +1,2 @@
Likely Bugs/Termination/ConstantLoopCondition.ql
query: Likely Bugs/Termination/ConstantLoopCondition.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
DeadCode/DeadClass.ql
query: DeadCode/DeadClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
DeadCode/DeadMethod.ql
query: DeadCode/DeadMethod.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Dead Code/DeadRefTypes.ql
query: Violations of Best Practice/Dead Code/DeadRefTypes.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1,4 +1,4 @@
private class C1 { }
private class C1 { } // $ Alert
private class C2 { }

View File

@@ -1 +1,2 @@
Likely Bugs/Statements/EmptyBlock.ql
query: Likely Bugs/Statements/EmptyBlock.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql
query: Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Performance/InnerClassCouldBeStatic.ql
query: Performance/InnerClassCouldBeStatic.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Comparison/MissingInstanceofInEquals.ql
query: Likely Bugs/Comparison/MissingInstanceofInEquals.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Advisory/Declarations/MissingOverrideAnnotation.ql
query: Advisory/Declarations/MissingOverrideAnnotation.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Architecture/Dependencies/MutualDependency.ql
query: Architecture/Dependencies/MutualDependency.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Advisory/Naming/NamingConventionsRefTypes.ql
query: Advisory/Naming/NamingConventionsRefTypes.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -9,4 +9,4 @@ class Foo {
}
}
class aaaa {}
class aaaa {} // $ Alert

View File

@@ -1 +1,2 @@
Likely Bugs/Serialization/NonSerializableField.ql
query: Likely Bugs/Serialization/NonSerializableField.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Serialization/NonSerializableInnerClass.ql
query: Likely Bugs/Serialization/NonSerializableInnerClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Nullness/NullMaybe.ql
query: Likely Bugs/Nullness/NullMaybe.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Advisory/Statements/OneStatementPerLine.ql
query: Advisory/Statements/OneStatementPerLine.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Statements/PartiallyMaskedCatch.ql
query: Likely Bugs/Statements/PartiallyMaskedCatch.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Statements/ReturnValueIgnored.ql
query: Likely Bugs/Statements/ReturnValueIgnored.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql
query: Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Compatibility/JDK9/UnderscoreIdentifier.ql
query: Compatibility/JDK9/UnderscoreIdentifier.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Dead Code/UnreadLocal.ql
query: Violations of Best Practice/Dead Code/UnreadLocal.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -5,13 +5,13 @@ fun fn0(size: Int) {
}
fun fn1(a: Array<Int>) {
for (e in a) {
for (e in a) { // $ Alert
println()
}
}
fun fn2(a: Array<Int>) {
for ((idx, e) in a.withIndex()) {
for ((idx, e) in a.withIndex()) { // $ Alert
println()
}
}

View File

@@ -13,6 +13,6 @@ fun fn(x:Any?, y: Any?) {
fun fn0(o: Any?) {
if (o != null) {
o?.toString()
o.toString()
o.toString() // $ Alert
}
}

View File

@@ -1 +1,2 @@
Language Abuse/UselessNullCheck.ql
query: Language Abuse/UselessNullCheck.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
DeadCode/UselessParameter.ql
query: DeadCode/UselessParameter.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql
query: Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql
query: Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/legacy/AutoBoxing.ql
query: Violations of Best Practice/legacy/AutoBoxing.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Resource Leaks/CloseReader.ql
query: Likely Bugs/Resource Leaks/CloseReader.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Resource Leaks/CloseWriter.ql
query: Likely Bugs/Resource Leaks/CloseWriter.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql
query: Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -2,21 +2,21 @@ fun fn0(f: Function0<Unit>) = f()
fun fn1() {
var c = true
while (c) { // TODO: false positive
while (c) { // $ SPURIOUS: Alert // TODO: false positive
fn0 {
c = false
}
}
var d = true
while (d) {
while (d) { // $ Alert
fn0 {
println(d)
}
}
val e = true
while (e) {
while (e) { // $ Alert
fn0 {
println(e)
}

View File

@@ -1 +1,2 @@
Likely Bugs/Termination/ConstantLoopCondition.ql
query: Likely Bugs/Termination/ConstantLoopCondition.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
DeadCode/DeadClass.ql
query: DeadCode/DeadClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
DeadCode/DeadMethod.ql
query: DeadCode/DeadMethod.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Dead Code/DeadRefTypes.ql
query: Violations of Best Practice/Dead Code/DeadRefTypes.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1,4 +1,4 @@
private class C1 { }
private class C1 { } // $ Alert
private class C2 { }

View File

@@ -1 +1,2 @@
Likely Bugs/Statements/EmptyBlock.ql
query: Likely Bugs/Statements/EmptyBlock.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql
query: Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Performance/InnerClassCouldBeStatic.ql
query: Performance/InnerClassCouldBeStatic.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Comparison/MissingInstanceofInEquals.ql
query: Likely Bugs/Comparison/MissingInstanceofInEquals.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Advisory/Declarations/MissingOverrideAnnotation.ql
query: Advisory/Declarations/MissingOverrideAnnotation.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Architecture/Dependencies/MutualDependency.ql
query: Architecture/Dependencies/MutualDependency.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Advisory/Naming/NamingConventionsRefTypes.ql
query: Advisory/Naming/NamingConventionsRefTypes.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -9,4 +9,4 @@ class Foo {
}
}
class aaaa {}
class aaaa {} // $ Alert

View File

@@ -1 +1,2 @@
Likely Bugs/Serialization/NonSerializableField.ql
query: Likely Bugs/Serialization/NonSerializableField.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Serialization/NonSerializableInnerClass.ql
query: Likely Bugs/Serialization/NonSerializableInnerClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Nullness/NullMaybe.ql
query: Likely Bugs/Nullness/NullMaybe.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Advisory/Statements/OneStatementPerLine.ql
query: Advisory/Statements/OneStatementPerLine.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Statements/PartiallyMaskedCatch.ql
query: Likely Bugs/Statements/PartiallyMaskedCatch.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Statements/ReturnValueIgnored.ql
query: Likely Bugs/Statements/ReturnValueIgnored.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql
query: Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Compatibility/JDK9/UnderscoreIdentifier.ql
query: Compatibility/JDK9/UnderscoreIdentifier.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Violations of Best Practice/Dead Code/UnreadLocal.ql
query: Violations of Best Practice/Dead Code/UnreadLocal.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -5,13 +5,13 @@ fun fn0(size: Int) {
}
fun fn1(a: Array<Int>) {
for (e in a) {
for (e in a) { // $ Alert
println()
}
}
fun fn2(a: Array<Int>) {
for ((idx, e) in a.withIndex()) {
for ((idx, e) in a.withIndex()) { // $ Alert
println()
}
}

View File

@@ -13,6 +13,6 @@ fun fn(x:Any?, y: Any?) {
fun fn0(o: Any?) {
if (o != null) {
o?.toString()
o.toString()
o.toString() // $ Alert
}
}

View File

@@ -1 +1,2 @@
Language Abuse/UselessNullCheck.ql
query: Language Abuse/UselessNullCheck.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
DeadCode/UselessParameter.ql
query: DeadCode/UselessParameter.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -1 +1,2 @@
Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql
query: Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql