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 (
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.