2021-01-27 13:42:22 +01:00
The needless repetition of an operator is usually a typo. There is no reason to write ``++!!!i++`` when ``++!i++`` will do.
2020-06-30 12:48:07 +02:00
2021-02-02 15:02:10 +01:00
2020-06-30 12:48:07 +02:00
On the other hand, the repetition of increment and decrement operators may have been done on purpose, but doing so obfuscates the meaning, and should be simplified.
2021-02-02 15:02:10 +01:00
2021-02-08 12:42:26 +01:00
This rule raises an issue for sequences of: ``++!++``, ``++^++``, ``++-++``, and ``{plus}``.
2020-06-30 12:48:07 +02:00
== Noncompliant Code Example
----
var a int = 1
var flag bool = true
var a1 int = ^^^a // Noncompliant
var flag2 bool = !!!flag // Noncompliant
----
== Compliant Solution
----
var a int = 1
var flag bool = true
var a1 int = ^a
var flag2 bool = !flag
----