OPT.DUN
Don't use the negation operator frequently
Description
This rule flags code that uses the negation operator frequently (i.e., more than two times).
The negation operator (!) decreases the readability of the program.
Example
package OPT;
public class DUN {
boolean method (boolean a, boolean b) {
if (!a)
return !a;
else
return !b;
}
}
Repair
Do not use the negation operator if possible.
|