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

When Leak period is a number of days, leak of issues is not correctly computed

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Issues
    • Edition:

      Description

      When: the Leak period is configured to be:

      • a number of days
      • a custom date
      • => in other words, it's not analysis-based

      Then:

      • "new_*" metrics on issues (issues/bugs/vuln./code smells) are not correctly computed
        • => if the oldest analysis of the period detected new issues, they are not counted
        • => as a consequence:
          • the metrics displayed on project home page are wrong (new bug, new ...)
          • the quality gate might be wrong (because it does not include those new issues)
      • the "sinceLeakPeriod=true" parameter of "/api/issues/search" also give wrong results
        • => if you click on a fail QG condition (for instance "new bugs"), you will see the real list of new bugs, but if you click on "New bugs" in the Leak column, you will see less issues

      I tried to express all this in the attached screenshot.

      Here's a scenario to easily reproduce the issue on a fresh instance of SQ:

      1. Start SQ
      2. On the default QG, add the condition: "New Bugs" + "greater than" + "0" => ERROR
      3. Run a first analysis on a simple Java project
      4. Once processed, go the the settings of the project and change the Leak Period to "10"
      5. On the Java project, add one bug
        • For instance:
              int i = 10;
              long l = 10*i;
          
      6. Run a 2nd analysis
      7. Go to the project home page => you'll have the same situation as what is described in the screenshot

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              fabrice.bellingard Fabrice Bellingard
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: