get_maintainability_metrics
Compute Maintainability Index for each function in a Python repository to identify hard-to-maintain code. Returns worst-scoring functions first, combining Halstead Volume, cyclomatic complexity, and lines of code.
Instructions
Compute Maintainability Index (MI) per function across a Python repository. MI combines Halstead Volume, cyclomatic complexity, and lines of code into a 0-100 score. Returns the worst-scoring functions first. Functions with MI < 20 are hard to maintain.
No prior indexing required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | Path to the repository | |
| top_n | No | Number of top results to return (1-100, default: 20) | |
| exclude_tests | No | Exclude test files from analysis (default: true) |