3 * Copyright (C) 2009-2024 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.ce.task.projectanalysis.batch;
22 import java.io.InputStream;
23 import java.util.Optional;
24 import javax.annotation.CheckForNull;
25 import org.sonar.core.util.CloseableIterator;
26 import org.sonar.scanner.protocol.output.ScannerReport;
28 public interface BatchReportReader {
29 ScannerReport.Metadata readMetadata();
32 InputStream getAnalysisCache();
34 CloseableIterator<String> readScannerLogs();
36 CloseableIterator<ScannerReport.ActiveRule> readActiveRules();
38 CloseableIterator<ScannerReport.AdHocRule> readAdHocRules();
40 CloseableIterator<ScannerReport.Measure> readComponentMeasures(int componentRef);
43 ScannerReport.Changesets readChangesets(int componentRef);
45 ScannerReport.Component readComponent(int componentRef);
47 CloseableIterator<ScannerReport.Issue> readComponentIssues(int componentRef);
49 CloseableIterator<ScannerReport.ExternalIssue> readComponentExternalIssues(int componentRef);
51 CloseableIterator<ScannerReport.Duplication> readComponentDuplications(int componentRef);
53 CloseableIterator<ScannerReport.CpdTextBlock> readCpdTextBlocks(int componentRef);
55 CloseableIterator<ScannerReport.Symbol> readComponentSymbols(int componentRef);
57 CloseableIterator<ScannerReport.SyntaxHighlightingRule> readComponentSyntaxHighlighting(int fileRef);
59 CloseableIterator<ScannerReport.LineCoverage> readComponentCoverage(int fileRef);
62 * Reads a file's source code, line by line. Returns an absent optional if the file does not exist
64 Optional<CloseableIterator<String>> readFileSource(int fileRef);
66 CloseableIterator<ScannerReport.ContextProperty> readContextProperties();
68 Optional<CloseableIterator<ScannerReport.LineSgnificantCode>> readComponentSignificantCode(int fileRef);
70 Optional<ScannerReport.ChangedLines> readComponentChangedLines(int fileRef);
72 CloseableIterator<ScannerReport.AnalysisWarning> readAnalysisWarnings();
74 CloseableIterator<ScannerReport.Cve> readCves();