mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-27 23:52:23 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
31 lines
737 B
HTML
31 lines
737 B
HTML
<html>
|
|
<body>
|
|
Reports <code>if</code> statements in which common parts can be extracted from the branches.
|
|
<p>These common parts are independent from the condition and make <code>if</code> statements harder to understand.</p>
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
if (x > 12) {
|
|
doSomethingBefore();
|
|
doSomethingDifferent1();
|
|
doSomethingAfter();
|
|
} else {
|
|
doSomethingBefore();
|
|
doSomethingDifferent2();
|
|
doSomethingAfter();
|
|
}
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
doSomethingBefore();
|
|
if (x > 12) {
|
|
doSomethingDifferent1();
|
|
} else {
|
|
doSomethingDifferent2();
|
|
}
|
|
doSomethingAfter();
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p><small>Updated in 2018.1</small></p>
|
|
</body>
|
|
</html>
|