I’m not sure who owns this repo, but it contains the only way I have found to convert Xcode’s code coverage into a generic Sonarqube format (please advise if there’s a better way).
I opened an issue explaining what I found, while converting an .xcresult’s generated from from Xcode.
This script is analyzing if the line had a hit or not, but completely ignores branch coverage, for other code branches in the same line, like ternary operators, or nil coalescing fallbacks.
I’m not sure if this was on purpose, but I guess that Sonarqube supports this, I can see on the official docs an image with the red/white striped pattern:
SonarQube’s generic coverage format supports branch coverage, so if the source data (xccov) has that data, like you said it’s simply a matter of updating the script
It’s not really on our radar. But it’s open source, and we accept PRs.
Thank you for your interest in loading your coverage data into SonarQube.
We are currently in the process of rewriting our Swift analyzer to provide improved support for the latest versions of Swift. As part of this effort, we will also be revisiting our approach to test and coverage data integration. While I cannot guarantee that these enhancements will be completed in the coming weeks, we would greatly appreciate any contributions from the community. If you are interested in enhancing the xccov-to-sonarqube-generic.sh script, we warmly welcome your pull requests.