magento_complexity
Analyze PHP code complexity including cyclomatic complexity, function count, and line count. Identify complex hotspots to prioritize refactoring.
Instructions
Analyze code complexity — cyclomatic complexity, function count, and line count for PHP files. Identifies complex hotspots and rates each file. Use for refactoring prioritization.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "magento_complexity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Specific file or directory path to analyze instead of a module name | |
| module | No | Magento module to analyze. Finds all PHP files in the module. Examples: "Magento_Catalog", "Magento_Checkout", "Magento_Sales" | |
| threshold | No | Minimum cyclomatic complexity to report. Set higher (e.g., 10) to only see complex files. Default: 0 (show all) |