Must-share information (formatted with Markdown):
- SonarQube Scanner - 4.7.0.2747
- Run Sonar scanner on Bitrise(CI) workflows
- Skip/Exclude blocks of code in classes.
- Used
\s*//\s*START-NOSCAN
and\s*//\s*END-NOSCAN
as exclusion properties on the UI as suggested in Narrowing the focus with an analysis scope.
In our CI workflow, we produce a consolidated jacoco report and there is an current issue with Jacoco unable to exclude certain parts of Jetpack Compose code. For e.g. We would want to exclude all the @Preview composables from code coverage. They are used for dev purposes and are not used in production.
For e.g.
// BEGIN-NOSCAN
@ExcludeFromJacocoGeneratedReport <-- This does not work due to the Jacoco Issue, only in Compose Previews.
@Preview
@Composable
private fun DigitalInvoiceSignaturePadPreview() {
SignaturePad()
}
// END-NOSCAN
Now, I am wondering if the sonar exclusion properties work if the analysis is done outside of sonar and a coverage report is provided to Sonar.
Please let me know if there are any other configs in Sonar that would help.
Thanks.