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

Lazily generate metadata for input files

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.3
    • Component/s: Scanner
    • Labels:

      Description

      Metadata should not be calculated during the indexing of the source files (event after applying all exclusions) because we might have now large sets of indexed files (SONAR-8623).

      Instead, it should be generated lazily, only when they are first needed:

      • Sensor creates data on the inputFile (measure, issue, highlighting, coverage, symbol table, cpd tokens). Metadata on the inputFile will have to be computed before the data is saved, because it usually requires the metadata for validation (like offsets).
      • Sensors try to access some attributes on the InputFile (like charset(), lines(), ...) Javadoc of those methods should be updated to make it clear that those methods are costly

      When the metadata is generated, the following is logged in debug:
      'src/file' generated metadata with charset 'UTF-8'

      To force the generation of metadata while indexing the files, we have now the property sonar.preloadFileMetadata.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julien.henry Julien Henry
                Reporter:
                duarte.meneses Duarte Meneses
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: