Inspectopedia
 
2024.3

Redundant 'if' statement

Warning
New
Last modified: 03 December 2024

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

Example:

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

return foo();