mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
30 lines
999 B
HTML
30 lines
999 B
HTML
<html>
|
|
<body>
|
|
Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:
|
|
<ul>
|
|
<li>Local variables that are immediately returned.</li>
|
|
<li>Local variables that are immediately assigned to another variable and then not used.</li>
|
|
<li>Local variables that always have the same value as another local variable or parameter.</li>
|
|
</ul>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
boolean yes() {
|
|
boolean b = true;
|
|
return b;
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
boolean yes() {
|
|
return true;
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Configure the inspection:</p>
|
|
<ul>
|
|
<li>Use the <b>Ignore immediately returned or thrown variables</b> option to ignore immediately returned or thrown variables.
|
|
Some coding styles suggest using such variables for clarity and ease of debugging.</li>
|
|
<li>Use the <b>Ignore variables which have an annotation</b> option to ignore annotated variables.</li>
|
|
</ul>
|
|
</body>
|
|
</html> |