# \#kotlin

**URL:** https://community.sonarsource.com/tag/kotlin/17.md

[Latest](https://community.sonarsource.com/latest.md) · [Categories](https://community.sonarsource.com/categories.md) · [Tags](https://community.sonarsource.com/tags.md)

---

## [kotlin:S6312 raises on suspend extensions of CoroutineScope subtypes like Ktor’s ApplicationCall](https://community.sonarsource.com/t/kotlin-s6312-raises-on-suspend-extensions-of-coroutinescope-subtypes-like-ktor-s-applicationcall/190494)

<div class="topic-metadata">

**Author:** [@felipebz](https://community.sonarsource.com/u/felipebz)\
**Replies:** 1\
**Last updated:** [November 26, 2026, 10:30am UTC](https://community.sonarsource.com/t/kotlin-s6312-raises-on-suspend-extensions-of-coroutinescope-subtypes-like-ktor-s-applicationcall/190494 "2026-11-26T10:30:21Z")

</div>

What language is this for? Kotlin Which rule? kotlin:S6312 - Extension functions on CoroutineScope should not be suspending Why do you believe it’s a false-positive? The rule targets functions that start backg…

---

## [kotlin:S107 still reports issues on Jetpack Compose @Composable functions in SonarQube Cloud](https://community.sonarsource.com/t/kotlin-s107-still-reports-issues-on-jetpack-compose-composable-functions-in-sonarqube-cloud/188016)

<div class="topic-metadata">

**Author:** [@sirambd](https://community.sonarsource.com/u/sirambd)\
**Replies:** 2\
**Last updated:** [September 14, 2026, 7:27am UTC](https://community.sonarsource.com/t/kotlin-s107-still-reports-issues-on-jetpack-compose-composable-functions-in-sonarqube-cloud/188016 "2026-09-14T07:27:43Z")

</div>

Hi, I’m opening a new topic because the previous discussion about this issue is now older than two months: Previous topic: We are currently using SonarQube Cloud, and kotlin:S107 is still reporting issues on functio…

---

## [Kotlin: S3923 when branches code duplication should not be an issue](https://community.sonarsource.com/t/kotlin-s3923-when-branches-code-duplication-should-not-be-an-issue/183577)

<div class="topic-metadata">

**Author:** [@matthieu](https://community.sonarsource.com/u/matthieu)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 10:00am UTC](https://community.sonarsource.com/t/kotlin-s3923-when-branches-code-duplication-should-not-be-an-issue/183577 "2026-08-12T10:00:32Z")

</div>

Language Kotlin 2.3.21 Rule S3923 : All branches in a conditional structure should not have exactly the same implementation Why it is a false-positive In Kotlin, when several types in a sealed hierarchy have a commo…

---

## [\`kotlin:S6508\` fires on \`Mono\<Void\>\` return types from Project Reactor](https://community.sonarsource.com/t/kotlin-s6508-fires-on-mono-void-return-types-from-project-reactor/182931)

<div class="topic-metadata">

**Author:** [@Laurent\_T\_Locala](https://community.sonarsource.com/u/Laurent_T_Locala)\
**Replies:** 1\
**Last updated:** [June 5, 2026, 10:25am UTC](https://community.sonarsource.com/t/kotlin-s6508-fires-on-mono-void-return-types-from-project-reactor/182931 "2026-06-05T10:25:55Z")

</div>

Hello, I’d like to share a context where rule kotlin:S6508 fires on code that follows the documented convention of an underlying library, in case it is useful to the team. Context In Kotlin code that uses Project Re…

---

## [kotlin:S1862 Guard conditions in when expression/statement](https://community.sonarsource.com/t/kotlin-s1862-guard-conditions-in-when-expression-statement/147061)

<div class="topic-metadata">

**Author:** [@lnschroeder](https://community.sonarsource.com/u/lnschroeder)\
**Replies:** 4\
**Last updated:** [May 21, 2026, 4:00pm UTC](https://community.sonarsource.com/t/kotlin-s1862-guard-conditions-in-when-expression-statement/147061 "2026-05-21T16:00:31Z")

</div>

Language Kotlin 2.2.0 Rule kotlin:S1862 This condition duplicates the one on line X. Why it is a false-positive In Kotllin 2.2.0 guard conditions were introduced for when expressions and statements: It seems, tha…

---

## [Sonarqube in Intellij completely ignores java and kotlin files](https://community.sonarsource.com/t/sonarqube-in-intellij-completely-ignores-java-and-kotlin-files/182063)

<div class="topic-metadata">

**Author:** [@michael-hirsch\_workd](https://community.sonarsource.com/u/michael-hirsch_workd)\
**Replies:** 4\
**Last updated:** [May 18, 2026, 12:00pm UTC](https://community.sonarsource.com/t/sonarqube-in-intellij-completely-ignores-java-and-kotlin-files/182063 "2026-05-18T12:00:49Z")

</div>

Operating system: MacOS Tahoe 26.4.1 SonarQube for IntelliJ plugin version: 12.2.0.84584 IntelliJ version: 2026.1 Build #IU-261.22158.277, built on March 24, 2026 Programming language you’re coding in: Kotlin and java I…

---

## [Sonar Cli compatibility with kotlin and Java 25](https://community.sonarsource.com/t/sonar-cli-compatibility-with-kotlin-and-java-25/181563)

<div class="topic-metadata">

**Author:** [@FABIEN\_MOAL](https://community.sonarsource.com/u/FABIEN_MOAL)\
**Replies:** 4\
**Last updated:** [April 22, 2026, 4:42pm UTC](https://community.sonarsource.com/t/sonar-cli-compatibility-with-kotlin-and-java-25/181563 "2026-04-22T16:42:03Z")

</div>

Hi I’ve a koltin (v2.3.20) project, with gradle 9.4.1 and Java25 from ubuntu image =\> https://raw.githubusercontent.com/adoptium/containers/main/25/jdk/ubuntu/noble/Dockerfile We have upgrade old scanner (from 4.8.0.28…

---

## [False positive: kotlin:S6619](https://community.sonarsource.com/t/false-positive-kotlin-s6619/180347)

<div class="topic-metadata">

**Author:** [@rupert-jung-mw](https://community.sonarsource.com/u/rupert-jung-mw)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 4:43pm UTC](https://community.sonarsource.com/t/false-positive-kotlin-s6619/180347 "2026-03-27T16:43:05Z")

</div>

Sonar reporting “useless” null checks on nullable types: As you can see, thisis in fact nullable: Removing the null-check will in fact not even compile as the short-circuit check for null is now not happining any…

---

## [False positive: kotlin:S6524](https://community.sonarsource.com/t/false-positive-kotlin-s6524/180345)

<div class="topic-metadata">

**Author:** [@rupert-jung-mw](https://community.sonarsource.com/u/rupert-jung-mw)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 4:42pm UTC](https://community.sonarsource.com/t/false-positive-kotlin-s6524/180345 "2026-03-27T16:42:56Z")

</div>

Sonar reporting immutable collections as mutable As you can see, the collection is in fact already immutable:

---

## [False positive: kotlin:S1481](https://community.sonarsource.com/t/false-positive-kotlin-s1481/180344)

<div class="topic-metadata">

**Author:** [@rupert-jung-mw](https://community.sonarsource.com/u/rupert-jung-mw)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 4:42pm UTC](https://community.sonarsource.com/t/false-positive-kotlin-s1481/180344 "2026-03-27T16:42:23Z")

</div>

Sonar is reporting uses variables as unused:

---

## [S2699: Add approve to assertion method name pattern](https://community.sonarsource.com/t/s2699-add-approve-to-assertion-method-name-pattern/179824)

<div class="topic-metadata">

**Author:** [@mkutz](https://community.sonarsource.com/u/mkutz)\
**Replies:** 3\
**Last updated:** [March 24, 2026, 12:45pm UTC](https://community.sonarsource.com/t/s2699-add-approve-to-assertion-method-name-pattern/179824 "2026-03-24T12:45:46Z")

</div>

The S2699 rule recognizes method names matching (assert|verify|fail|should|check|expect|validate|andExpect).\* as assertions. I’d like to propose adding approve to this pattern. Approval testing (also known as snapshot t…

---

## [Execution failed for task ‘:app:sonar’ for Android CI projects](https://community.sonarsource.com/t/execution-failed-for-task-sonar-for-android-ci-projects/179624)

<div class="topic-metadata">

**Author:** [@djamn](https://community.sonarsource.com/u/djamn)\
**Replies:** 1\
**Last updated:** [March 16, 2026, 2:50pm UTC](https://community.sonarsource.com/t/execution-failed-for-task-sonar-for-android-ci-projects/179624 "2026-03-16T14:50:47Z")

</div>

Hi, so last year I already opened a question about this topic: Execution failed for task ':app:sonar' This time I followed these steps again: Created an organization on GitHub Created repository Created a Kotlin Andro…

---

## [kotlin:S107 should ignore methods with @Composable annotation](https://community.sonarsource.com/t/kotlin-s107-should-ignore-methods-with-composable-annotation/117826)

<div class="topic-metadata">

**Author:** [@jayasuryat](https://community.sonarsource.com/u/jayasuryat)\
**Replies:** 9\
**Last updated:** [March 10, 2026, 11:33am UTC](https://community.sonarsource.com/t/kotlin-s107-should-ignore-methods-with-composable-annotation/117826 "2026-03-10T11:33:18Z")

</div>

Using : SonarQube™ - Enterprise Edition - Version 9.9 (build 65466) Language : Kotlin Rule: S107 ( Functions should not have too many parameters). Expectation: Methods annotated with @Composable (androidx.compose.ru…

---

## [SonarLint Kotlin analyzer crashes on large Android project (Internal error / parse failure) but work](https://community.sonarsource.com/t/sonarlint-kotlin-analyzer-crashes-on-large-android-project-internal-error-parse-failure-but-work/177138)

<div class="topic-metadata">

**Author:** [@devilyoung2504](https://community.sonarsource.com/u/devilyoung2504)\
**Replies:** 6\
**Last updated:** [February 16, 2026, 3:19pm UTC](https://community.sonarsource.com/t/sonarlint-kotlin-analyzer-crashes-on-large-android-project-internal-error-parse-failure-but-work/177138 "2026-02-16T15:19:50Z")

</div>

Hello Sonar team :waving\_hand:, I’m facing a persistent SonarLint analysis failure on a large Android project. After extensive troubleshooting, this looks like a Kotlin analyzer incompatibility rather than a project mi…

---

## [False-Positive in kotlin:S1128](https://community.sonarsource.com/t/false-positive-in-kotlin-s1128/153300)

<div class="topic-metadata">

**Author:** [@Damien\_Burke](https://community.sonarsource.com/u/Damien_Burke)\
**Replies:** 9\
**Last updated:** [February 3, 2026, 10:54am UTC](https://community.sonarsource.com/t/false-positive-in-kotlin-s1128/153300 "2026-02-03T10:54:46Z")

</div>

hello! SonarCloud incorrectly reports import com.github.michaelbull.result.Result as an unused import under rule kotlin:S1128, even though the import is used by Kotlin’s type inference and is required for correct compil…

---

## [FP from kotlin:S6519 when .equals(ignoreCase=true) is used](https://community.sonarsource.com/t/fp-from-kotlin-s6519-when-equals-ignorecase-true-is-used/176690)

<div class="topic-metadata">

**Author:** [@wilhelmf](https://community.sonarsource.com/u/wilhelmf)\
**Replies:** 3\
**Last updated:** [January 28, 2026, 4:13pm UTC](https://community.sonarsource.com/t/fp-from-kotlin-s6519-when-equals-ignorecase-true-is-used/176690 "2026-01-28T16:13:49Z")

</div>

Reporting against SonarQube Server Data Center Edition v2025.4.2 (112048) kotlin:S6519 recommends replacing calls to the .equals() method with the == and != operators for testing structural equality. This is valid norma…

---

## [Typo in rule S6532 for Kotlin](https://community.sonarsource.com/t/typo-in-rule-s6532-for-kotlin/174711)

<div class="topic-metadata">

**Author:** [@Big-Iron-Cheems](https://community.sonarsource.com/u/Big-Iron-Cheems)\
**Replies:** 4\
**Last updated:** [January 23, 2026, 2:48pm UTC](https://community.sonarsource.com/t/typo-in-rule-s6532-for-kotlin/174711 "2026-01-23T14:48:44Z")

</div>

I believe there is a typo in rule S6532 for Kotlin: rspec/rules/S6532/kotlin/rule.adoc at master · SonarSource/rspec · GitHub sonar-kotlin/sonar-kotlin-plugin/src/main/resources/org/sonar/l10n/kotlin/rules/kotlin/S6532…

---

## [Cognitive complexity not ignoring equals and hashcode in Kotlin](https://community.sonarsource.com/t/cognitive-complexity-not-ignoring-equals-and-hashcode-in-kotlin/172953)

<div class="topic-metadata">

**Author:** [@lswiatek](https://community.sonarsource.com/u/lswiatek)\
**Replies:** 1\
**Last updated:** [January 20, 2026, 5:54pm UTC](https://community.sonarsource.com/t/cognitive-complexity-not-ignoring-equals-and-hashcode-in-kotlin/172953 "2026-01-20T17:54:17Z")

</div>

Hello, For some time Java rules related to complexity, ignore equals and hashcode SONARJAVA-4335 but the same is not true for Kotlin rules java kotlin there might be other examples as well is there any way …

---

## [kotlin:S2116 reports false positive for ByteArray.toString(Charsets.UTF\_8)](https://community.sonarsource.com/t/kotlin-s2116-reports-false-positive-for-bytearray-tostring-charsets-utf-8/150460)

<div class="topic-metadata">

**Author:** [@swenjung](https://community.sonarsource.com/u/swenjung)\
**Replies:** 7\
**Last updated:** [December 15, 2025, 3:31pm UTC](https://community.sonarsource.com/t/kotlin-s2116-reports-false-positive-for-bytearray-tostring-charsets-utf-8/150460 "2025-12-15T15:31:31Z")

</div>

Then tell us: kotlin (2.0.21) kotlin:S2116 The suggested fix is incorrect for ByteArray.toString(Charsets.UTF\_8) as the output is changed dramatically. ByteArray.toString(Charsets.UTF\_8) returns the ByteArray inputted …

---

## [Sonar Kotlin analyzer considers all files as unchanged](https://community.sonarsource.com/t/sonar-kotlin-analyzer-considers-all-files-as-unchanged/153505)

<div class="topic-metadata">

**Author:** [@sonardroid](https://community.sonarsource.com/u/sonardroid)\
**Replies:** 1\
**Last updated:** [December 5, 2025, 5:25pm UTC](https://community.sonarsource.com/t/sonar-kotlin-analyzer-considers-all-files-as-unchanged/153505 "2025-12-05T17:25:48Z")

</div>

Hi there! The docs for the kotlin analyzer state that the sonar analysis skips unchanged files However in practice we see that the analyzer runs on all files even if it it’s only a single file that has been changed. …

---

## [Slow kotlin sensor](https://community.sonarsource.com/t/slow-kotlin-sensor/135596)

<div class="topic-metadata">

**Author:** [@le.flow](https://community.sonarsource.com/u/le.flow)\
**Replies:** 5\
**Last updated:** [December 5, 2025, 2:18pm UTC](https://community.sonarsource.com/t/slow-kotlin-sensor/135596 "2025-12-05T14:18:33Z")

</div>

Hello, since the end of November, we’ve seen a regression in sonar analysis performances while analyzing our Android app. It looks like the scanner is stuck on one file for a few minutes before checking the other files: …

---

## [Execution failed for task ':sonar'](https://community.sonarsource.com/t/execution-failed-for-task-sonar/147683)

<div class="topic-metadata">

**Author:** [@Pkagebein](https://community.sonarsource.com/u/Pkagebein)\
**Replies:** 3\
**Last updated:** [October 6, 2025, 6:01pm UTC](https://community.sonarsource.com/t/execution-failed-for-task-sonar/147683 "2025-10-06T18:01:11Z")

</div>

I am currently working on upgrading a Kotlin Multiplatform project from Gradle 8.11.0 to 9.0.0. With the change to 9.0.0, I had to upgrade our sonar plugin version from 5.1.0.4882 to the latest version, 6.3.1.5724, as th…

---

## [org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution](https://community.sonarsource.com/t/org-gradle-tooling-buildexception-could-not-execute-build-using-connection-to-gradle-distribution/148635)

<div class="topic-metadata">

**Author:** [@David\_Corrado](https://community.sonarsource.com/u/David_Corrado)\
**Replies:** 5\
**Last updated:** [September 12, 2025, 3:35pm UTC](https://community.sonarsource.com/t/org-gradle-tooling-buildexception-could-not-execute-build-using-connection-to-gradle-distribution/148635 "2025-09-12T15:35:15Z")

</div>

Must-share information (formatted with Markdown): which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) GitHub - SonarSource/sonar-scanner-gradle: SonarQube Sca…

---

## [No input file found for \*\*/commonMain/file, No ktlint issues will be imported on this file](https://community.sonarsource.com/t/no-input-file-found-for-commonmain-file-no-ktlint-issues-will-be-imported-on-this-file/148001)

<div class="topic-metadata">

**Author:** [@Archit\_Bajpai](https://community.sonarsource.com/u/Archit_Bajpai)\
**Replies:** 1\
**Last updated:** [September 5, 2025, 1:37pm UTC](https://community.sonarsource.com/t/no-input-file-found-for-commonmain-file-no-ktlint-issues-will-be-imported-on-this-file/148001 "2025-09-05T13:37:47Z")

</div>

Getthing this error for all my files in the terminal but on the sonar server I am able to see the report. Sonar just says its unable to find the files I have added commonMain in sonar.sources but its still not working

---

## [kotlin:S5612 should adjust its behavior for function with @Composable annotations](https://community.sonarsource.com/t/kotlin-s5612-should-adjust-its-behavior-for-function-with-composable-annotations/148135)

<div class="topic-metadata">

**Author:** [@Qheb](https://community.sonarsource.com/u/Qheb)\
**Replies:** 2\
**Last updated:** [September 5, 2025, 8:18am UTC](https://community.sonarsource.com/t/kotlin-s5612-should-adjust-its-behavior-for-function-with-composable-annotations/148135 "2025-09-05T08:18:30Z")

</div>

What language is this for? Kotlin for Android, with Jetpack Compose Which rule? kotlin:S5612 Lambdas should not have too many lines Are you using SonarQube Server Developer Edition v2025.3.1 (109879) So…

---

## [Kotlin equals() "Add a type test to this method"](https://community.sonarsource.com/t/kotlin-equals-add-a-type-test-to-this-method/146249)

<div class="topic-metadata">

**Author:** [@duncanjv](https://community.sonarsource.com/u/duncanjv)\
**Replies:** 3\
**Last updated:** [August 26, 2025, 9:14am UTC](https://community.sonarsource.com/t/kotlin-equals-add-a-type-test-to-this-method/146249 "2025-08-26T09:14:06Z")

</div>

I have a bug showing up for an equals() method in Kotlin indicating I need to “Add a type test to this method.” Here is the code: override fun equals(other: Any?) = when (other) { is TaskStepType…

---

## [Cannot see the combined report for all modules in my Android multi-module project](https://community.sonarsource.com/t/cannot-see-the-combined-report-for-all-modules-in-my-android-multi-module-project/147260)

<div class="topic-metadata">

**Author:** [@zimmer550](https://community.sonarsource.com/u/zimmer550)\
**Replies:** 1\
**Last updated:** [August 23, 2025, 5:42pm UTC](https://community.sonarsource.com/t/cannot-see-the-combined-report-for-all-modules-in-my-android-multi-module-project/147260 "2025-08-23T17:42:00Z")

</div>

libs.versions.toml: \[versions\] sonarVersion = "6.2.0.5505" \[plugins\] sonarPlugin = { id = "org.sonarqube", version.ref = "sonarVersion" } project-level build.gradle.kts: import org.sonarqube.gradle.SonarExtension pl…

---

## [Functional interface implementations should use lambda expressions (kotlin: S6516)](https://community.sonarsource.com/t/functional-interface-implementations-should-use-lambda-expressions-kotlin-s6516/141394)

<div class="topic-metadata">

**Author:** [@ATTATRA](https://community.sonarsource.com/u/ATTATRA)\
**Replies:** 5\
**Last updated:** [August 20, 2025, 10:14am UTC](https://community.sonarsource.com/t/functional-interface-implementations-should-use-lambda-expressions-kotlin-s6516/141394 "2025-08-20T10:14:35Z")

</div>

Operating system: Windows 11 64bits IDE name and flavor/env: Android Studio Meerkat Feature Drop | 2024.3.2 Build #AI-243.25659.59.2432.13423653, built on April 29, 2025 Runtime version: 21.0.6±13368085-b895.109 amd6…

---

## [kotlinsecurity:S5145 should ignore logging of enum request params](https://community.sonarsource.com/t/kotlinsecurity-s5145-should-ignore-logging-of-enum-request-params/143660)

<div class="topic-metadata">

**Author:** [@tadjan](https://community.sonarsource.com/u/tadjan)\
**Replies:** 1\
**Last updated:** [August 19, 2025, 11:52am UTC](https://community.sonarsource.com/t/kotlinsecurity-s5145-should-ignore-logging-of-enum-request-params/143660 "2025-08-19T11:52:36Z")

</div>

What language is this for? kotlin Which rule? kotlinsecurity:S5145 Why do you believe it’s a false-positive/false-negative? When REST call request param is an enum, the basic validation is performed by Spring at req…

---

## [kotlin:S1874 False positives on some List methods with Java 21](https://community.sonarsource.com/t/kotlin-s1874-false-positives-on-some-list-methods-with-java-21/105367)

<div class="topic-metadata">

**Author:** [@GeorgEchterling](https://community.sonarsource.com/u/GeorgEchterling)\
**Replies:** 11\
**Last updated:** [August 13, 2025, 9:38am UTC](https://community.sonarsource.com/t/kotlin-s1874-false-positives-on-some-list-methods-with-java-21/105367 "2025-08-13T09:38:29Z")

</div>

SonarQube sometimes reports deprecation warnings (kotlin:S1874) for List methods that aren’t deprecated. Kotlin’s List\<T\>.first() extension method. Java’s List.removeLast() method. This happened immediately after I up…

[Next page](https://community.sonarsource.com/tag/kotlin/17.md?match_all_tags=true&page=1&tags%5B%5D=kotlin)
