How to navigate to the other "duplicated by" occurrence?

  • SonarQube Server Enterprise Edition v2025.1.1
  • deployed via Docker
  • correcting duplicate code, by navigating to duplicates in the SonarQube web UI

When Sonar reports on duplicate code, I’m clicking on the grey bar to the left of the duplicate code to see where else that code occurs.
The popup shows a (possibly shortened) path to other occurrences.

In this particular case, there are multiple possible matches to the shortened path, and no apparent way to determine what the full path is.

Also, if I attempt to select the text of a path, to copy it, the popup closes.

What’s the recommended way to navigate to the duplicated code?

I have a vague memory of an old Sonar version that showed the duplicated code in a section at the bottom of the screen; is there a way to get that to appear?

here’s a screen shot:

Ah, I just noticed that if the duplication is in the same file, the popup shows the duplicated line numbers as a link, which pops open that code in a section at the bottom of the page.

But… why not a similar link if the duplication is in a different file?

Hi,

I’m seeing a link whether it’s the same file or a different one.

The duplication listings aren’t clickable for you? Is there anything in your browser console?

 
Ann

Hmm… now I’m seeing links on all duplicates, and the pull request that didn’t have links has now removed the duplications, so I can’t check that.
I’ll keep an eye on it, and check the browser console if I see this happen again.

1 Like