Uploaded image for project: '[MOVED TO GITHUB] SonarJS'
  1. [MOVED TO GITHUB] SonarJS
  2. SONARJS-801

Save EXECUTABLE_LINES_DATA metric and drop forceZeroCoverage property (SQ>=6.2)

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.19
    • Component/s: Coverage
    • Labels:
      None

      Description

      There is property sonar.javascript.forceZeroCoverage which is false by default. When it's true for every file without coverage information, zero coverage will be saved for every executable* line. To do so plugin sends these zeros to SQ.

      Since SQ 6.2 this feature is provided out of box by SQ and should be forced for every project.
      In order for SQ to save zero coverage, plugin should provide for every executable file a measure EXECUTABLE_LINES_DATA that will tell platform what are executable lines (ie lines to cover by tests).

      Note that the metric was introduced before 6.2 but due to an issue, measure should only be provided when runtime is 6.2+.

      * In fact we save zero coverage for any non-commented line of code (ncloc).

      To sum up

      • SQ < 6.2 no change in behaviour:
        • don't provide EXECUTABLE_LINES_DATA
        • keep saving or not zero coverage based on property
      • SQ >= 6.2 force-zero-coverage is always on
        • provide EXECUTABLE_LINES_DATA
        • We log warning message when sonar.javascript.forceZeroCoverage is true that this property is dropped.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                elena.vilchik Elena Vilchik
                Reporter:
                ann.campbell.2 Ann Campbell
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: