Skip to content

Commit

Permalink
Deploying to gh-pages from @ f96f4c8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianAmbrosini committed Dec 23, 2024
1 parent f380789 commit eea6fef
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 27 deletions.
60 changes: 47 additions & 13 deletions rules/S2930/csharp-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,56 @@ <h2 id="_why_is_this_an_issue">Why is this an issue?</h2>
<p>This rule keeps track of <code>private</code> fields and local variables of specific types that implement <code>IDisposable</code> or <code>IAsyncDisposable</code>. It identifies instances of these types that are not properly disposed, closed, aliased, returned, or passed to other methods. This applies to instances that are either directly created using the <code>new</code> operator or instantiated through a predefined list of factory methods.</p>
</div>
<div class="paragraph">
<p>Here is the list of predefined factory methods tracked by this rule:</p>
<p>Here is the list of the types tacked by this rule:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>System.IO.File.Create()</code></p>
<p><code>FluentAssertions.Execution.AssertionScope</code></p>
</li>
<li>
<p><code>System.IO.File.Open()</code></p>
<p><code>System.Drawing.Bitmap</code></p>
</li>
<li>
<p><code>System.Drawing.Image</code></p>
</li>
<li>
<p><code>System.IO.FileStream</code></p>
</li>
<li>
<p><code>System.IO.StreamReader</code></p>
</li>
<li>
<p><code>System.IO.StreamWriter</code></p>
</li>
<li>
<p><code>System.Net.Sockets.TcpClient</code></p>
</li>
<li>
<p><code>System.Net.Sockets.UdpClient</code></p>
</li>
<li>
<p><code>System.Net.WebClient</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Here is the list of predefined factory methods tracked by this rule:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>System.Drawing.Image.FromFile()</code></p>
</li>
<li>
<p><code>System.Drawing.Image.FromStream()</code></p>
</li>
<li>
<p><code>System.IO.File.Create()</code></p>
</li>
<li>
<p><code>System.IO.File.Open()</code></p>
</li>
</ul>
</div>
<div class="sect2">
Expand Down Expand Up @@ -143,38 +177,38 @@ <h3 id="_documentation">Documentation</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/managed-code">What is "managed code"?</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/managed-code">What is "managed code"?</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection">Garbage collection</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection">Garbage collection</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers">Finalizers</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers">Finalizers</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code">Unsafe code, pointer types, and function pointers</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code">Unsafe code, pointer types, and function pointers</a></p>
</li>
<li>
<p><a href="https://en.wikipedia.org/wiki/File_descriptor">File descriptor - Wiki</a></p>
<p>Wikipedia - <a href="https://en.wikipedia.org/wiki/File_descriptor">File descriptor</a></p>
</li>
<li>
<p><a href="https://en.wikipedia.org/wiki/Network_socket">Network socket - Wiki</a></p>
<p>Wikipedia - <a href="https://en.wikipedia.org/wiki/Network_socket">Network socket</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern">Dispose pattern</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern">Dispose pattern</a></p>
<div class="ulist">
<ul>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose">Implement a Dispose method</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose">Implement a Dispose method</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync">Implement a DisposeAsync method</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync">Implement a DisposeAsync method</a></p>
</li>
</ul>
</div>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using">using statement and using declaration</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using">using statement and using declaration</a></p>
</li>
<li>
<p>CWE - <a href="https://cwe.mitre.org/data/definitions/459">CWE-459 - Incomplete Cleanup</a></p>
Expand Down
60 changes: 47 additions & 13 deletions rules/S2930/default-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,56 @@ <h2 id="_why_is_this_an_issue">Why is this an issue?</h2>
<p>This rule keeps track of <code>private</code> fields and local variables of specific types that implement <code>IDisposable</code> or <code>IAsyncDisposable</code>. It identifies instances of these types that are not properly disposed, closed, aliased, returned, or passed to other methods. This applies to instances that are either directly created using the <code>new</code> operator or instantiated through a predefined list of factory methods.</p>
</div>
<div class="paragraph">
<p>Here is the list of predefined factory methods tracked by this rule:</p>
<p>Here is the list of the types tacked by this rule:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>System.IO.File.Create()</code></p>
<p><code>FluentAssertions.Execution.AssertionScope</code></p>
</li>
<li>
<p><code>System.IO.File.Open()</code></p>
<p><code>System.Drawing.Bitmap</code></p>
</li>
<li>
<p><code>System.Drawing.Image</code></p>
</li>
<li>
<p><code>System.IO.FileStream</code></p>
</li>
<li>
<p><code>System.IO.StreamReader</code></p>
</li>
<li>
<p><code>System.IO.StreamWriter</code></p>
</li>
<li>
<p><code>System.Net.Sockets.TcpClient</code></p>
</li>
<li>
<p><code>System.Net.Sockets.UdpClient</code></p>
</li>
<li>
<p><code>System.Net.WebClient</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Here is the list of predefined factory methods tracked by this rule:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>System.Drawing.Image.FromFile()</code></p>
</li>
<li>
<p><code>System.Drawing.Image.FromStream()</code></p>
</li>
<li>
<p><code>System.IO.File.Create()</code></p>
</li>
<li>
<p><code>System.IO.File.Open()</code></p>
</li>
</ul>
</div>
<div class="sect2">
Expand Down Expand Up @@ -143,38 +177,38 @@ <h3 id="_documentation">Documentation</h3>
<div class="ulist">
<ul>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/managed-code">What is "managed code"?</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/managed-code">What is "managed code"?</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection">Garbage collection</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection">Garbage collection</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers">Finalizers</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/finalizers">Finalizers</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code">Unsafe code, pointer types, and function pointers</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code">Unsafe code, pointer types, and function pointers</a></p>
</li>
<li>
<p><a href="https://en.wikipedia.org/wiki/File_descriptor">File descriptor - Wiki</a></p>
<p>Wikipedia - <a href="https://en.wikipedia.org/wiki/File_descriptor">File descriptor</a></p>
</li>
<li>
<p><a href="https://en.wikipedia.org/wiki/Network_socket">Network socket - Wiki</a></p>
<p>Wikipedia - <a href="https://en.wikipedia.org/wiki/Network_socket">Network socket</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern">Dispose pattern</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern">Dispose pattern</a></p>
<div class="ulist">
<ul>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose">Implement a Dispose method</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose">Implement a Dispose method</a></p>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync">Implement a DisposeAsync method</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync">Implement a DisposeAsync method</a></p>
</li>
</ul>
</div>
</li>
<li>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using">using statement and using declaration</a></p>
<p>Microsoft Learn - <a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/using">using statement and using declaration</a></p>
</li>
<li>
<p>CWE - <a href="https://cwe.mitre.org/data/definitions/459">CWE-459 - Incomplete Cleanup</a></p>
Expand Down
2 changes: 1 addition & 1 deletion rules/rule-index.json

Large diffs are not rendered by default.

0 comments on commit eea6fef

Please sign in to comment.