mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
38 lines
2.2 KiB
HTML
38 lines
2.2 KiB
HTML
<html>
|
|
<body>
|
|
Reports classes, methods, or fields that are not used or unreachable from the entry points.
|
|
<p> An entry point can be a main method, tests, classes from outside the specified scope, classes accessible from
|
|
<code>module-info.java</code>, and so on. It is possible to configure custom entry points by using name patterns or annotations.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
public class Department {
|
|
private Organization myOrganization;
|
|
}
|
|
</code></pre>
|
|
<p>In this example, <code>Department</code> explicitly references <code>Organization</code> but if <code>Department</code> class itself is unused, then inspection will report both classes. </p>
|
|
<p>
|
|
The inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local
|
|
variables that are declared but not used.
|
|
</p>
|
|
<p>
|
|
<b>Note:</b> Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is
|
|
checked only when its name rarely occurs in the project.
|
|
To see all results, run the inspection by selecting <b>Code | Inspect Code</b> or <b>Code | Analyze Code | Run Inspection by Name</b> from the main menu.
|
|
</p>
|
|
|
|
<!-- tooltip end -->
|
|
<p>Use the visibility settings below to configure members to be reported. For example, configuring report <code>private</code> methods only means
|
|
that <code>public</code> methods of <code>private</code> inner class will be reported but <code>protected</code> methods of top level class
|
|
will be ignored.</p>
|
|
<p>
|
|
Use the <b>entry points</b> tab to configure entry points to be considered during the inspection run.</p>
|
|
<p> You can add entry points manually when inspection results are ready.</p>
|
|
<p> If your code uses unsupported frameworks, there are several options:</p>
|
|
<ul>
|
|
<li>If the framework relies on annotations, use the <b>Annotations...</b> button to configure the framework's annotations.</li>
|
|
<li>If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.</li>
|
|
</ul>
|
|
<p>This way the annotated code accessible by the framework internals will be treated as used.</p>
|
|
</body>
|
|
</html> |