--- id: radon version: "6.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # radon — Code Metrics in Python License: permissive · Maintenance: dormant · Downloads: 5.8M/mo ## What it is and what it does Radon is a static analysis tool that measures code quality through multiple metrics. It computes cyclomatic complexity (how many independent paths flow through code), raw metrics like lines of code and comment density, Halstead metrics (effort and difficulty estimates), and a maintainability index similar to Visual Studio's implementation. You run it from the command line or call it programmatically to analyze Python files and get a report on code structure and complexity. The tool is designed to integrate into CI/CD pipelines and code review platforms (Codacy, Code Climate, coala, CodeFactor all support it). It depends only on mando for CLI handling and colorama for optional colored output. It can also analyze Jupyter notebooks if the optional nbformat package is installed. Use it for: - Identify overly complex functions that need refactoring by running cyclomatic complexity analysis on a codebase - Measure code maintainability trends over time by tracking raw metrics and maintainability index across releases - Integrate code quality gates into CI/CD by using radon to fail builds when complexity thresholds are exceeded - Analyze Jupyter notebooks for code quality metrics alongside regular Python files - Generate code quality reports for code review or documentation purposes ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Radon computes code metrics from Python source files, including cyclomatic complexity, raw metrics (lines of code, comments, blanks), Halstead metrics, and maintainability index. Yes, with conditions. Radon is stable and widely used (5.7M monthly downloads, top 5000 packages), with no known vulnerabilities and low install friction. However, the project is dormant—no releases in over a year and no commits since October 2024. Install it if you need code metrics for analysis or CI integration, but do not expect active maintenance or support for very recent Python versions. For active monitoring and CI enforcement, consider xenon as an alternative. ## Install pip install radon uv add radon poetry add radon ## Installing radon Before you install: Low install friction with only two runtime dependencies (mando and colorama). Dormant maintenance status—last release was over a year ago and no commits since October 2024—but the package is marked Production/Stable and has accumulated 2005 repository stars. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions. Quickstart: pip install radon radon cc mymodule.py -a # Or programmatically: from radon.complexity import cc_visit with open('mymodule.py') as f: results = cc_visit(f.read()) On Windows or systems with non-UTF-8 default encoding, set the RADONFILESENCODING environment variable to UTF-8 to analyze files with Unicode characters. Verify before relying: - Whether the package remains actively maintained or is effectively unmaintained despite Production/Stable status - Compatibility with Python versions beyond 3.8 (classifiers list up to 3.9 but description mentions 3.8 as the upper bound) ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 5.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags cyclomatic complexity analysis, code metrics python, maintainability index, source code analysis, halstead metrics, code quality metrics, static code analysis, code-metrics, static-analysis, ci-integration [View on SkillFed](https://skillfed.io/packages/radon) · [View on PyPI](https://pypi.org/project/radon/)