Can you please explain why SonarQube is complaining these lines of code is duplicate lines? The only similarity I can see in these lines is the “router.options”/“router.get” and path ‘/nee/workeridentity/v1/workers/:slid’
I have to give a brief explanation to the developers. Developers are saying SonarQube is incorrectly reporting duplicate lines.
Yes. TBH, I’m not a fan of the way we detect that a chunk of code “duplicates” an overlap of itself, but that’s what the popup in your first screenshot is showing you: that lines 78-93(???) are duplicated by lines 84-99.
Well, yes. The literals are gone now. But the code is different too.
We do, but it’s not fulsome. In fact, I looked this up yesterday before I answered you but didn’t link to it because a) it’s a bit thin and b) I believe the last sentence in ‘Language-specific details’ (“Differences in indentation and in string literals are ignored while detecting duplications.”) applies to all languages, not just Java. (Yes, I’ve raised that internally.)