Query module MissedUsingOpportunity

name
Missed ‘using’ opportunity
description
C# provides a ‘using’ statement as a better alternative to manual resource disposal in a finally block - it makes sense to use it.
kind
problem
problem.severity
recommendation
precision
high
id
cs/missed-using-statement
tags
maintainability language-features

Imports

System

Provides definitions related to the namespace System.

csharp

The default C# QL library.

Classes

DisposeCall

A call to IDisposable.Dispose or a method that overrides it.