Skip to content

Feature Request: Display Total Coverage Percentage in SimpleCov Index #540

@julioalucero

Description

@julioalucero

Display total coverage percentage in SimpleCov index

Would be nice to show the overall project coverage percentage in the SimpleCov index page. Right now it only shows individual file coverage, but I often want to see the total coverage number (like "45.5%") at a glance.

I implemented this using SimpleCov's covered_percent method from the SimpleCov::Result object. The changes:

  • Added a method to expose the SimpleCov::Result from the Coverage analyser
  • Added total_coverage to the SimpleCovIndex generator that displays it in the header
  • Reused the existing Coverage analyser logic (no duplication)
  • The result is cached when the analyser runs, so there's no performance impact

The implementation uses SimpleCov's own calculation method, so it's accurate and consistent with SimpleCov's reporting.

Screenshot of example working locally.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions