When there is a change as a block, we get an indicator line left side of the code lines and the right side of the names of the one who made that change. When you hover over that line indicator, we get a message as “Duplicated block. Click for details”.
However, SonarCloud does not show clearly which line causes the duplication when there are multiple changes as lines instead of blocks. It just says: “Duplicated Lines on New Code 1”
Therefore, a PR fails due to the duplication and we don’t know which part causes this issue. It only says “Duplicated Lines on New Code 1”.
The changed lines are:
<v-col class="col-12">
a condition: if (!form?.validate()) return
a condition: if (!this.selectedRule?.id) return
a condition: if (!this.selectedRule?.id) return
The worst thing is neither we can change these lines nor we exclude this .vue file from the duplication analysis. How can we solve this issue?
ps. we have branch protection rule and this PR is blocked. I would really appreciated it that if i can get prompt support.
Thank you for the reply. It seems we got the fix. However, we cannot view the duplicated lines clearly.
We are getting duplicated blocks on many parts of the code in the PR, however, they are not located on changed lines.
The changed lines are:
Line 3:<v-col class="col-12">
Line 986: a condition: if (!form?.validate()) return
Line 1098: a condition: if (!this.selectedRule?.id) return
Line 1120: a condition: if (!this.selectedRule?.id) return
After the fix is deployed, we started to view some duplicated blocks which are:
Line 715 to 737
Line 742 to 786
Line 797 to 853
Line 979 to 1003. This is the only range where we have a change in the code.