[references]
Finds likely-unused parameters with zero references inside their declaring method or constructor. Skips generated code and reflection-sensitive members by default.
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| scope | json | No | Optional scope used to select methods and constructors to analyze. |
| accessibility | string | No | Accessibility filter for the containing member. Default is 'Private,Internal'. |
| excludeReflectionSensitive | boolean | No | Skip parameters on reflection- or activation-sensitive members. Default is true. |
| summaryOnly | boolean | No | Return grouped summaries without the paged parameter list. Default is false. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). |
| skip | number | No | Pagination offset. Default is 0. |
| take | number | No | Pagination size. Default is 200. |
Find likely-unused private method parameters
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_parameters",
"arguments": {
"accessibility": "Private,Internal"
}
}
}{
"success": true,
"data": {
"totalCount": 1,
"paging": {
"skip": 0,
"take": 200,
"returned": 1,
"total": 1
},
"items": [
{
"parameterName": "cancellationToken",
"containingSymbol": "RefreshCacheAsync",
"containingType": "CacheService",
"filePath": "/path/to/CacheService.cs",
"lineNumber": 54,
"projectName": "MyProject"
}
],
"summary": {
"byProject": [
{
"key": "MyProject",
"count": 1
}
]
}
},
"error": null
}Summarize unused parameters in one project
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_parameters",
"arguments": {
"scope": {
"mode": "project",
"projectName": "MyProject"
},
"summaryOnly": true
}
}
}{
"success": true,
"data": {
"totalCount": 1,
"paging": {
"skip": 0,
"take": 200,
"returned": 1,
"total": 1
},
"items": [
{
"parameterName": "cancellationToken",
"containingSymbol": "RefreshCacheAsync",
"containingType": "CacheService",
"filePath": "/path/to/CacheService.cs",
"lineNumber": 54,
"projectName": "MyProject"
}
],
"summary": {
"byProject": [
{
"key": "MyProject",
"count": 1
}
]
}
},
"error": null
}Returns likely-unused parameters, optionally summarized by containing project and member kind