SonarCloud vs SonarQube New Issues

Under Quality Gates in SonarQube we have a Metric under Conditions called New Issues. This metric seems to be replaced by Issues in SonarCloud. Is there a way to get this option back in SonarCloud?

Hey there.

You just need to make sure your Quality Gate condition is On New Code

Can we define how SonarCloud flags new code?

Yes! Checkout the Administration > New Code settings at the Organization or Project level.

The question is more around how does Sonar qualify code as “New Code” our experience with SonarQube has been that it is not just new lines of code… we would have “old” issues re-introduced as now being Issues on New Code when any code in a give class file or method may have changed, even though the lines of code for the issue itself hadn’t been changed… That made the “New Issue” option work for us… It may not work for “Issues” on “New Code” when the detection of “New Code” is not just on new lines of code.

My point is, “New Issues” and “Issues” on new code behave in two very different ways, and wondering why we lost the ability to only flag “New Issues”

here is an example… we have this set to “On New Code” and the New code is set to date after 11/16/2020… but still we get this as a quality gate failure, even though this code is from Sept. 1st…

so we don’t understand why this issue is flagging now