Sonar profiles, rules, and violations

Sonar validates source code against a quality profile. Based on profile settings, the source code analyzers take turns parsing code and apply numerous rules. When a rule is broken, a violation is created, but what is a rule and how does it correlate to the overall quality?

Each Sonar profile consists of a collection of rules. Think of these rules as constraints to your source code. Each time Sonar parses, your code checks whether a rule is followed or not. In case the rule's criteria are not met, a new violation is created at a predefined Severity. The severity or level of the violation is a weighted value that affects overall quality of the Rules Compliance Index (RCI).

The Rules Compliance Index

We have already ...

Get Sonar Code Quality Testing Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.