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.

SonarQube for Visual Studio does not offer a Focus on new code mechanism at this time. The issues you see in the IDE represent all issues found in overall code. See the pages on Quality standards for new code in the Server documentation:

To learn more about the Focus on new code feature in SonarQube for IDE, check the New code pages in the other IDEs:

  • New code and quality standards in SonarQube for VS Code

  • New code and quality standards in SonarQube for IntelliJ

  • New code and quality standards in SonarQube for Eclipse

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:

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:

Last updated

Was this helpful?