5

I use Sonarqube with Jenkins to check various violations. There are two classes, A and B, that have a lot of duplicated code. I know that and accept that. Therefore, I'd like to ignore these violations. However, I still want to be informed about the duplicated code from other classes, like C. I just want to ignore the duplicated code between A and B. How can I do that?

Sumesh TG
  • 2,557
  • 2
  • 15
  • 29
Fischer Ludrian
  • 629
  • 1
  • 9
  • 23

1 Answers1

1

You can resolve the issue as false positive. This will make this issue disappear from your dashboard:

  • Select the issue
  • Click on Bulk change > Selected issue(s)
  • Choose Transition, Resolve as false positive
  • Apply

That's it.

Benoit
  • 5,118
  • 2
  • 24
  • 43
  • Thanks. Two questions: 1) Will this still be marked as false positives if I rerun the sonarqube analysis? 2) If there is duplicated code from other source files in the future, won't this duplication be ignored? – Fischer Ludrian Sep 14 '18 at 09:10
  • @FischerLudrian 1) No the same issue will be ignored in subsequent rerun, you won't have to resolve as false positive again and again. 2) No only the specific duplication you resolved is ignored, not the whole rule. – Benoit Sep 14 '18 at 09:15