import org.sonar.server.computation.task.projectanalysis.issue.IssueCreationDateCalculator;
import org.sonar.server.computation.task.projectanalysis.issue.IssueLifecycle;
import org.sonar.server.computation.task.projectanalysis.issue.IssueVisitors;
+import org.sonar.server.computation.task.projectanalysis.issue.IssuesRepositoryVisitor;
import org.sonar.server.computation.task.projectanalysis.issue.LoadComponentUuidsHavingOpenIssuesVisitor;
import org.sonar.server.computation.task.projectanalysis.issue.MovedIssueVisitor;
import org.sonar.server.computation.task.projectanalysis.issue.NewEffortAggregator;
IssueAssigner.class,
IssueCounter.class,
MovedIssueVisitor.class,
+ IssuesRepositoryVisitor.class,
// visitors : order is important, measure computers must be executed at the end in order to access to every measures / issues
LoadComponentUuidsHavingOpenIssuesVisitor.class,
if (analysisMetadataHolder.isIncrementalAnalysis() && file.getStatus() == Status.SAME) {
return;
}
-
+
CloseableIterator<String> linesIterator = sourceLinesRepository.readLines(file);
LineReaders lineReaders = new LineReaders(reportReader, scmInfoRepository, duplicationRepository, file);
try {
}
}
}
-
+
@CheckForNull
private String computeRevision(@Nullable Changeset latestChange) {
if (latestChange == null) {
CloseableIterator<ScannerReport.Symbol> symbolsIt = reportReader.readComponentSymbols(componentRef);
closeables.add(symbolsIt);
readers.add(new SymbolsLineReader(component, symbolsIt, rangeOffsetConverter));
-
readers.add(new DuplicationLineReader(duplicationRepository.getDuplications(component)));
}
@Test
public void dont_persist_unchanged_sources_if_incremental() {
analysisMetadataHolder.setIncrementalAnalysis(true);
- initReportWithUnchangedFile(2);
+ initIncrementalReport(2);
underTest.execute();
-
assertThat(dbTester.countRowsOfTable("file_sources")).isEqualTo(1);
-
}
@Test
assertThat(fileSourceDto.getRevision()).isNull();
}
- private void initReportWithUnchangedFile(int numberOfLines) {
- treeRootHolder.setRoot(ReportComponent.builder(Component.Type.PROJECT, 1).setUuid(PROJECT_UUID).setKey(PROJECT_KEY).addChildren(
- ReportComponent.builder(Component.Type.MODULE, 2).setUuid("MODULE").setKey("MODULE_KEY").addChildren(
- ReportComponent.builder(Component.Type.FILE, FILE1_REF).setUuid(FILE1_UUID).setKey("MODULE_KEY:src/Foo.java")
- .setFileAttributes(new FileAttributes(false, null, numberOfLines)).setStatus(Status.CHANGED).build())
- .build(),
- ReportComponent.builder(Component.Type.FILE, FILE2_REF).setUuid(FILE2_UUID).setKey("MODULE_KEY:src/Foo2.java")
- .setStatus(Status.SAME).build())
+ private void initIncrementalReport(int numberOfLines) {
+ treeRootHolder.setRoot(ReportComponent
+ .builder(Component.Type.PROJECT, 1)
+ .setUuid(PROJECT_UUID)
+ .setKey(PROJECT_KEY)
+ .addChildren(
+ ReportComponent
+ .builder(Component.Type.MODULE, 2)
+ .setUuid("MODULE")
+ .setKey("MODULE_KEY")
+ .addChildren(
+ ReportComponent
+ .builder(Component.Type.FILE, FILE1_REF)
+ .setUuid(FILE1_UUID)
+ .setKey("MODULE_KEY:src/Foo.java")
+ .setFileAttributes(new FileAttributes(false, null, numberOfLines))
+ .setStatus(Status.CHANGED)
+ .build())
+ .build(),
+ ReportComponent
+ .builder(Component.Type.FILE, FILE2_REF)
+ .setUuid(FILE2_UUID)
+ .setKey("MODULE_KEY:src/Foo2.java")
+ .setStatus(Status.SAME).build())
.build());
reportReader.putComponent(ScannerReport.Component.newBuilder()