concept line in category sonarqube

appears as: lines, line, lines, line, The lines, A line
SonarQube in Action

This is an excerpt from Manning's book SonarQube in Action.

Figure 1.15. Trend arrows are used throughout the SonarQube interface to indicate the 30-day trend of a metric. Red, green, and grey arrows indicate bad, good, and neutral changes. Arrows alone show moderate increases. An arrow with a line shows a strong increase.

Taken together, potential bugs and coding rule infractions span a continuum, from setting up a logic path through the code that’s guaranteed to lead to a null pointer dereference, to not putting the open curly brace on the line the team has agreed to. Teetering between the two are things like flouting industry-standard naming conventions and writing one-line conditionals without using curly braces.

Given those examples, it’s clear that some issues are worse than others. That’s why SonarQube ranks them at different severities: Blocker, Critical, Major, Minor, and Info. The rules-compliance percentage you see at lower left in the issues widget gives perspective. It’s based on the number and severity of issues versus the lines of code in the project. Whereas the issues counts are golf-style metrics, the rules-compliance index is like bowling: higher is better.

  • A combination of the file/package name regular expression, the key of the rule to be ignored, and a set of lines or line ranges, such as [4,23-50,72-81]. Leave the Lines input blank to have the exclusion cover all lines.