We have a Vue JS repo, which we analyse using Github Actions.
the integration is wokring well, and we see our results in sonarcloud.io
However, we sometimes see that the Qaulity Gate passes despite conditions not being met.
Please see attached 2 screenshots showing the branch analysis overview (notice coverage = 66.7%) and a screenshot of the Quality Gate definition (notice it should fail if coverage is less than 80%).
Am I missing something here ?
Thanks in advance
Thanks for the screenshots!
It’s coverage you’re expecting to fail the Quality Gate on this PR. The reason it’s not is there in that tile:
We long-ago implemented what I call a fudge factor: conditions on coverage and duplications on New Code aren’t enforced if there are fewer than 20 lines changed. Why? Because in our own testing, we found ourselves in a diminishing returns situation many times, trying to get 80% coverage on e.g. 5 lines when some of them weren’t coverable.
SonarQube has implemented an opt-out for this (global, rather than project-level), and SonarCloud hasn’t caught up yet.
thank you so much for the detailed answer, and that makes complete sense to me. I thought it might be something like that, but couldn’t quite find the documentation for it so just wanted to double check. I think we may want to keep it like this for now, as you’re right, the numbers can be a little funky sometimes for really small PRs.