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 and fix 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 passing (green) Quality Gate means the code meets your standard and is ready to be merged.
- A failing (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. Feedback can also be obtained in SonarLint-supported IDEs when running in Connected Mode. 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. Developers can then address issues effectively, so code is only promoted when the code is clean and passes the Quality Gate.