The needless repetition of an operator is usually a typo. After all, why write ``++!!!i++`` when ``++!i++`` will do?


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.


This rule raises an issue for sequences of: ``++!++``, ``++~++``, ``++-++``, and ``+``, and in {cpp} for repetitions of the increment and decrement operators.

== Noncompliant Code Example

----
int i = 1;

int j = - - -i;  // Noncompliant; just use -i
int k = ~~i;     // Noncompliant; same as i
int m = + +i;    // Noncompliant; operators are useless here

bool b = false;
bool c = !!!b;   // Noncompliant
----

== Compliant Solution

----
int i =  1;

int j = -i;
int k =  i;
int m =  i;

bool b = false;
bool c = !b;
----

== Exceptions

Boolean normalization ``++!!++`` is ignored.

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
