Search in sources :

Example 1 with Metadata

use of org.sonar.scanner.protocol.output.ScannerReport.Metadata in project sonarqube by SonarSource.

the class TaskResult method scanTaskCompleted.

@Override
public void scanTaskCompleted(ProjectScanContainer container) {
    LOG.info("Store analysis results in memory for later assertions in medium test");
    for (TrackedIssue issue : container.getComponentByType(IssueCache.class).all()) {
        issues.add(issue);
    }
    ReportPublisher reportPublisher = container.getComponentByType(ReportPublisher.class);
    reader = new ScannerReportReader(reportPublisher.getReportDir());
    if (!container.getComponentByType(AnalysisMode.class).isIssues()) {
        Metadata readMetadata = getReportReader().readMetadata();
        int rootComponentRef = readMetadata.getRootComponentRef();
        storeReportComponents(rootComponentRef, null, readMetadata.getBranch());
    }
    storeFs(container);
}
Also used : TrackedIssue(org.sonar.scanner.issue.tracking.TrackedIssue) ReportPublisher(org.sonar.scanner.report.ReportPublisher) ScannerReportReader(org.sonar.scanner.protocol.output.ScannerReportReader) Metadata(org.sonar.scanner.protocol.output.ScannerReport.Metadata) IssueCache(org.sonar.scanner.issue.IssueCache)

Aggregations

IssueCache (org.sonar.scanner.issue.IssueCache)1 TrackedIssue (org.sonar.scanner.issue.tracking.TrackedIssue)1 Metadata (org.sonar.scanner.protocol.output.ScannerReport.Metadata)1 ScannerReportReader (org.sonar.scanner.protocol.output.ScannerReportReader)1 ReportPublisher (org.sonar.scanner.report.ReportPublisher)1