Multiple Declarations

Flags declaration statements declaring multiple variables.

Reasoning

Declaration statements should generally declare a single variable. Although this inspection does not take variable types into account, it is a common mistake to only declare an explicit type on the last variable in a list.

Default severity

Warning

Inspection type

NamingAndConventionsIssues

Examples

This example should trigger a result

MyModule (StandardModule)
'note: RowNumber is untyped / implicitly Variant Dim RowNumber, ColumnNumber As Long

This example should trigger a result

MyModule (StandardModule)
Dim RowNumber As Long, ColumnNumber As Long

This example should NOT trigger a result

MyModule (StandardModule)
Dim RowNumber As Long Dim ColumnNumber As Long

Rubberduck.CodeAnalysis.Inspections.Concrete.MultipleDeclarationsInspection.cs (Prerelease-v2.5.9.6289)