All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.squidjava.rules.squid.AssignmentInSubExpressionCheck.html Maven / Gradle / Ivy

Assignments within sub-expressions are hard to spot and therefore make the code less readable. It is also a common mistake to write = when == was meant. Ideally, expressions should not have side-effects.

The following code:

System.out.println(i = 42);  // Non-Compliant

should be refactored into:

System.out.println(i == 42); // Compliant

or:

i = 42;
System.out.println(i);       // Compliant




© 2015 - 2025 Weber Informatics LLC | Privacy Policy