Code Smell violations reported as Bugs

59 views
Skip to first unread message

fher...@gmail.com

unread,
Oct 5, 2017, 4:16:58 PM10/5/17
to SonarQube
I have a couple of projects where some code smells violations are being reported as bugs. I ran 2 analysis for the same project, one using the parameter sonar.branch and the other not and the final reports are different, specifically, the bug count doesn't match. The report generated with sonar.branch is ok, but the other mixes bugs with some code smells violations. Both analysis use the same quality profile but some rules like squid:S2221 are reported as bug in one report and code smell in the other. Any idea why this happens? It looks like a bug.



SonarQube Version
6.4.0.25310

G. Ann Campbell

unread,
Oct 6, 2017, 8:29:22 AM10/6/17
to SonarQube
Hi,

Please be aware that the standard courtesies (Hi, Thanks, ...) are appreciated in this group.

When were the bug-code smell issues raised? We've been tuning our rules, and have changed the types of some of them. I'm willing to bet the bug-code smells were raised with earlier versions of the analyzers where the rules were classified as bug rules. Subsequently, you upgraded to analyzer versions where those rules has been reclassified as code smells, and all new issues raised by those rules are consequently classed as code smells. But old issues raised by the rules are not re-classified.


Ann

fher...@gmail.com

unread,
Oct 6, 2017, 11:52:46 AM10/6/17
to SonarQube
Hi Ann, sorry for not following courtesy standards before :). Following your instructions I deleted the projects with problems, ran a new analisys and the output was correct, so you are right, old issues are not re-classified. Thank you for your help.

G. Ann Campbell

unread,
Oct 6, 2017, 12:02:13 PM10/6/17
to fher...@gmail.com, SonarQube
Hi,

I'm glad you've resolved this to your satisfaction, but I'm sorry I didn't mention the ability to bulk change.

Just for the record, rather than deleting those projects and loosing their analysis histories, you could have used the Bulk Change function to change their type.


:-)
Ann

---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

Reply all
Reply to author
Forward
0 new messages