S1110 — Redundant pairs of parentheses should be removed

Language
VB.NET
Type
Code smell
Severity
Major
Tags
confusing

Why is this an issue?

The use of parentheses, even those not required to enforce a desired order of operations, can clarify the intent behind a piece of code. However, redundant pairs of parentheses could be misleading and should be removed.

Noncompliant code example


If a AndAlso ((x + y > 0)) Then ' Noncompliant
    ' ...
End If

Return ((x + 1))  ' Noncompliant

Compliant solution


If a AndAlso x + y > 0 Then
    ' ...
End If

Return x + 1

↑ Back to top