Skip to content

Commit 350c29a

Browse files
PLUGINAPI-89 Add metrics 'new_reliability_issues','new_security_issues','new_maintainability_issues',
1 parent 3e49ceb commit 350c29a

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 10.7
4+
5+
* Add new metrics `org.sonar.api.measures.CoreMetrics.NEW_SECURITY_ISSUES`, `org.sonar.api.measures.CoreMetrics.NEW_MAINTAINABILITY_ISSUES` and `org.sonar.api.measures.CoreMetrics.NEW_RELIABILITY_ISSUES`.
6+
37
## 10.6
48

59
* Deprecate metric `org.sonar.api.measures.CoreMetrics.HIGH_IMPACT_ACCEPTED_ISSUES`.

plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,33 @@ public final class CoreMetrics {
10271027
.setDomain(DOMAIN_ISSUES)
10281028
.create();
10291029

1030+
/**
1031+
* @since 10.7
1032+
*/
1033+
@Beta
1034+
public static final String NEW_MAINTAINABILITY_ISSUES_KEY = "new_maintainability_issues";
1035+
1036+
/**
1037+
* This metric relates to new issues with the software quality set as 'Maintainability'. It contains information about total number of
1038+
* these issues as well as their distribution based on the severity within the impact.
1039+
* Example of the format:
1040+
* {
1041+
* "total": 3,
1042+
* "HIGH": 1,
1043+
* "MEDIUM": 1,
1044+
* "LOW": 1
1045+
* }
1046+
*
1047+
* @since 10.7
1048+
*/
1049+
@Beta
1050+
public static final Metric<String> NEW_MAINTAINABILITY_ISSUES = new Metric.Builder(NEW_MAINTAINABILITY_ISSUES_KEY, "New Maintainability Issues",
1051+
Metric.ValueType.DATA)
1052+
.setDescription("New maintainability issues")
1053+
.setDomain(DOMAIN_ISSUES)
1054+
.setDeleteHistoricalData(true)
1055+
.create();
1056+
10301057
/**
10311058
* @since 10.6
10321059
*/
@@ -1052,6 +1079,33 @@ public final class CoreMetrics {
10521079
.setDomain(DOMAIN_ISSUES)
10531080
.create();
10541081

1082+
/**
1083+
* @since 10.7
1084+
*/
1085+
@Beta
1086+
public static final String NEW_RELIABILITY_ISSUES_KEY = "new_reliability_issues";
1087+
1088+
/**
1089+
* This metric relates to new issues with the software quality set as 'Reliability'. It contains information about total number of
1090+
* these issues as well as their distribution based on the severity within the impact.
1091+
* Example of the format:
1092+
* {
1093+
* "total": 3,
1094+
* "HIGH": 1,
1095+
* "MEDIUM": 1,
1096+
* "LOW": 1
1097+
* }
1098+
*
1099+
* @since 10.7
1100+
*/
1101+
@Beta
1102+
public static final Metric<String> NEW_RELIABILITY_ISSUES = new Metric.Builder(NEW_RELIABILITY_ISSUES_KEY, "New Reliability Issues",
1103+
Metric.ValueType.DATA)
1104+
.setDescription("New reliability issues")
1105+
.setDomain(DOMAIN_ISSUES)
1106+
.setDeleteHistoricalData(true)
1107+
.create();
1108+
10551109
/**
10561110
* @since 10.6
10571111
*/
@@ -1076,6 +1130,33 @@ public final class CoreMetrics {
10761130
.setDomain(DOMAIN_ISSUES)
10771131
.create();
10781132

1133+
/**
1134+
* @since 10.7
1135+
*/
1136+
@Beta
1137+
public static final String NEW_SECURITY_ISSUES_KEY = "new_security_issues";
1138+
1139+
/**
1140+
* This metric relates to new issues with the software quality set as 'Security'. It contains information about total number of
1141+
* these issues as well as their distribution based on the severity within the impact.
1142+
* Example of the format:
1143+
* {
1144+
* "total": 3,
1145+
* "HIGH": 1,
1146+
* "MEDIUM": 1,
1147+
* "LOW": 1
1148+
* }
1149+
*
1150+
* @since 10.7
1151+
*/
1152+
@Beta
1153+
public static final Metric<String> NEW_SECURITY_ISSUES = new Metric.Builder(NEW_SECURITY_ISSUES_KEY, "New Security Issues",
1154+
Metric.ValueType.DATA)
1155+
.setDescription("New security issues")
1156+
.setDomain(DOMAIN_ISSUES)
1157+
.setDeleteHistoricalData(true)
1158+
.create();
1159+
10791160
/**
10801161
* @since 3.6
10811162
* @deprecated since 10.4. Use {@link #VIOLATIONS_KEY} instead.

0 commit comments

Comments
 (0)