New code definition

We’re using Sonarcloud but the “New Code” definition does not fully work for us and our workflows. We are checking the amount of new lines as a rule for Quality Gate, and have a limit of 800. This is useful for us in PRs. The problem is that this same rule applies for the long lived branches, like develop. We are a lot of developers and are constantly merging into develop. Because of this, Quality Gate is always failing since none of the “New Code” definitions work for us.

We would like quality gate to compute agains the previous commit for a given branch, but we do not know if it is possible to achieve that. If it’s not possible, then we’d like to have a different set of rules for short and long lived branches but we don’t know how to achieve that.

Hi @dcacenabes,

You are right, quality gates are defined by project, and rules can only be applied to overall code or new code, not only on PRs or on a given number of commits.

Maybe using a number of days could fit?

Otherwise, that could be a new feature request :slight_smile: