get_complexity_metrics
Calculate complexity for members (methods, constructors, properties, indexers, operators). Reports both 'complexity' (cyclomatic - the number of paths, starts at 1) and 'cognitive' (how hard the code is to follow, starts at 0 - a 0 is not a bug), plus 'maxNesting'. The 'metric' parameter selects which of the two the threshold filters on and the sort uses. Returns an envelope with items sorted worst-first, totalCount, truncated, limit (default 100), and a summary with max/avg/overThreshold plus maxCognitive.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Optional project name filter | |
threshold | int | Minimum complexity threshold, applied to the selected metric (default: 10) | |
metric | string | Which metric drives the threshold and the sort: 'cyclomatic' (default) or 'cognitive'. Both are always reported. | |
limit | int? | Maximum number of items to return (default: 100). Items are sorted by the selected metric desc (worst first). |