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

Optimize NCLOC_DATA and COMMENT_LINES_DATA

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6
    • Component/s: Plugin API, Scanner
    • Labels:

      Description

      It seems that data "2=1" will behave correctly as equivalent to "1=0;2=1":

      • this is what C# plugin version 5.0 does
      • and I checked code of main consumer of this data - dev-cockpit versions 1.6.1 and 1.10.

      Hence producers of data (language plugins) are not obligated to save zeros, which means no need to store zero nor in memory, nor format it, nor store in database. However seems that this fact is not used by majority of plugins - checked JavaScript plugin version 2.11 , Java plugin version 3.11 and created ticket for C/C++ (CPP-1424). Consumers of data would also benefit - less to load, less to parse, less to hold in memory. This is IMO quite good economy especially in case of COMMENT_LINES_DATA.

      DefaultFileLinesContext can do optimization instead of improving this in all plugins.
      Javadoc in CoreMetrics should be updated.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.henry Julien Henry
              Reporter:
              evgeny.mandrikov Evgeny Mandrikov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: