One of our PR is showing duplication (5.5%, 19 lines, 2 blocks), but we can’t seem to find the duplication indicators when we open up the referenced Kotlin file on SonarCloud. We were able to see the indicators in the past (on other PRs), so I am not sure whether this problem is just for this particular PR or something is broken on SonarCloud recently.
Any idea how we can figure out where the issue is?
It sounds like you’ve already narrowed it to a file, but just to be sure, I’m going to start from the PR overview:
Click on the duplications percentage
From the list of files with duplications, click on the file
New lines - lines changed in the PR - are indicated with a yellow highlight. Look in the margin of those lines for a grey bar that indicates a duplicated block:
Thanks, the detailed instructions does help and I think that was what we used to see in the past.
Currently, the file viewer seems to have an updated look. The new lines now have a light blue background and no grey bars on the left margin can be found throughout the whole file.
The linked post seems similar to our current issue. Not sure why I didn’t hit it when I search before I posted ours. I set myself as a watcher there now.
Glad to learn that looks like the issue is being worked on by SonarSource. It’s been about 3 weeks since the last update on the linked post though. Hoping to hear some good news soon!
This looks like a different issue than the other one mentioned in the comment. In the other issue, the API was returning the duplication info correctly and the UI somehow doesn’t show it. This should be treated as a new issue. I am assigning this one to the team.
Ooooh good catch, I believe that part of the file was folded so even scrolling all the way down would not display it by default for me…
I had to click “Show X more lines” at the bottom of the code view to see it all :
Is this the intended behavior? I would expect this view to show all of the modified/impacted lines right off the bat… Else what is the point of having a dedicated “Duplicate Lines” view?
Hi. We’re currently experiencing the same issue. SonarCloud reports a 6.6% duplication on new code but on opening the report on the dashboard there are no indications on where those duplicates exist.