mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #11289 from tamasvajk/kotlin-empty-block
Kotlin: Exclude .kt files from empty block query
This commit is contained in:
@@ -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?"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Likely Bugs/Statements/EmptyBlock.ql
|
||||
13
java/ql/test/kotlin/query-tests/EmptyBlock/Test.kt
Normal file
13
java/ql/test/kotlin/query-tests/EmptyBlock/Test.kt
Normal file
@@ -0,0 +1,13 @@
|
||||
class Foo {
|
||||
abstract inner class Bar {
|
||||
abstract fun myFun(): Int
|
||||
}
|
||||
|
||||
inner class Baz {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
fun fn() {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user