[architecture]
Analyzes code complexity metrics (cyclomatic complexity, LOC, method counts).
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| typeName | string | No | Optional type name filter. |
| filePath | string | No | Optional file path filter. |
| projectName | string | No | Optional project name filter. |
| minCyclomaticComplexity | number | No | Only include methods with cyclomatic complexity >= this value. Default is 0. |
| sortBy | string | No | Optional sort: 'complexity', 'averageComplexity', 'linesOfCode', 'methodCount', 'name'. |
| sortOrder | string | No | Sort order: 'asc' (default) or 'desc'. |
| skip | number | No | Pagination offset over returned types. Default is 0. |
| take | number | No | Pagination size over returned types. Default is 50. |
| timeout_ms | number | No | Timeout in milliseconds (5 minutes). Use 0 to disable. Default is 300000. |
Analyze overall complexity
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "analyze_complexity",
"arguments": {}
}
}{
"success": true,
"data": {
"summary": {
"totalTypes": 12,
"totalMethods": 84,
"totalLinesOfCode": 3200,
"averageComplexity": 3.1,
"maxComplexity": 12,
"highComplexityMethodCount": 4
},
"paging": {
"skip": 0,
"take": 50,
"returned": 12,
"total": 12
},
"types": [
{
"name": "SolutionManager",
"fullName": "Glider.Services.SolutionManager",
"kind": "Class",
"filePath": "/path/to/SolutionManager.cs",
"linesOfCode": 240,
"methodCount": 8,
"averageComplexity": 2.4,
"methods": [
{
"name": "LoadSolutionAsync",
"cyclomaticComplexity": 4,
"linesOfCode": 32,
"parameterCount": 1,
"lineNumber": 58
}
]
}
]
},
"error": null
}Show only high-complexity methods (>= 10)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "analyze_complexity",
"arguments": {
"minCyclomaticComplexity": 10,
"sortBy": "complexity",
"sortOrder": "desc"
}
}
}{
"success": true,
"data": {
"summary": {
"totalTypes": 12,
"totalMethods": 84,
"totalLinesOfCode": 3200,
"averageComplexity": 3.1,
"maxComplexity": 12,
"highComplexityMethodCount": 4
},
"paging": {
"skip": 0,
"take": 50,
"returned": 12,
"total": 12
},
"types": [
{
"name": "SolutionManager",
"fullName": "Glider.Services.SolutionManager",
"kind": "Class",
"filePath": "/path/to/SolutionManager.cs",
"linesOfCode": 240,
"methodCount": 8,
"averageComplexity": 2.4,
"methods": [
{
"name": "LoadSolutionAsync",
"cyclomaticComplexity": 4,
"linesOfCode": 32,
"parameterCount": 1,
"lineNumber": 58
}
]
}
]
},
"error": null
}Returns summary metrics and per-type complexity details (with paging)