Integrate SonarQube Cloud workflow Analysis #689
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
As we discussed, here is the workflow file adding the CI for analyzing the code in SonarQube Cloud.
Here is an example of a successful run. We can see this in the logs:
Which means there was nothing that we had trouble parsing, and hence the results are complete.
And here you can see the results of the analysis.
I am not sure about the reliability of coverage, though. I can see some
consteval
being flagged as not being executed during runtime, which of course they aren't. Since coverage is handled byclang
for instrumentation andllvm-cov
for extracting the information, I imagine it's more on their side.If you are happy with this, you will need two new secrets:
SONAR_TOKEN
andSONAR_HOST_URL
(the latter just beinghttps://sonarcloud.io
, not really a secret). For the token you will need to onboard the project, then go to Administration / Analysis Method, disable automatic analysis and follow the instructions for GitHub Actions.If you need help setting anything up, I'll happy to help.
P.S I think it may be better to merge into a temporary branch that lives under your repo to make sure it works, since I believe actions with secrets do not run when the PR comes from the outside.
P.P.S Full disclosure, I have seen a handful of kind-of-false positives for "Identical sub-expressions on both sides of operator" (they are identical, but they are within
requires
, and it should not apply there IMHO). I have filed a ticket for these.Rules you disagree with can be disabled, though.