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

No changed lines detected in P/Rs if target branch is not explicitly specified

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.6
    • Component/s: Scanner
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      If the target branch is not specified, it will assume as default ‘master’, but this default value is not passed to the SCM plugins. As a consequence, the SCM plugins are not able to check during the scan which lines were modified in the P/R.

      Then, the server will fallback to the old mechanism in which it compares the creation date of the P/R with SCM change date of each line. Most of the times the PR will be more recent than the changed lines, so all lines will be considered as not new.

      Without any lines detected as new, SonarQube is not able to calculate any new_* metric. The most visible effect is that there won't be any new coverage or new duplication.

      Note that this doesn’t affect the detection of new issues in the P/R. For issues we don’t rely on the information whether a line is new or not. Instead, it uses the issue tracking algorithm to compare issues in the P/R with the issues in the target branch.

        Attachments

          Activity

            People

            Assignee:
            duarte.meneses Duarte Meneses
            Reporter:
            duarte.meneses Duarte Meneses
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: