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.
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.