find_disposable_misuse
Detect IDisposable and IAsyncDisposable instances at risk of leaking in method bodies. Returns a summary with per-violation details including severity, location, containing method, and code snippet.
Instructions
Detect IDisposable / IAsyncDisposable instances at risk of leaking. Two patterns: local variables holding a disposable that aren't wrapped in using/await using/returned/assigned-to-field-or-out-parameter (warning), and bare-expression-statement discards of a disposable creator/factory (error). Returns a summary plus a per-violation list (severity error/warning, location, containing method, snippet). Skips test projects and generated code. Scope: methods only (not constructors/accessors/operators); ownership transfer via method/constructor argument is not detected. Static analysis only — no fix suggestions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||