Merge pull request #11289 from tamasvajk/kotlin-empty-block

Kotlin: Exclude .kt files from empty block query
This commit is contained in:
Tamás Vajk
2022-11-17 11:11:25 +01:00
committed by GitHub
4 changed files with 15 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ predicate blockParent(Stmt empty, string msg) {
from Stmt empty, string msg
where
empty.getFile().isJavaSourceFile() and
empty = emptyBody() and
blockParent(empty, msg)
select empty, msg + " Typographical error or missing code?"

View File

@@ -0,0 +1 @@
Likely Bugs/Statements/EmptyBlock.ql

View File

@@ -0,0 +1,13 @@
class Foo {
abstract inner class Bar {
abstract fun myFun(): Int
}
inner class Baz {
constructor() {
}
fun fn() {
}
}
}