rspec/rules/S107/vb6/rule.adoc

47 lines
1.0 KiB
Plaintext
Raw Normal View History

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the procedure is doing too many things.
== Noncompliant Code Example
With a maximum number of 3 parameters:
2022-02-04 17:28:24 +01:00
[source,vb6]
----
Public Sub Foo(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant
' ...
End Sub
Public Function Bar(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer, ByVal p4 As Integer) ' Noncompliant
' ...
End Function
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,vb6]
----
Public Sub Foo(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)
' ...
End Sub
Public Function Bar(ByVal p1 As Integer, ByVal p2 As Integer, ByVal p3 As Integer)
' ...
End Function
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::../parameters.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]