S1197 — Array designators "()" should be on the type, not the variable

Language
VB.NET
Type
Code smell
Severity
Minor
Tags
convention

Why is this an issue?

Array designators should always be located on the type for better code readability. Otherwise, developers must look both at the type and the variable name to know whether or not a variable is an array.

Noncompliant code example


Module Module1
    Sub Main()
        Dim foo() As String ' Noncompliant
    End Sub
End Module

Compliant solution


Module Module1
    Sub Main()
        Dim foo As String() ' Compliant
    End Sub
End Module

↑ Back to top