Duplicated block of Code in Sonar for import statements in Java

The Duplicate Blocks rule raises issues at the file level. So it's not trying to tell you that your import statement is duplicated, but that somewhere in the file is a duplicate block. If you'll scroll down, you should see a vertical yellow/orange bar in the left margin. It marks the duplicate block. Click on the bar to get details of where the block is duplicated.

EDIT In more recent versions the duplication marker is brown or gray.


You have to look (scroll down) your code. There will be a duplication marker in brown/gray like this:

enter image description here