jenkinsci / jenkinsci/coverage-model

Add API for metric aggregation type

Open
#270 1 comment 0 reactions 0 assignees View on GitHub
feature
Dominant language
Java
Stars
10
Forks
43
Avg merge
5d 7h
Merged PRs (30d)
6

Description

In previous releases the coverage-model provided support for the cyclomatic complexity as aggregated value per class, package, or module *and* as a maximum value of all methods. After integrating all metrics, the specific handling of the cyclomatic complexity has been removed, all metrics are now aggregated only.

In practice, it makes sense to compute for all metrics (this should be part of the new enum `MetricAggregation`)

- the aggregation value
- the maximum value
- the minimum value
- the average value

Then reports or quality gates can act on any of these values.

To make that happen, the following API needs to be added or changed.
- [ ] Add a new enum `MetricAggregation`
- [ ] `Node#getValue` should get an override with an additional parameter `MetricAggregation`

Before we start with an implementation, we need to carefully think about the following questions:

- [x] What should `getValue` return for a package node, or a class node? Is it the aggregation of classes or packages or always the root of the tree?
- [ ] What should `getMetricsDistribution` return?
- [ ] What does this mean for the delta computations?
- [ ] What does this mean for the statistics object that is used in quality gates?

References:

- https://github.com/jenkinsci/coverage-plugin/pull/669
- https://github.com/jenkinsci/coverage-plugin/issues/639

Contributor guide

Open the contributing guide

Research direction

Start with the existing Node#getValue, getMetricsDistribution, delta computations, and the statistics object used by quality gates. Review the linked pull request 669 and issue 639, then resolve the open questions about package and class values, distributions, deltas, and statistics before defining MetricAggregation and the getValue override. Done means the API behavior is specified and the related implementation and tests cover aggregation, maximum, minimum, and average values.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.