Skip to content

Calculate C.R.A.P. Score from Cobertura file? #641

Closed
@rikrak

Description

@rikrak

Not so much a bug as a feature request/question.

When processing Cobertura files, would it be possible to also calculate the crap score? Corbertura itself doesn't provide a value for this metric, but it looks possible to calculate it from the Cyclomatic Complexity and Coverage values for each method using:
CRAP(m) = CC(m)^2 * U(m)^3 + CC(m)
Where
CC(m) = Cyclomatic Complexity (e.g. 5)
U(m) = Uncovered percentage (e.g. 30% = 0.3)

I've played about with the code locally and produced a report from cobertura that does this. Just wondering if this is worth working into a PR?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions