1

Using SonarQube 5.1.2 we started with a fresh project, ran analysis twice with no source code changes between the first and second analysis. Then we selected 'changes since previous analysis'. The Issues and Technical debt widget shows Added: 24min and Removed: 24min but no actual issues (the issue counts against each severity are zero).

Drilling down on the added debt and opening a class shows 5 classes with debt that makes up the 24min but opening the source of a class only shows pre-existing issues. For instance, one class shows 4 minutes of added debt but opening the source shows only 2 pre-existing issues which add up to 20 minutes (8 minutes and 12 minutes). The supposedly changed files do have a blue bar on the left which spans the whole file and when you hover over it reads: 'New since previous analysis'.

In short, SonarQube is reporting technical debt changes that don't correlate to issues added or removed. Is this a bug with the widget?

Dan Saunders
  • 280
  • 2
  • 10

2 Answers2

1

It looks like you are facing https://jira.sonarsource.com/browse/SONAR-7000.

  • Good spot. What seems to happen is that if you have the same rule violated multiple times on the same line with different debt values, Sonar will subtract the lowest value from the highest and report this as both added and removed debt against that file. But the number of added/removed issues remains zero. – Dan Saunders Nov 09 '15 at 10:59
0

I ran into the same issue when running from a Jenkins job (sonarqube 5.1.2). I had the source code being analyzed in the repository itself. Once I moved the code out of the repository,

cp -r myrepo src/myrepo 

the bug seems to not appear. A work around if you do not want to display the issue.

Machavity
  • 30,841
  • 27
  • 92
  • 100
Eddie
  • 1,081
  • 2
  • 12
  • 28