rspec/rules/S4225/vbnet/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

20 lines
527 B
Plaintext

== Why is this an issue?
Creating an extension method that extends ``++Object++`` is not recommended because it makes the method available on _every_ type. Extensions should be applied at the most specialized level possible, and that is very unlikely to be ``++Object++``.
=== Noncompliant code example
[source,vbnet]
----
Imports System.Runtime.CompilerServices
Module MyExtensions
<Extension>
Sub SomeExtension(obj As Object) ' Noncompliant
' ...
End Sub
End Module
----
include::../rspecator.adoc[]