use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class ComputeMeasureVariationsStep method execute.
@Override
public void execute() {
try (DbSession dbSession = dbClient.openSession(false)) {
List<Metric> metrics = StreamSupport.stream(metricRepository.getAll().spliterator(), false).filter(isNumeric()).collect(Collectors.toList());
new DepthTraversalTypeAwareCrawler(new VariationMeasuresVisitor(dbSession, metrics)).visit(treeRootHolder.getRoot());
}
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistCrossProjectDuplicationIndexStep method execute.
@Override
public void execute() {
if (!crossProjectDuplicationStatusHolder.isEnabled()) {
return;
}
try (DbSession dbSession = dbClient.openSession(true)) {
Component project = treeRootHolder.getRoot();
new DepthTraversalTypeAwareCrawler(new DuplicationVisitor(dbSession, analysisMetadataHolder.getUuid())).visit(project);
dbSession.commit();
}
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistProjectLinksStep method execute.
@Override
public void execute() {
try (DbSession session = dbClient.openSession(false)) {
new DepthTraversalTypeAwareCrawler(new ProjectLinkVisitor(session)).visit(treeRootHolder.getRoot());
session.commit();
}
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class PersistTestsStep method execute.
@Override
public void execute() {
try (DbSession dbSession = dbClient.openSession(true)) {
TestDepthTraversalTypeAwareVisitor visitor = new TestDepthTraversalTypeAwareVisitor(dbSession);
new DepthTraversalTypeAwareCrawler(visitor).visit(treeRootHolder.getRoot());
dbSession.commit();
if (visitor.hasUnprocessedCoverageDetails) {
LOG.warn("Some coverage tests are not taken into account during analysis of project '{}'", visitor.getProjectKey());
}
}
}
use of org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler in project sonarqube by SonarSource.
the class ValidateProjectStep method execute.
@Override
public void execute() {
try (DbSession dbSession = dbClient.openSession(false)) {
Component root = treeRootHolder.getRoot();
List<ComponentDto> baseModules = dbClient.componentDao().selectEnabledModulesFromProjectKey(dbSession, root.getKey());
Map<String, ComponentDto> baseModulesByKey = from(baseModules).uniqueIndex(ComponentDto::key);
ValidateProjectsVisitor visitor = new ValidateProjectsVisitor(dbSession, dbClient.componentDao(), baseModulesByKey);
new DepthTraversalTypeAwareCrawler(visitor).visit(root);
if (!visitor.validationMessages.isEmpty()) {
throw MessageException.of("Validation of project failed:\n o " + MESSAGES_JOINER.join(visitor.validationMessages));
}
}
}
Aggregations