Developing with Sonar
The Sonar solution helps developers perform checks at every stage of the development process:
- SonarLint provides immediate feedback in your IDE as you write code so you can find, focus on, and fix anticipated issues before a commit.
- SonarCloud’s PR analysis fits into your cloud-based CI/CD workflows so that you merge clean code every time.
- Quality gates keep code with issues from being released to production, a key tool in helping you incorporate the Clean as You Code methodology.
- The Clean as You Code approach helps you focus on submitting new, clean code for production, knowing that your existing code will be improved over time.
Organizations start off with a default set of rules called the Sonar Way Quality Profile. Quality profiles define the set of rules to be applied during code analysis. The Sonar Way can be customized per project to satisfy different technical requirements.
A quality gate is an indicator of code quality that can be configured to give a go/no-go signal on the current release-worthiness of the code. It indicates whether your code is clean and can move forward.
- A Passed (green) quality gate means the code meets your standard and is ready to be merged.
- A Failed (red) quality gate means there are issues to address.
SonarCloud provides feedback through its UI, email, and in decorations on pull or merge requests to notify your team that there are issues to address. SonarCloud also provides in-depth guidance on the issues telling you why each issue is a problem and how to fix it, adding a valuable layer of education for developers of all experience levels.
Feedback can also be obtained in SonarLint-supported IDEs when running in Connected Mode. SonarLint helps developers find, focus on, and fix anticipated issues before a commit. Together, SonarLint and SonarCloud helps developers address issues effectively, so code is only promoted when the code is clean and passes the quality gate.