Manageability
Severity
Medium
Lightning
SF-0064
Impact
The else block in a if-else-construct is unnecessary if the if block contains a return. Then the content of the else block can be put outside. It creates an unnecessary block code, making readability harder.
Refactor the code, maybe moving the contents of the else block outside of the if/else statement.
For when an unnecessary catch block is detected. The else block in a if-else-construct is unnecessary if the if block contains a return. Then the content of the else block can be put outside.
/ Bad: if (x) { return y; } else { return z; } // Good: if (x) { return y; } return z;
30 min