← back to index

S2761 — 'Not' boolean operator should not be repeated

Language: VB.NET  |  Type: BUG  |  Severity: Major

Why is this an issue?

The repetition of the Not operator is usually a typo. The second operator invalidates the first one:

Dim b As Boolean = False
Dim c As Boolean = Not Not b 'Noncompliant: equivalent to "b"