private void recursivelyProcessComponent(ComputationContext context, int componentRef) {
   BatchReportReader reportReader = context.getReportReader();
   BatchReport.Component component = reportReader.readComponent(componentRef);
   List<BatchReport.Issue> issues = reportReader.readComponentIssues(componentRef);
   issueComputation.processComponentIssues(context, issues, component.getUuid(), componentRef);
   for (Integer childRef : component.getChildRefList()) {
     recursivelyProcessComponent(context, childRef);
   }
 }
예제 #2
0
 @Override
 public BatchReport.Metadata readMetadata() {
   if (this.metadata == null) {
     this.metadata = delegate.readMetadata();
   }
   return this.metadata;
 }
예제 #3
0
 @Override
 public CloseableIterator<String> readScannerLogs() {
   File file = delegate.getFileStructure().analysisLog();
   if (!file.exists()) {
     return CloseableIterator.emptyCloseableIterator();
   }
   try {
     InputStreamReader reader =
         new InputStreamReader(FileUtils.openInputStream(file), StandardCharsets.UTF_8);
     return new LineReaderIterator(reader);
   } catch (IOException e) {
     throw new IllegalStateException("Fail to open file " + file, e);
   }
 }
예제 #4
0
  @Override
  public Optional<CloseableIterator<String>> readFileSource(int fileRef) {
    File file = delegate.readFileSource(fileRef);
    if (file == null) {
      return Optional.absent();
    }

    try {
      return Optional.<CloseableIterator<String>>of(
          new CloseableLineIterator(
              IOUtils.lineIterator(FileUtils.openInputStream(file), StandardCharsets.UTF_8)));
    } catch (IOException e) {
      throw new IllegalStateException("Fail to traverse file: " + file, e);
    }
  }
예제 #5
0
  @Override
  public CloseableIterator<BatchReport.CoverageDetail> readCoverageDetails(int testFileRef) {
    File file = delegate.readCoverageDetails(testFileRef);
    if (file == null) {
      return CloseableIterator.emptyCloseableIterator();
    }

    try {
      return new ParserCloseableIterator<>(
          BatchReport.CoverageDetail.PARSER, FileUtils.openInputStream(file));
    } catch (IOException e) {
      Throwables.propagate(e);
      // actually never reached
      return CloseableIterator.emptyCloseableIterator();
    }
  }
예제 #6
0
 @Override
 public CloseableIterator<BatchReport.Duplication> readComponentDuplications(int componentRef) {
   return delegate.readComponentDuplications(componentRef);
 }
예제 #7
0
 @Override
 public CloseableIterator<BatchReport.Issue> readComponentIssues(int componentRef) {
   return delegate.readComponentIssues(componentRef);
 }
예제 #8
0
 @Override
 public BatchReport.Component readComponent(int componentRef) {
   return delegate.readComponent(componentRef);
 }
예제 #9
0
 @Override
 @CheckForNull
 public BatchReport.Changesets readChangesets(int componentRef) {
   return delegate.readChangesets(componentRef);
 }
예제 #10
0
 @Override
 public CloseableIterator<BatchReport.ActiveRule> readActiveRules() {
   return delegate.readActiveRules();
 }
예제 #11
0
 @Override
 public CloseableIterator<BatchReport.Coverage> readComponentCoverage(int fileRef) {
   return delegate.readComponentCoverage(fileRef);
 }
예제 #12
0
 @Override
 public CloseableIterator<BatchReport.SyntaxHighlighting> readComponentSyntaxHighlighting(
     int fileRef) {
   return delegate.readComponentSyntaxHighlighting(fileRef);
 }
예제 #13
0
 @Override
 public CloseableIterator<BatchReport.Symbol> readComponentSymbols(int componentRef) {
   return delegate.readComponentSymbols(componentRef);
 }