[architecture]
Analyzes code complexity metrics (cyclomatic complexity, LOC, method counts).
Project graphs, dependencies, unused references, and complexity are too large to infer reliably from scattered files.
The model can reason from architecture-level facts before deleting references, moving code, or prioritizing risky areas.
| 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. |
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": "OrderService",
"fullName": "Acme.Orders.Services.OrderService",
"kind": "Class",
"filePath": "/path/to/OrderService.cs",
"linesOfCode": 240,
"methodCount": 8,
"averageComplexity": 2.4,
"methods": [
{
"name": "SubmitOrderAsync",
"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": "OrderService",
"fullName": "Acme.Orders.Services.OrderService",
"kind": "Class",
"filePath": "/path/to/OrderService.cs",
"linesOfCode": 240,
"methodCount": 8,
"averageComplexity": 2.4,
"methods": [
{
"name": "SubmitOrderAsync",
"cyclomaticComplexity": 4,
"linesOfCode": 32,
"parameterCount": 1,
"lineNumber": 58
}
]
}
]
},
"error": null
}Returns summary metrics and per-type complexity details (with paging)