Inspectopedia Help

Redundant 'if' statement

Reports an if statement that can be simplified to a single assignment or a return statement.

Example:

if(foo()) { return true; } else { return false; }

After applying the quick-fix the code looks as follows:

return foo();

Last modified: 29 April 2024