2020-12-21 15:38:52 +01:00
|
|
|
Reserved parameters are unnecessary in VB.NET because method overloading can be used to introduce additional variants over time.
|
|
|
|
|
2021-01-27 13:42:22 +01:00
|
|
|
This rule detects parameters which contain ``++reserved++`` in their names.
|
2020-12-21 15:38:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
Module Module1
|
|
|
|
Function Add(ByVal a As Integer, ByVal b As Integer, ByVal reserved As Integer) As Integer ' Noncompliant
|
|
|
|
Return a + b
|
|
|
|
End Function
|
|
|
|
End Module
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
Module Module1
|
|
|
|
Function Add(ByVal a As Integer, ByVal b As Integer) As Integer ' Compliant
|
|
|
|
Return a + b
|
|
|
|
End Function
|
|
|
|
End Module
|
|
|
|
----
|
|
|
|
|