Cyclomatic & cognitivie code smell issues on new code

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

Hi

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

Cheers

Hi,

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.

 
HTH,
Ann

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