Return of boolean literal statements wrapped into if-then-else ones should be simplified.
Sometimes the developer will not have the time or will simply forget to get back to that tag. This rule is meant to track those tags, and ensure that they do not go unnoticed.
if (condition) {
return true;
} else {
return false;
}
return condition;
Note that if type of condition is not boolean, then double negation should be used for proper conversion:
return !!condition;