What does SonarQube's "Clean as You Code" and new code period mean?
AdvancedConceptTesting and Quality Gates
Answer
Instead of demanding a team fix thousands of legacy issues at once, Clean as You Code applies the quality gate only to code changed since a reference point (the new code period: previous version, number of days, a specific date, or a reference branch). Legacy debt stays visible but does not block, while no new debt is introduced. For PR decoration the new code is the diff against the target branch. Configure the reference branch for long-lived branches so new code is measured correctly, and make sure the checkout has full history (fetch-depth: 0) so blame data is available.
More on Testing and Quality Gates
What is the testing pyramid?BeginnerWhat is the difference between unit, integration, and end-to-end tests?BeginnerWhat are smoke tests and sanity tests in a deployment pipeline?IntermediateWhat is code coverage and is a high percentage a good target?IntermediateWhat is a quality gate in SonarQube?IntermediateHow do you integrate SonarQube into a CI pipeline and make it block on gate failure?Intermediate