Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-4865

API: issue location should be more precise with ranges of lines and columns in the file

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2
    • Component/s: Issues, Plugin API, Scanner
    • Labels:
      None

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fabrice.bellingard Fabrice Bellingard
              Reporter:
              fabemn OLD - Fabrice Bellingard
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: