Skip to content

Files

Latest commit

 

History

History
38 lines (21 loc) · 602 Bytes

SimplifyBooleanReturn.md

File metadata and controls

38 lines (21 loc) · 602 Bytes

Pattern: Use of verbose boolean return

Issue: -

Description

Checks for over-complicated boolean return statements. For example the following code:

if (valid())
    return false;
else
    return true;

could be written as:

return !valid();

This change will make the code more succinct and clear to the readers.

Default configuration

<module name="SimplifyBooleanReturn"/>

Further Reading