aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-protocol/src/main
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-11-14 16:13:35 +0100
committersonartech <sonartech@sonarsource.com>2024-11-15 20:02:42 +0000
commitf4fbfe9415a713bd0df9c3f964591b3b7418c1d8 (patch)
tree2f7b3708c502196a96d7f0dbe6ba1010270bbe03 /sonar-scanner-protocol/src/main
parent997997559ba55d5ef05d4ca837697a48b9d6d5c3 (diff)
downloadsonarqube-f4fbfe9415a713bd0df9c3f964591b3b7418c1d8.tar.gz
sonarqube-f4fbfe9415a713bd0df9c3f964591b3b7418c1d8.zip
SONAR-23623 Remove useless remains of the SCA prototype
Diffstat (limited to 'sonar-scanner-protocol/src/main')
-rw-r--r--sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java4
-rw-r--r--sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java8
-rw-r--r--sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java5
-rw-r--r--sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/viewer/ScannerReportViewerApp.java21
-rw-r--r--sonar-scanner-protocol/src/main/protobuf/scanner_report.proto26
5 files changed, 7 insertions, 57 deletions
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java
index 5c59f112838..aaf677d55fc 100644
--- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java
+++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java
@@ -82,10 +82,6 @@ public class FileStructure {
return new File(dir, "adhocrules.pb");
}
- public File cves() {
- return new File(dir, "cves.pb");
- }
-
public File fileFor(Domain domain, int componentRef) {
return new File(dir, domain.filePrefix + componentRef + domain.fileSuffix);
}
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java
index 6e48f5b7809..48fdb6b7983 100644
--- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java
+++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java
@@ -61,14 +61,6 @@ public class ScannerReportReader {
return Protobuf.readStream(file, ScannerReport.AdHocRule.parser());
}
- public CloseableIterator<ScannerReport.Cve> readCves() {
- File file = fileStructure.cves();
- if (!fileExists(file)) {
- return emptyCloseableIterator();
- }
- return Protobuf.readStream(file, ScannerReport.Cve.parser());
- }
-
public CloseableIterator<ScannerReport.Measure> readComponentMeasures(int componentRef) {
File file = fileStructure.fileFor(FileStructure.Domain.MEASURES, componentRef);
if (fileExists(file)) {
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java
index 1c202ab8605..424b9bebccf 100644
--- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java
+++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java
@@ -97,11 +97,6 @@ public class ScannerReportWriter {
appendDelimitedTo(file, adHocRule, "ad hoc rule");
}
- public void appendCve(ScannerReport.Cve cve) {
- File file = fileStructure.cves();
- appendDelimitedTo(file, cve, "cve");
- }
-
public void appendComponentMeasure(int componentRef, ScannerReport.Measure measure) {
File file = fileStructure.fileFor(FileStructure.Domain.MEASURES, componentRef);
appendDelimitedTo(file, measure, "measure");
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/viewer/ScannerReportViewerApp.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/viewer/ScannerReportViewerApp.java
index 33928bb8fe2..e21a64a8bed 100644
--- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/viewer/ScannerReportViewerApp.java
+++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/viewer/ScannerReportViewerApp.java
@@ -101,8 +101,6 @@ public class ScannerReportViewerApp {
private JEditorPane activeRuleEditor;
private JScrollPane adHocRuleTab;
private JEditorPane adHocRuleEditor;
- private JScrollPane cveTab;
- private JEditorPane cveEditor;
private JScrollPane qualityProfileTab;
private JEditorPane qualityProfileEditor;
private JScrollPane pluginTab;
@@ -201,7 +199,6 @@ public class ScannerReportViewerApp {
loadComponents();
updateActiveRules();
updateAdHocRules();
- updateCves();
updateQualityProfiles();
updatePlugins();
updateMetadata();
@@ -405,18 +402,6 @@ public class ScannerReportViewerApp {
}
}
- private void updateCves() {
- cveEditor.setText("");
-
- StringBuilder builder = new StringBuilder();
- try (CloseableIterator<ScannerReport.Cve> cveCloseableIterator = reader.readCves()) {
- while (cveCloseableIterator.hasNext()) {
- builder.append(cveCloseableIterator.next().toString()).append("\n");
- }
- cveEditor.setText(builder.toString());
- }
- }
-
private void updateQualityProfiles() {
qualityProfileEditor.setText("");
@@ -609,12 +594,6 @@ public class ScannerReportViewerApp {
adHocRuleEditor = new JEditorPane();
adHocRuleTab.setViewportView(adHocRuleEditor);
- cveTab = new JScrollPane();
- tabbedPane.addTab("CVEs", null, cveTab, null);
-
- cveEditor = new JEditorPane();
- cveTab.setViewportView(cveEditor);
-
qualityProfileTab = new JScrollPane();
tabbedPane.addTab("Quality Profiles", null, qualityProfileTab, null);
diff --git a/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto b/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto
index c062c0ca161..74ff2bc0404 100644
--- a/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto
+++ b/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto
@@ -96,7 +96,7 @@ message ActiveRule {
string rule_repository = 1;
string rule_key = 2;
Severity severity = 3;
- map<string,string> params_by_key = 4;
+ map<string, string> params_by_key = 4;
int64 createdAt = 5;
int64 updatedAt = 6;
string q_profile_key = 7;
@@ -143,8 +143,8 @@ message Component {
enum ComponentType {
UNSET = 0;
PROJECT = 1;
- MODULE = 2 [deprecated=true];
- DIRECTORY = 3 [deprecated=true];
+ MODULE = 2 [deprecated = true];
+ DIRECTORY = 3 [deprecated = true];
FILE = 4;
}
@@ -221,31 +221,19 @@ message ExternalIssue {
repeated MessageFormatting msgFormatting = 9;
repeated Impact impacts = 10;
optional string cleanCodeAttribute = 11;
- optional string cve_id = 12;
}
message AdHocRule {
- string engine_id = 1;
- string rule_id = 2;
- string name = 3;
- string description = 4;
+ string engine_id = 1;
+ string rule_id = 2;
+ string name = 3;
+ string description = 4;
optional Severity severity = 5;
optional IssueType type = 6;
optional string cleanCodeAttribute = 7;
repeated Impact defaultImpacts = 8;
}
-message Cve {
- string cve_id = 1;
- string description = 2;
- optional double cvss_score = 3;
- optional double epss_score = 4;
- optional double epss_percentile = 5;
- optional int64 published_date = 6;
- optional int64 last_modified_date = 7;
- repeated string cwe = 8;
-}
-
enum IssueType {
UNSET = 0;
CODE_SMELL = 1;