kotlin:S6518 False Positive using JOOQ

Dears, we have found the following false positive:

  • What language is this for?
    • Kotlin, with JOOQ
  • Which rule?
  • Why do you believe it’s a false-positive/false-negative?
    • See example code
  • Are you using
    • SonarCloud yes :white_check_mark:
    • SonarLint - IDEA Intellij 2023.2 Ultimate - Plugin version 8.5.1.75093
      • in connected mode with SonarQube or SonarCloud? No :x:
  • How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
import org.jooq.impl.DSL

fun main() {
    val ctx = DSL.using("jdbc://...")
    // ctx is an instance of DSLContext which is a Builder pattern, not a map!
    ctx.insertInto(DSL.dual())
        .set(DSL.field("foo1"), "bar") // S6518 false positive
        .set(DSL.field("foo2"), "baz") // %
        .set(DSL.field("foo3"), "bug") // %
        .execute()
}

see: GitHub - jobayle/sonar-kotlin-S6518

In IDEA Intellij:

Thanks!

Hey there.

Thanks for the report. I think it’s the same one as here:

Hi Colin,

Indeed, it seems to be the same.