added example for SimplifyBooleanReturn

This commit is contained in:
Lars Kühne 2003-02-17 05:21:31 +00:00
parent adcc7a14d8
commit 77d641a916
1 changed files with 17 additions and 2 deletions

View File

@ -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">