use of org.sonar.ce.task.projectanalysis.source.linereader.IsNewLineReader in project sonarqube by SonarSource.
the class SourceLineReadersFactory method getLineReaders.
public LineReaders getLineReaders(Component component) {
List<LineReader> readers = new ArrayList<>();
List<CloseableIterator<?>> closeables = new ArrayList<>();
ScmLineReader scmLineReader = null;
int componentRef = component.getReportAttributes().getRef();
CloseableIterator<ScannerReport.LineCoverage> coverageIt = reportReader.readComponentCoverage(componentRef);
closeables.add(coverageIt);
readers.add(new CoverageLineReader(coverageIt));
Optional<ScmInfo> scmInfoOptional = scmInfoRepository.getScmInfo(component);
if (scmInfoOptional.isPresent()) {
scmLineReader = new ScmLineReader(scmInfoOptional.get());
readers.add(scmLineReader);
}
RangeOffsetConverter rangeOffsetConverter = new RangeOffsetConverter();
CloseableIterator<ScannerReport.SyntaxHighlightingRule> highlightingIt = reportReader.readComponentSyntaxHighlighting(componentRef);
closeables.add(highlightingIt);
readers.add(new HighlightingLineReader(component, highlightingIt, rangeOffsetConverter));
CloseableIterator<ScannerReport.Symbol> symbolsIt = reportReader.readComponentSymbols(componentRef);
closeables.add(symbolsIt);
readers.add(new SymbolsLineReader(component, symbolsIt, rangeOffsetConverter));
readers.add(new DuplicationLineReader(duplicationRepository.getDuplications(component)));
readers.add(new IsNewLineReader(newLinesRepository, component));
return new LineReadersImpl(readers, scmLineReader, closeables);
}
Aggregations