Template for a good new topic, formatted with Markdown:
- ALM: Bitucket cloud
- CI system used: Bitbucket Cloud
- Scanner command used when applicable (private details masked)
- Languages of the repository: C/C++
- Only if the SonarCloud project is public: Not Public
- Error observed: not an “error”
- Steps to reproduce: TBD
- Potential workaround: ignore issue
I’ve got a repository which has some code duplication blocks/lines marked in the develop branch, which we tag upon commit and use as the metric for “new code” when we do PRs. In a recent PR, a developer added 1 line of code in a block that is duplicate, which then raised a bunch of these as issues for his PR.
What is weird is that we were looking through the baseline and found that in the code, sonarcloud had marked code as duplicate, with two locations. One makes sense, one seems totally unreleated except that it is in the same file. Here is the duplication that makes sense:
And here is the “weird” one:
Thoughts on why the odd reference?