- Warns about 'Sub' procedures that could be refactored into a 'Function'.
- Idiomatic VB code uses 'Function' procedures to return a single value. If the procedure isn't side-effecting, consider writing is as a
'Function' rather than a 'Sub' the returns a result through a 'ByRef' parameter.
- The following code example(s) would trigger this inspection:
Public Sub DoSomething(ByRef result As Long)
result = 42
- The following code example(s) would not trigger this inspection:
Public Function DoSomething() As Long
DoSomething = 42
Back to List