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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo_path": "<repo_path>"
},
"name": "get_maintainability_metrics"
}
}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) |