mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
23 lines
900 B
HTML
23 lines
900 B
HTML
<html>
|
|
<body>
|
|
Reports constructors whose number of parameters exceeds the specified maximum.
|
|
Such objects are hard to instantiate, especially if some parameters are optional.
|
|
Constructors with too many parameters may indicate that refactoring is necessary.
|
|
Consider applying the builder pattern, for example.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
public BankAccount(long accountNumber,
|
|
String owner,
|
|
double balance,
|
|
double interestRate) {
|
|
// fields initialization
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>Configure the inspection:</p>
|
|
<ul>
|
|
<li>Use the <b>Parameter limit</b> field to specify the maximum allowed number of parameters in a constructor.</li>
|
|
<li>Use the <b>Ignore constructors with visibility</b> list to specify whether the inspection should ignore constructors with specific visibility.</li>
|
|
</ul>
|
|
</body>
|
|
</html> |