PLUGINAPI-208/209 Add MQR severity and issue-count metrics to CoreMetrics - #311
Conversation
53569d7 to
3339ec9
Compare
5d7eb83 to
d73be6f
Compare
d73be6f to
26ac7f8
Compare
dorian-burihabwa-sonarsource
left a comment
There was a problem hiding this comment.
Will continue the review later. Some issues might already be addressed ahead of final review
26ac7f8 to
cd5cebd
Compare
CI failed: 1 infrastructure failure caused by a temporary network/download error when fetching a dependent GitHub action archive.Overview1 log analyzed across 1 unique error template. The failure was entirely infrastructure-related due to a failure in downloading a GitHub action archive. FailuresAction Archive Download Failure (confidence: high)
Summary
Code Review ✅ Approved 1 resolved / 1 findingsAdds 9 new MQR severity and flat issue-count metric definitions to CoreMetrics with corresponding test coverage. No issues found. ✅ 1 resolved✅ Bug: NEW_* software-quality issue metrics still qualitative(true)
Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
dorian-burihabwa-sonarsource
left a comment
There was a problem hiding this comment.
LGTM 👍
Code Review ✅ Approved 1 resolved / 1 findingsAdds 9 new MQR severity and flat issue-count metric definitions to CoreMetrics with corresponding test coverage. No issues found. ✅ 1 resolved✅ Bug: NEW_* software-quality issue metrics still qualitative(true)
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |




What
Two related additions to
org.sonar.api.measures.CoreMetrics, both part of the SC-53446 (Deprecate Standard metrics and promote MQR-related metrics) effort:PLUGINAPI-208 - severity metrics for overall code (MQR mode)
CoreMetricshad already declared the new-code-period severity metrics (new_reliability_issue_severity,new_security_issue_severity,new_maintainability_issue_severity). This adds the overall-code equivalents.PLUGINAPI-209 - flat issue count metrics
SQC needs flat count metrics equivalent to SQS's
software_quality_*_issuesso that:bugs,new_bugs,vulnerabilities,new_vulnerabilities,code_smells,new_code_smells) can be replaced on the measures page and in project badgesThese flat count metrics currently exist in a dedicated class in SQS,
SoftwareQualitiesMetrics(not inCoreMetrics), and SQC does not compute them. Moving them toCoreMetricsfollows the established convention and lets both products share the same declaration.What's in this PR
New 9 metrics definitions in
CoreMetrics:RELIABILITY_ISSUE_SEVERITY,SECURITY_ISSUE_SEVERITY,MAINTAINABILITY_ISSUE_SEVERITYSOFTWARE_QUALITY_{MAINTAINABILITY,RELIABILITY,SECURITY}_ISSUESand theirNEW_*variantsThis is the lowest-level, most-blocking change: the report processor analysis and sonarcloud-core measures formulas need these metrics to exist before they can compute them.
The issue-count metrics mirror SQS's
SoftwareQualitiesMetricsclass exactly (value type, direction, best value, qualitative flags). The severity metrics mirror the existingNEW_*_ISSUE_SEVERITYmetrics' shape (value type, direction, best/worst value on the 0-25SeverityValuesscale).Metrics are auto-registered from
CoreMetricsby reflection at server startup (RegisterMetrics).Sequencing (this PR blocks the rest)
CoreMetrics(plugin-api)Notes
setQualitative(false)on the 3 overall-code metrics,trueon the 3new_*variants — intentionally mirrors SQS'sSoftwareQualitiesMetricsas-is, not an inconsistency.@since 13.10matches the currentgradle.propertiesversion (13.10-SNAPSHOT) and theCHANGELOG.mdentries added under## 13.10.Validation
CHANGELOG.mdupdated under## 13.10, two entries (severity metrics, issue-count metrics)