Estimate Impact of a Change
impact_of_changeEstimate a C# symbol's change impact before editing: get direct and transitive dependents, production impact, and risk level to see what a rename or signature change could break.
Instructions
Estimate the blast radius of changing a symbol: its direct users plus their dependents, with a risk level.
Call it first, before any edit to a symbol other code names (a rename, signature, default value): a compile checks names, not what a consumer assumes.
Returns directCount and transitiveCount (one per declaration, tests included), productionImpactCount (transitive, without tests), risk and directImpact (at most 20; items {name, file, line} as in find_usages). risk reads productionImpactCount: 0 none, 1-4 low, 5-20 medium, above 20 high; it counts dependents, not what the change means. Where one cycle dominates a high closure, a 'saturation' block leads the counts and risk reads the direct production fan-in.
Per kind: a type - the closure of the types that reference it; a method or operator - its caller closure through interface and abstract dispatch; a property, field, event or enum member - the code that touches it (transitive = direct). A qualified method also counts its contracts' callers ('viaContract', as in find_usages).
An interface or abstract method or type adds 'implementers' per contract (count, testCount, typeCount, testTypeCount, members): what a signature change breaks. Then risk reads 'riskBasis'.total = closure + implementers (production implementing types; on a type only direct ones the closure lacks; 'indirect' lists those via a base class). 'namesakes' splits an entry same-named contracts share; 'riskBasis'.note flags no production caller.
A 'note' ahead of the counts flags misleading numbers: directCount 0 on a resolved symbol (DI or reflection may reach it), unresolved core references, productionImpactCount 0 on an all-test solution, and 'not_found' (risk 'none' is no measurement; 'nearest' gives a close name). 'collision' names a same-named symbol of another kind, not counted.
Read-only. symbol is case-sensitive and resolves as in find_usages: a type by its simple name, a member bare (one kind) or as 'Type.Member'. A constructor ('Type.Type') is not resolved here: use find_usages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | The exact (case-sensitive) type, method, property, field, event, enum-member or operator (metadata) name to assess - or the qualified Type.Member form for a member. | |
| sessionId | Yes | The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use. |