Must-share information:
- SonarQube Enterprise v9.9.5 (build 90363)
- SonarQube Gradle Plugin 5.0.0.4638
- I do not know how it is deployed, if relevant for this issue, I can inquire this information from my IT dept
I looked through the public issue tracker and could not find a similar issue, so here I go, if this is not the right place to place this please do point me in a direction as I could not find another obvious place to report it to.
As the title says its about a false-positive in rule kotlin:S1128 “Unnecessary imports should be removed” when using this import from Jetbrains Compose:
import androidx.compose.runtime.getValue
or
import androidx.compose.runtime.setValue
The imports are necessary according to the compiler for using e.g.
androidx.compose.foundation.interaction.collectIsPressedAsState (see PressInteraction.kt:84 in Compose; requires getValue import)
or
androidx.compose.runtime.remember (see Composables.kt:24 in Compose; requires setValue import).
Thank you. If I can add any other information to help anyone in fixing this issue, please let me know.