How can one skip analysis of an annotated method?

SonarQube: (CI Analysis)

We are using @Composable in Android with an import of

import androidx.compose.runtime.Composable

We want to exclude this from our codecoverage reports, is that possible?

Also we want to exclude methods annotated with this completely from sonarqube as it is causing a lot of false positives:

import androidx.compose.ui.tooling.preview.Preview


These methods just show internal previews of views, and we are not worried about issues with those as they would not cause production issues.


Could you double-check your SonarQube version? You’ll find it in the page footer.