Jetpack Compose code needs separate comment density config

Jetpack Compose code, when formatted with the standard Kotlin Coding Conventions in Android Studio, can produce many lines of code for even simple user interfaces because it puts each modifier and parameter on its own line, as it also does for parenthesis and brackets.

This code does not need as much commenting as normal Kotlin code because a lot of the lines are self-explanatory, but it frequently triggers the comment density code smell. The current density settings is acceptable for standard Kotlin code, but reducing it to make the Compose code pass would leave it at a setting too low for standard Kotlin code.

Compose code needs to be identified by SonarCloud (easy, look for the Composable annotation) and have it’s own comment density setting, separate from standard Kotlin code.

Hello @CWolf

Thanks for your feedback on this. Well to be honest, there’s not that much we will do for this, because we plan to deprecate those rules in the near future.

I hope that helps anyway.