While executing sonarqube workflow for our JS/TS based application, the quality gates sometimes pass as expected but fails occasionally. We also observed that the code coverage also keeps on fluctuating.
When failing, the reliability quality gate seems to be including coverage folder which is otherwise excluded in sonar-project.properties file.
The attributes in sonar-project.properties is as follows:
Expected Result: To exclude the coverage folder from getting included in bugs, code smells or duplications.
So far, we have been able to exclude it from code smells and duplications, but it is still getting included while analyzing bugs i.e., reliability. Also, not able to determine why there is a fluctuation in coverage (sometimes coverage gets included and sometimes not).
What I noticed in your properties is that you haven’t specified sonar.sources, leaving it to default to ..
Also cpd and coverage exclusions are subsets of the exclusion functionality. Listing something in sonar.exclusions is enough to exclude it from coverage and duplication (cpd) detection.
Can you try specifying a tighter sonar.sources value and see if the problem persists?