I am trying to scan my code using github action workflow.
I have already able to run the workflow and sonarqube is scanning my repo, but it is showing quality gate status passed after scanning, but it should have failed as my duplication in code is coming 4.3 % and I have set my quality gate of greater than 4 %, So now i am confused that why it is not failing, even though I have 4,3 % duplication rate.
Your first screenshot shows a Condition on New Code on Duplicated Lines. That means the condition is only applied to the lines added or edited in the New Code period.
Your screenshot shows that you have 4.3% duplications on Overall code. Overall code is a superset of New Code. If you click on the New Code tab, I’m confident you’ll see a Duplications number below your 4% threshold.