Skip to content

False positive "Unconditional loop jump" #3280

@ileasile

Description

@ileasile

Given the following code:

fun f(): Int {
    for (i in 0 until 10) {
      val a = i * i
      if (a < 27) continue
      return a
    }
}

Expected Behavior

It should pass the check

Observed Behavior

It reports "unconditional loop jump" because of return statement

Steps to Reproduce

Context

Your Environment

Used detekt from codefactor.io, see https://www.codefactor.io/repository/github/kotlin/kotlin-jupyter/source/notebook-api/jupyter-lib/kotlin-jupyter-api/src/main/kotlin/org/jetbrains/kotlin/jupyter/api/KotlinKernelVersion.kt#L13

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions