--- id: xenon version: "0.9.3" license: MIT license_treatment: permissive maintenance: dormant --- # xenon — Monitor code metrics for Python on your CI server License: permissive · Maintenance: dormant · Downloads: 1.4M/mo ## What it is and what it does Xenon is a command-line tool that wraps Radon to measure cyclomatic complexity across a Python codebase and enforce complexity thresholds. It calculates three metrics: average complexity across all blocks, per-module complexity, and absolute complexity of individual blocks, each ranked from A (simplest) to F (most complex). You set thresholds for each metric, and xenon exits with a non-zero code if any threshold is violated, making it suitable for blocking commits or failing CI builds when code becomes too complex. Typically used in two contexts: as a pre-commit hook to prevent overly complex code from entering version control, or as a CI step to monitor complexity trends over time. It accepts glob patterns to exclude or ignore files and directories, and integrates with pre-commit frameworks. The package depends on radon for the actual complexity analysis, requests for potential HTTP operations, and PyYAML for configuration parsing. Use it for: - Enforce complexity limits in a CI/CD pipeline to prevent code from becoming unmaintainable as features are added. - Block commits via a pre-commit hook when a developer introduces a function or module exceeding your team's complexity threshold. - Monitor average codebase complexity over time to catch gradual increases in technical debt. - Set per-module complexity caps to ensure no single module becomes a maintenance bottleneck. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Xenon monitors Python code complexity by measuring cyclomatic complexity across your codebase and fails your build when thresholds are exceeded, typically used in CI/CD pipelines and git commit hooks. Yes, if you need lightweight complexity enforcement in CI or pre-commit workflows and can accept dormant maintenance. The package is stable and does one job well, but expect no active support or updates; if you require ongoing maintenance or advanced complexity analysis features, consider alternatives. No known vulnerabilities and low install friction make it a low-risk addition to existing pipelines. ## Install pip install xenon uv add xenon poetry add xenon ## Installing xenon Before you install: Low friction install with three straightforward runtime dependencies (radon, requests, PyYAML). Maintenance is dormant—last release was 662 days ago—so expect no active bug fixes or feature updates, though the package remains functional for its narrow purpose. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions; you may use, modify, and distribute xenon freely as long as you include the license notice. Quickstart: pip install xenon xenon --max-absolute B --max-modules A --max-average A /path/to/code Requires Python 2.7 or 3.6+ (classifiers indicate support through 3.12); xenon measures cyclomatic complexity via radon, so results depend on radon's analysis capabilities. Verify before relying: - Whether dormant maintenance (662 days since last release) affects compatibility with recent Python patch releases or modern CI platforms. - Whether the package's complexity thresholds (A–F ranks) align with your team's code quality standards without requiring custom configuration. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python code complexity monitoring, cyclomatic complexity checker, code quality ci integration, complexity threshold enforcement, radon-based code metrics, build failure on complexity, pre-commit complexity hook, code-quality, ci-integration, complexity-analysis [View on SkillFed](https://skillfed.io/packages/xenon) · [View on PyPI](https://pypi.org/project/xenon/)