@Override
 public void execute() {
   new PathAwareCrawler<>(
           FormulaExecutorComponentVisitor.newBuilder(metricRepository, measureRepository)
               .buildFor(FORMULAS))
       .visit(treeRootHolder.getRoot());
 }
  @Override
  public void execute() {
    NumberOfDaysSinceLastCommitVisitor visitor = new NumberOfDaysSinceLastCommitVisitor();
    Component project = treeRootHolder.getRoot();
    new DepthTraversalTypeAwareCrawler(visitor).visit(project);

    long lastCommitTimestamp = visitor.lastCommitTimestampFromReport;
    if (lastCommitTimestamp == 0L) {
      Long lastCommitFromIndex = lastCommitFromIndex(treeRootHolder.getRoot().getUuid());
      lastCommitTimestamp = firstNonNull(lastCommitFromIndex, lastCommitTimestamp);
    }

    if (lastCommitTimestamp != 0L) {
      persistNumberOfDaysSinceLastCommit(
          lastCommitTimestamp, dbIdsRepository.getSnapshotId(project));
    }
  }
 @Override
 public void execute() {
   new DepthTraversalTypeAwareVisitor(PROJECT, PRE_ORDER) {
     @Override
     public void visitProject(Component project) {
       executeForProject(project);
     }
   }.visit(treeRootHolder.getRoot());
 }
 @Override
 public void execute() {
   new DepthTraversalTypeAwareCrawler(
           new TypeAwareVisitorAdapter(CrawlerDepthLimit.PROJECT, PRE_ORDER) {
             @Override
             public void visitProject(Component project) {
               executeForProject(project);
             }
           })
       .visit(treeRootHolder.getRoot());
 }
 @Override
 public void execute() {
   // Don't use batch insert for file_sources since keeping all data in memory can produce OOM for
   // big files
   DbSession session = dbClient.openSession(false);
   try {
     new FileSourceVisitor(session).visit(treeRootHolder.getRoot());
   } finally {
     MyBatis.closeQuietly(session);
   }
 }
 /** Uuids of all the components that have open issues on this project. */
 public Set<String> loadUuidsOfComponentsWithOpenIssues() {
   DbSession session = dbClient.openSession(false);
   try {
     return dbClient
         .issueDao()
         .selectComponentUuidsOfOpenIssuesForProjectUuid(
             session, treeRootHolder.getRoot().getUuid());
   } finally {
     MyBatis.closeQuietly(session);
   }
 }
 @Override
 public void execute() {
   DbSession session = dbClient.openSession(false);
   try {
     Map<String, ComponentDto> existingComponentDtosByKey = indexExistingDtosByKey(session);
     new PathAwareCrawler<>(new PersistComponentStepsVisitor(existingComponentDtosByKey, session))
         .visit(treeRootHolder.getRoot());
     session.commit();
   } finally {
     dbClient.closeSession(session);
   }
 }
 @Override
 public void execute() {
   DbSession session = dbClient.openSession(true);
   try {
     if (crossProjectDuplicationStatusHolder.isEnabled()) {
       Component project = treeRootHolder.getRoot();
       long projectSnapshotId = dbIdsRepository.getSnapshotId(project);
       new DepthTraversalTypeAwareCrawler(new DuplicationVisitor(session, projectSnapshotId))
           .visit(project);
     }
     session.commit();
   } finally {
     dbClient.closeSession(session);
   }
 }
 @Override
 public void execute() {
   Metric qProfilesMetric = metricRepository.getByKey(CoreMetrics.QUALITY_PROFILES_KEY);
   new PathAwareCrawler<>(new NewCoverageAggregationComponentVisitor(qProfilesMetric))
       .visit(treeRootHolder.getRoot());
 }
 private Map<String, ComponentDto> indexExistingDtosByKey(DbSession session) {
   return from(dbClient
           .componentDao()
           .selectAllComponentsFromProjectKey(session, treeRootHolder.getRoot().getKey()))
       .uniqueIndex(toKey());
 }