Cyclomatic & cognitivie code smell issues on new code

  • Sonarcloud
  • SonarScanner
  • CFamily plugin version:
  • Bitbucket Cloud


We have added cyclomatic & cognitivie complexity to our extended profile of sonar way c++.
But we are getting code smells on code that was not touched. It should be only triggered on new code.
Our quality gate is set to fail if we have >0 code smells.

Here are the rules:

  • AS3776
  • FunctionComplexity



Issues are going to be raised on all code, period.

This is why we advise using the Clean as You Code methodology, backed by a Quality Gate composed of conditions on New Code. So in this case, I would (at a minimum) update your Quality Gate to use a condition on Code Smells on New Code, rather than overall Code Smells.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.