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

Issues that can span multiple locations (in possibly different resources)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Issues
    • Labels:
      None

      Description

      Currently a violation corresponds to exactly one location.
      Sometimes this model breaks down. Look for example at a violation like "The variable X, declared in file Y at line Z is read without having been initialized first." Here the violation actually points to two locations: the location where the variable is read, and this is also the place where the actual violation happens; and the place where the variable has been declared. The two locations could be in the same file, but they could also be in different files.

      We propose to improve on the current situation as follows:

      • Make it possible for a violation to also reference other violations. (Could the permanentId of a violation be used for that? Otherwise just use pairs (resource, line) for reference purposes). These references must be indexed so that you can say reference 1, reference 2, reference 3, etc.
      • Reinterpret the format of the message of a violation with > 0 references. It is possible now to link in the message to the references, for example "The variable X (declared @1 {here}

        ) is read without having been initialized first.". The syntax '@n

        {label}

        ' is used here to create a link to the violation pointed to by reference n. In this particular case, that violation would have priority Info and its location would be the place where X has been declared.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ubik Steven Obua
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: