Code Violations by Priorities

Purpose

Code Violations by Priorities metric shows a trend in the amount of issues detected in a project code. The closer to 0 the better. "0" is the ideal target state, unless it's a zero-code project.

How metric helps

Code Violations by Priorities helps in assessing the quality of the project code, focusing on how many issues were identified by severity and revealing the trends in the amount, whether it’s growing or reducing over time. If it's growing - this is a good leading indicator it's time to fight the code smell. 

How metric works

Chart Overview

Chart shows the amount of code violations presented in the metric is differentiated by severity and distributed over time. Timeline in day by day mode is presented on Axis X of the chart, Axis Y is for violations amount.

In case multiple Sonar repositories are enabled for a project, you may alter them via a drop-down in the top right corner of a chart.

You may also see 'Blocker violations' chart which reveals only blocker violations tendency:

Calculation 

There are several variations of this metric: 

  • Code Violations is calculated as total amount of issues detected in the code per priority.

  • Blocker Violations is calculated as total amount of issues of a priority 'Blocker'.

RAG thresholds: Red - blocker violations number > 5; otherwise - Amber.

Data Source

Data for the metric can be collected from Sonar.