added example for SimplifyBooleanReturn
This commit is contained in:
parent
adcc7a14d8
commit
77d641a916
|
|
@ -301,8 +301,23 @@
|
|||
</p>
|
||||
<!-- --> <a name="SimplifyBooleanReturn"></a> <h2>SimplifyBooleanReturn</h2> <h4>Description</h4>
|
||||
<p class="body">
|
||||
Checks for overly complicated boolean return statements. Idea shamelessly stolen
|
||||
from the equivalent <a href="http://pmd.sourceforge.net">PMD rule</a>.
|
||||
Checks for overly complicated boolean return statements. For example the following code
|
||||
</p>
|
||||
<pre class="body">
|
||||
if (valid())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
</pre>
|
||||
<p class="body">
|
||||
could be written as
|
||||
<pre class="body">
|
||||
return !valid();
|
||||
</pre>
|
||||
</p>
|
||||
<p class="body">
|
||||
The Idea for this Check has been shamelessly stolen
|
||||
from the equivalent <a href="http://pmd.sourceforge.net">PMD</a> rule.
|
||||
</p>
|
||||
<h4>Example</h4>
|
||||
<p class="body">
|
||||
|
|
|
|||
Loading…
Reference in New Issue