Functions missing from the coverage report score 0% with no warning

Open Beginner friendly
#41 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@warxhead1 is already working on this.

Since Nov 20, 2026.

  • #42 by @warxhead1 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
go, python
Domain
cli, testing-qa

Research direction

Start from the CLI path that handles --use-existing-coverage and the code that loads the Go coverage profile into per-function scores; the README documents the current 0% fallback. Reproduce with go test -coverprofile=target/coverage/go/coverage.out ./pkg/a then crapper --use-existing-coverage pkg/a and watch stderr. Done when files absent from the profile are counted and reported, for example crapper: 14 files are not in the coverage report; their functions score 0%, without changing the scores.

Written by the indexing model from the issue text.

Description

When a function's file is not in the coverage report, crapper scores it 0% covered and prints nothing about it. A partial report then reads as untested code.

Reproduce (Go)

  1. In a module with pkg/a and pkg/a/sub, both tested, write a profile for pkg/a only:
    go test -coverprofile=target/coverage/go/coverage.out ./pkg/a
  2. Run crapper --use-existing-coverage pkg/a.

Every function in pkg/a/sub shows 0.0% and a high CRAP score, even though its tests pass. Nothing on stderr says those files were missing from the report. On a real repo this put a whole tested subpackage at the top of the worst-first table.

Expected

The README already documents the 0% fallback. A warning would make it visible, for example crapper: 14 files are not in the coverage report; their functions score 0%, listing the files or a count. mutator already says "a file missing from the report is treated as uncovered" during its run.

Seen at c757ec7.

Dominant language
Python
Stars
255
Forks
101
Avg merge
7m
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from unclebob/crapper

All issues in unclebob/crapper

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.