Setting up Clean as You Code for your project
As a project administrator, you set up Clean as You Code in three steps:
Step 1: Set the quality standard for your project
The project's quality standards include:
- Quality gates
Quality gates enforce a quality policy for the results of code review and analysis in your organization by answering one question: is my project ready for release?
For more information, see Introduction to quality gates. - Quality profiles
Quality profiles define the set of rules to be applied during code analysis and review.
For more information, see Quality profiles.
The default quality gate and quality profiles defined by your Quality Standard administrator apply by default to your project. To change them, see:
Step 2: Set a new code definition for your project
With the Clean as You Code approach, focus is set on new code. New code is code that you've recently added or modified. The new code definition tells SonarQube which part of the code is considered new during analysis. For more information, see About new code.
By default, your project applies the baseline for new code (global-level new code definition). This means it consistently uses the baseline for new code. Consequently, any modifications to the baseline will automatically be applied to your project. You can apply a specific new code definition for your project instead.
By default, any branch in your project applies the project’s new code definition. You can apply a specific new code option instead.
See Configuring the new code calculation for your project.
Step 3: Set up the analysis
To learn how to set up analysis in your IDE refer to SonarQube for IntelliJ, Visual Studio, VS Code, Eclipse.
Related pages
Was this page helpful?