Laurent
(Laurent)
March 16, 2023, 1:20pm
1
We have a quality get on PR regarding duplication line…
One of the PR is tagged with duplication code:
BUT it is impossible to understand where it is, there is NO gray line on the border of the file (as we can see on main branch regarding duplication)
It seems that the duplication code is not well shown on PR, that make VERY difficult the analyse and the correction of this error.
Regards
Colin
(Colin)
March 16, 2023, 2:52pm
2
Hey there.
That’s odd – I am able to view the duplicated code on a PR in SonarCloud
If you take any of the files where duplication is reported and try an API call like this:
https://sonarcloud.io/api/sources/lines?key=sonaranalyzer-dotnet%3Aanalyzers%2Fsrc%2FSonarAnalyzer.VisualBasic%2FRules%2FHotspots%2FDoNotHardcodeCredentials.cs&from=1&to=502
(the value for key
is the same value as selected
in the URL when you’re browsing the UI)
Do you see any lines marked as duplicated:"true"
?
Can you also confirm what language these files are?
Laurent
(Laurent)
March 16, 2023, 4:03pm
3
Yes I see some and with isNew: true:
{“line”:549,“code”:"…,“duplicated”:true,“isNew”:true}
BUT nothing on sonar for this line 549
Colin
(Colin)
March 16, 2023, 6:31pm
4
Thanks.
And just to make sure we have the full picture, can you confirm this point?
Colin
(Colin)
March 17, 2023, 8:06am
6
Thanks.
I can’t reproduce this on a C++ repo with a pull request (with duplication). Take for example this public project .
Ill reach out for some private details.
Laurent
(Laurent)
March 17, 2023, 8:41am
7
I think the difference is that you have duplication in the same file, here I think we have duplication from another file THAT IS NOT part of the PR, so I suspect that it is the issue, has the file is not part of the PR it could not show it, and duplication is not usable
Hello @Laurent ,
Sorry for not getting back earlier. I started looking into this issue today. I will ask for more information in private
I was able to see the issue. I will check if there can be a quick fix for this one. I will keep you posted
@Laurent I confirm that this is a bug and I have created an internal ticket for this. I will try to prioritize this in the coming week.
1 Like
There is a fix I have pushed for the issue. It should be available on sonarcloud.io either Monday or Tuesday
2 Likes
system
(system)
Closed
May 12, 2023, 7:18am
19
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.