Catalog PyPI
PACKAGE EXPLORERView in registry

agentic-crap-py

PyPI

Function-level CRAP analysis for Python using LCOV coverage.

complexitycoveragecraplcovpython
Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 22:14 UTC

README

Version 1.0.0 documentation

agentic-crap-py

Analyze function-level CRAP scores for Python using LCOV line coverage.

Quick start

python -m pip install agentic-crap-py
agentic-crap-py --source src --lcov coverage/lcov.info --threshold 10

For a local checkout, run python -m pip install . and then agentic-crap-py --source src --lcov coverage/lcov.info.

Coverage generation

Pass coverage generation as a JSON argv array. It is executed directly without a shell, so shell syntax, pipelines, and interpolation are intentionally not supported.

agentic-crap-py --source src --coverage-command '["python","-m","coverage","lcov","-o","coverage/lcov.info"]' --lcov coverage/lcov.info --json

An existing LCOV file is removed before this command runs. The command must create the requested LCOV file or analysis fails, preventing stale coverage from being accepted.

Output and exit codes

Use --json for deterministic compact JSON, sorted by file, line, and function.

Exit codeMeaning
0Every selected function has coverage and is within the threshold.
1A CRAP score exceeds the threshold.
2Coverage is missing, malformed, unmapped, or analysis cannot run.

Score

For cyclomatic complexity CC and line coverage ratio C, the score is:

CRAP = CC^2 * (1 - C)^3 + CC

Nested function bodies are excluded from an enclosing function's coverage and complexity calculation. A function with no mapped LCOV lines is reported as N/A and fails rather than passing.

Development

python -m unittest discover -s tests -v

Python 3.10 or newer is required. The runtime uses only the Python standard library; generate LCOV using the coverage tooling already used by your project.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.016 Sept 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
retkmin/agentic-crap-py

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:76b0725b1137ebb7be663127fe9bb1975e7cd8e71d23f650e5a673185fbe00b6