use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class FileMoveDetectionStep method getReportFilesByKey.
private static Map<String, Component> getReportFilesByKey(Component root) {
final ImmutableMap.Builder<String, Component> builder = ImmutableMap.builder();
new DepthTraversalTypeAwareCrawler(new TypeAwareVisitorAdapter(CrawlerDepthLimit.FILE, POST_ORDER) {
@Override
public void visitFile(Component file) {
builder.put(file.getKey(), file);
}
}).visit(root);
return builder.build();
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistEventsStep method execute.
@Override
public void execute() {
try (DbSession dbSession = dbClient.openSession(false)) {
long analysisDate = analysisMetadataHolder.getAnalysisDate();
new DepthTraversalTypeAwareCrawler(new PersistEventComponentVisitor(dbSession, analysisDate)).visit(treeRootHolder.getRoot());
dbSession.commit();
}
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistMeasuresStep method execute.
@Override
public void execute() {
DbSession dbSession = dbClient.openSession(true);
try {
new DepthTraversalTypeAwareCrawler(new MeasureVisitor(dbSession)).visit(treeRootHolder.getRoot());
dbSession.commit();
} finally {
dbSession.close();
}
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class LoadDuplicationsFromReportStep method execute.
@Override
public void execute() {
new DepthTraversalTypeAwareCrawler(new TypeAwareVisitorAdapter(CrawlerDepthLimit.FILE, POST_ORDER) {
@Override
public void visitFile(Component file) {
CloseableIterator<ScannerReport.Duplication> duplications = batchReportReader.readComponentDuplications(file.getReportAttributes().getRef());
try {
int idGenerator = 1;
while (duplications.hasNext()) {
loadDuplications(file, duplications.next(), idGenerator);
idGenerator++;
}
} finally {
duplications.close();
}
}
}).visit(treeRootHolder.getRoot());
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistAnalysisStep method execute.
@Override
public void execute() {
try (DbSession dbSession = dbClient.openSession(false)) {
new DepthTraversalTypeAwareCrawler(new PersistSnapshotsPathAwareVisitor(dbSession, analysisMetadataHolder.getAnalysisDate())).visit(treeRootHolder.getRoot());
dbSession.commit();
}
}
Aggregations