mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Kotlin: Add FP test case for ignored return value query
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| Test.kt:14:29:14:33 | foo(...) | The result of the call is ignored, but 90% of calls to foo use the return value. |
|
||||
@@ -0,0 +1 @@
|
||||
Likely Bugs/Statements/ReturnValueIgnored.ql
|
||||
16
java/ql/test/kotlin/query-tests/ReturnValueIgnored/Test.kt
Normal file
16
java/ql/test/kotlin/query-tests/ReturnValueIgnored/Test.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
class Foo {
|
||||
fun foo(): Int { return 5 }
|
||||
fun bar() {
|
||||
val x0 = foo()
|
||||
val x1 = foo()
|
||||
val x2 = foo()
|
||||
val x3 = foo()
|
||||
val x4 = foo()
|
||||
val x5 = foo()
|
||||
val x6 = foo()
|
||||
val x7 = foo()
|
||||
val x8 = foo()
|
||||
val x9 = foo()
|
||||
val x = if (true) { foo() } else 6
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user