Skip to content

Commit

Permalink
PLUGINAPI-80 Add metrics for new and high impact accepted issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ericg138 committed Dec 21, 2023
1 parent 81ebce3 commit d4c8de2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 10.4

* Add new metrics `org.sonar.api.measures.CoreMetrics.NEW_ACCEPTED_ISSUES` and `org.sonar.api.measures.CoreMetrics.HIGH_IMPACT_ACCEPTED_ISSUES`.
* Add new metric `org.sonar.api.measures.CoreMetrics.PULL_REQUEST_FIXED_ISSUES` to represent issues that would be fixed by the pull request.
* Fixed misleading javadoc of `org.sonar.api.config.Configuration` to make it clear that at Compute Engine level project configuration is not provided.
* Deprecate `org.sonar.api.issue.DefaultTransitions.UNCOMFIRM`. There is no replacement as `org.sonar.api.issue.DefaultTransitions.CONFIRM` is subject to removal in the future.
Expand Down
33 changes: 33 additions & 0 deletions plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,39 @@ public final class CoreMetrics {
.setOptimizedBestValue(true)
.create();

/**
* @since 10.4
*/
public static final String NEW_ACCEPTED_ISSUES_KEY = "new_accepted_issues";

/**
* @since 10.4
*/
public static final Metric<Integer> NEW_ACCEPTED_ISSUES = new Metric.Builder(NEW_ACCEPTED_ISSUES_KEY, "New Accepted Issues", Metric.ValueType.INT)
.setDescription("New accepted issues")
.setDirection(Metric.DIRECTION_WORST)
.setDomain(DOMAIN_ISSUES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
.setDeleteHistoricalData(true)
.create();

/**
* @since 10.4
*/
public static final String HIGH_IMPACT_ACCEPTED_ISSUES_KEY = "high_impact_accepted_issues";

/**
* @since 10.4
*/
public static final Metric<Integer> HIGH_IMPACT_ACCEPTED_ISSUES = new Metric.Builder(HIGH_IMPACT_ACCEPTED_ISSUES_KEY, "High Impact Accepted Issues", Metric.ValueType.INT)
.setDescription("Accepted issues with high impact")
.setDirection(Metric.DIRECTION_WORST)
.setDomain(DOMAIN_ISSUES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
.create();

/**
* @since 3.6
*/
Expand Down

0 comments on commit d4c8de2

Please sign in to comment.