Procedure Can Be Written As Function
Warns about 'Sub' procedures that could be refactored into a 'Function'.
NEW! This inspection is only available in pre-release builds.
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
QuickFixes
The following quickfixes are available for this inspection:
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.2.6174)