Procedure Can Be Written As Function
Warns about 'Sub' procedures that could be refactored into a 'Function'.
Reasoning
Idiomatic VB code uses 'Function' procedures to return a single value. If the procedure isn't side-effecting, consider writing it as a 'Function' rather than a 'Sub' that returns a result through a 'ByRef' parameter.
Default severity
Suggestion
Inspection type
LanguageOpportunities
Examples
This example should trigger a result
This example should NOT trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.ProcedureCanBeWrittenAsFunctionInspection.cs (Prerelease-v2.5.9.6289)