use of org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistEventsStep method execute.
@Override
public void execute(ComputationStep.Context context) {
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.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistMeasuresStep method execute.
@Override
public void execute(ComputationStep.Context context) {
try (DbSession dbSession = dbClient.openSession(true)) {
MeasureVisitor visitor = new MeasureVisitor(dbSession);
new DepthTraversalTypeAwareCrawler(visitor).visit(treeRootHolder.getRoot());
dbSession.commit();
context.getStatistics().add("inserts", visitor.inserts);
}
}
use of org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class LoadDuplicationsFromReportStep method execute.
@Override
public void execute(ComputationStep.Context context) {
DuplicationVisitor visitor = new DuplicationVisitor();
new DepthTraversalTypeAwareCrawler(visitor).visit(treeRootHolder.getReportTreeRoot());
context.getStatistics().add("duplications", visitor.count);
}
use of org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class FileMoveDetectionStep method getReportFilesByUuid.
private static Map<String, Component> getReportFilesByUuid(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.getUuid(), file);
}
}).visit(root);
return builder.build();
}
Aggregations