[architecture]
Analyzes cyclomatic complexity and size metrics. Select an exact member method or type with symbolKey, or use file and name filters.
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.
Try it locally in the Glider playground
| Name | Type | Required | Description |
|---|---|---|---|
| symbolKey | string | No | Exact source member method or type key from symbol discovery. Local functions are unsupported. Do not combine with typeName, filePath, or projectName. |
| 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": 1,
"totalMethods": 2,
"totalLinesOfCode": 80,
"averageComplexity": 8,
"maxComplexity": 12,
"highComplexityMethodCount": 1
},
"paging": {
"skip": 0,
"take": 50,
"total": 1,
"returned": 1,
"hasMore": false
},
"types": [
{
"name": "OrderService",
"fullName": "Acme.Orders.OrderService",
"kind": "Class",
"filePath": "/workspace/Orders/OrderService.cs",
"linesOfCode": 80,
"methodCount": 2,
"averageComplexity": 8,
"methods": [
{
"name": "SubmitOrder",
"cyclomaticComplexity": 4,
"linesOfCode": 16,
"parameterCount": 1,
"lineNumber": 10,
"filePath": "/workspace/Orders/OrderService.cs"
},
{
"name": "ValidateOrder",
"cyclomaticComplexity": 12,
"linesOfCode": 32,
"parameterCount": 1,
"lineNumber": 30,
"filePath": "/workspace/Orders/OrderService.cs"
}
]
}
]
},
"error": null
}Analyze one exact method with a key from symbol discovery
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "analyze_complexity",
"arguments": {
"symbolKey": "<method symbolKey returned by search_symbols or resolve_symbol>"
}
}
}{
"success": true,
"data": {
"summary": {
"totalTypes": 1,
"totalMethods": 1,
"totalLinesOfCode": 16,
"averageComplexity": 4,
"maxComplexity": 4,
"highComplexityMethodCount": 0
},
"paging": {
"skip": 0,
"take": 50,
"total": 1,
"returned": 1,
"hasMore": false
},
"types": [
{
"name": "OrderService",
"fullName": "Acme.Orders.OrderService",
"kind": "Class",
"filePath": "/workspace/Orders/OrderService.cs",
"linesOfCode": 16,
"methodCount": 1,
"averageComplexity": 4,
"methods": [
{
"name": "SubmitOrder",
"cyclomaticComplexity": 4,
"linesOfCode": 16,
"parameterCount": 1,
"lineNumber": 10,
"filePath": "/workspace/Orders/OrderService.cs"
}
]
}
]
},
"error": null
}Analyze a type across all partial declarations with a discovered key
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "analyze_complexity",
"arguments": {
"symbolKey": "<type symbolKey returned by search_symbols or resolve_symbol>"
}
}
}{
"success": true,
"data": {
"summary": {
"totalTypes": 1,
"totalMethods": 2,
"totalLinesOfCode": 80,
"averageComplexity": 8,
"maxComplexity": 12,
"highComplexityMethodCount": 1
},
"paging": {
"skip": 0,
"take": 50,
"total": 1,
"returned": 1,
"hasMore": false
},
"types": [
{
"name": "OrderService",
"fullName": "Acme.Orders.OrderService",
"kind": "Class",
"filePath": "/workspace/Orders/OrderService.cs",
"linesOfCode": 80,
"methodCount": 2,
"averageComplexity": 8,
"methods": [
{
"name": "SubmitOrder",
"cyclomaticComplexity": 4,
"linesOfCode": 16,
"parameterCount": 1,
"lineNumber": 10,
"filePath": "/workspace/Orders/OrderService.cs"
},
{
"name": "ValidateOrder",
"cyclomaticComplexity": 12,
"linesOfCode": 32,
"parameterCount": 1,
"lineNumber": 30,
"filePath": "/workspace/Orders/OrderService.cs"
}
]
}
]
},
"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": 1,
"totalMethods": 2,
"totalLinesOfCode": 80,
"averageComplexity": 8,
"maxComplexity": 12,
"highComplexityMethodCount": 1
},
"paging": {
"skip": 0,
"take": 50,
"total": 1,
"returned": 1,
"hasMore": false
},
"types": [
{
"name": "OrderService",
"fullName": "Acme.Orders.OrderService",
"kind": "Class",
"filePath": "/workspace/Orders/OrderService.cs",
"linesOfCode": 80,
"methodCount": 2,
"averageComplexity": 8,
"methods": [
{
"name": "ValidateOrder",
"cyclomaticComplexity": 12,
"linesOfCode": 32,
"parameterCount": 1,
"lineNumber": 30,
"filePath": "/workspace/Orders/OrderService.cs"
}
]
}
]
},
"error": null
}Returns summary metrics and a page of types. A member method key selects one exact overload; all aggregates describe that method. Explicit accessor keys select one accessor body. Position discovery uses declaration keys for constructed generic and reduced extension methods. A type key combines its partial declarations and excludes nested types. Partial methods use their implementation once.
Primary constructor metrics cover the header, base arguments, and instance initializers. Other member bodies and bodyless accessors do not contribute. Each method includes its own filePath. The type filePath identifies the first declaration. Threshold filters affect method lists and type inclusion; aggregates retain the selected scope before filtering and paging.
Bodyless accessor keys, local functions, fields, properties, namespaces, metadata symbols, implicit symbols, and conflicting selectors return errors. Obtain keys from discovery; replace the example placeholders before calling.