-
Notifications
You must be signed in to change notification settings - Fork 301
ImplicitByRefParameterInspection
Description: Parameter is passed ByRef implicitly
Type: CodeInspectionType.CodeQualityIssues
Default severity: CodeInspectionSeverity.Warning
This inspection finds procedure parameters that are implicitly passed by reference.
Parameter foo
is implicitly passed ByRef
in this method signature:
Public Sub DoSomething(foo As Integer)
End Sub
This code is potentially confusing, because it assumes the maintainer knows VBA passes parameter ByRef
by default. Other languages, including VB.NET, pass parameters by value by default.
QuickFix: Pass parameter by reference explicitly
Public Sub DoSomething(ByRef foo As Integer)
End Sub
By explicitly specifying a parameter is passed by reference, there is no possible ambiguity and the maintainer knows how the parameter is passed, regardless of their knowledge of VBA.
rubberduckvba.com
© 2014-2021 Rubberduck project contributors
- Contributing
- Build process
- Version bump
- Architecture Overview
- IoC Container
- Parser State
- The Parsing Process
- How to view parse tree
- UI Design Guidelines
- Strategies for managing COM object lifetime and release
- COM Registration
- Internal Codebase Analysis
- Projects & Workflow
- Adding other Host Applications
- Inspections XML-Doc
-
VBE Events