rspec/rules/S4136/vbnet/rule.adoc
2022-02-04 16:28:24 +00:00

62 lines
1.3 KiB
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,vbnet]
----
Interface IMyInterface
Function DoTheThing() As Integer
Function DoTheOtherThing() As String // Noncompliant
Function DoTheThing(ByVal Path As String) As Integer
End Interface
----
== Compliant Solution
[source,vbnet]
----
Interface IMyInterface
Function DoTheThing() As Integer
Function DoTheThing(ByVal Path As String) As Integer
Function DoTheOtherThing() As String
End Interface
----
== Exceptions
As it is common practice to group method declarations by implemented interface, no issue will be raised for interface implementations if grouped together with other members of that interface.
As it is also a common practice to group method declarations by accessibility level, no issue will be raised for method overloads having different access modifiers.
Example:
----
Class MyClass
Private Sub DoTheThing(s As String) ' Ok - this method is declared as Private while the other one is Public
' ...
End Sub
Private Sub DoTheOtherThing(s As String)
' ...
End Sub
Public Sub DoTheThing()
' ...
End Sub
End Class
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
endif::env-github,rspecator-view[]