Currently, the API allows only to specify the line on which an issue is located. This is a very coarse grained location and has the following limitations:
- it is not possible for a language plugin to specify multiple locations for a single issue, instead of having multiple occurrences of this issue.
- E.g.: "Tab character should not be used" => we want to log only 1 rule at file level (= with only one technical debt), but SonarQube should be able to highlight the lines where the tab is used.
- Other example: "Duplicated blocks" => only 1 issue at file level
- it is not possible to tell that an issue is related to a block of code
- E.g.: "Method should not be too complex" is always logged on the first line of the method
- when 2 issues are located on the same line but do not refer to the same tokens, it's not possible from a UI POV to distinguish the 2 issues
- Indeed, the whole line is highlighted/underlined
To fix this, the Issue API must evolve to accept a list of locations, a location being a file (start at line X1 column Y1, ends at line X2, column Y2).