New code
SonarQube for Visual Studio uses the New Code Definition to determine which issues you should focus on fixing, and calls out that these issues are found in new code.
New code and your quality standards
Focusing on new code is an important step in getting the most out of SonarQube. When you run an analysis on the server of your main branch (or other long-lived branches), SonarQube Server differentiates the analysis results of new code from overall code (overall code includes new and old code). This allows you to focus your analysis evaluation on newly introduced issues and apply quality standards. Focusing on new code is at the core of implementing the SonarQube strategy, knowing that the other code will be incrementally fixed over time.
Your new code definition
SonarQube for Visual Studio always displays all the issues found in your file, independent of the New Code Definition (NCD) defined on the server.
New code definition options
When you use the NCD found in your SonarQube (Server, Cloud) quality profile, you have more opportunities to choose how to define new code. Check out their respective pages for details:
Quality standards and new code in SonarQube Server
Quality standards and new code in SonarQube Cloud
How the new code definition affects the analysis results
SonarQube (Server, Cloud) and SonarQube Community Build use your NCD as a baseline for code comparison to identify new code by only showing you issues found in new code.
Focusing on new code and understanding how to work with new code to apply your quality standards are only applicable in SonarQube Server, SonarQube Cloud, and SonarQube Community Build. Learn more about setting quality standards in the server documentation:
Quality standards administration in SonarQube Server
Setting your quality standards in SonarQube Cloud
Quality standards administation in SonarQube Community Build
Last updated
Was this helpful?