Does SonarQube offer a metric that shows how many times a Rule has been checked for?

Hi all,

I would like to know if SonarQube offers a metric that shows how many times a Rule has been checked for. The reason for this is that I would like to know to what extend my application ‘complies with the set Rules’. To do this, I need to know how many times a specific rule is being checked for AND how many findings the rule has.

For example:

Rule1 is checked 100 times and SonarQube finds 25 findings. This means that the Compliance-score of Rule1 would be 25%.

I have already digged through documentation and different Topics on this forum but unfortunately without any luck :slight_smile:

Hopefully there’s someone out here who can help me out :slight_smile:

Many thanks in advance!

Bryan

Hey there.

It’s not really clear to me what you’re trying to measure… or what value it would add.

“How many times a rule has been checked” could have a lot of interpretations – the number of analyses of a project? The number of files a rule was executed on?

The metrics of your project (number of bugs, code smells, etc.) and whether or not those values make a passing/failing Quality Gate is your compliance overview.

If you’re interested in what rules are being violated the most, take a look at this answer here: