Catalog PyPI
Back to packageRELEASE DETAILS

1.0.0

PyPI

agentic-crap-py

Function-level CRAP analysis for Python using LCOV coverage.

complexitycoveragecraplcovpython
Published16 Sept 2026
Direct dependencies0
Transitive dependenciesNot calculated

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.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

2 collected
agentic_crap_py-1.0.0-py3-none-any.whl

bdist_wheel · 6.54 KB · Python py3

Source file
agentic_crap_py-1.0.0.tar.gz

sdist · 6.48 KB · Python source

Source file

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_version:60a4dffe9c929da8f63d6937dc3ae729182a4bb784e1676d3f012fa00a0779d3

Other collected versions

View all collected versions →