Proofread Java inspections descriptions

GitOrigin-RevId: 352695336e5bd2c98d12db45afae9311f7705d05
This commit is contained in:
Aleksandra Zolushkina
2021-06-18 10:42:28 +03:00
committed by intellij-monorepo-bot
parent d74d1f14cb
commit 8edbbd9016
41 changed files with 273 additions and 356 deletions

View File

@@ -1,21 +1,20 @@
<html>
<body>
Reports any attempt to return or assign an array, <code>Collection</code>, <code>Date</code>, <code>Map</code>,
Reports an attempt to return or assign an array or a <code>Collection</code>, <code>Date</code>, <code>Map</code>,
<code>Calendar</code>, etc. field from a method parameter.
Since such types are mutable, this construct may
result in an object having its state modified unexpectedly from outside the owning class.
While occasionally useful for performance reasons, this construct is inherently bug prone. Quick-fix adds a call to the field's <code>.clone()</code> method.
<p>The inspection reports usage of following mutable types:
<ul>
<p>Because such types are mutable, this construct may
result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for
performance reasons, it is inherently prone to bugs.</p>
<p>The following mutable types are reported:</p>
<ul>
<li><code>java.util.Date</code></li>
<li><code>java.util.Calendar</code></li>
<li><code>java.util.Collection</code></li>
<li><code>java.util.Map</code></li>
<li><code>com.google.common.collect.Multimap</code></li>
<li><code>com.google.common.collect.Table</code></li>
</ul>
</p>
</ul>
<p>The quick-fix adds a call to the field's <code>.clone()</code> method.</p>
<p><b>Example:</b></p>
<pre><code>
class Log {
@@ -39,8 +38,8 @@ While occasionally useful for performance reasons, this construct is inherently
}
</code></pre>
<!-- tooltip end -->
<p>Use the checkbox below to ignore assignments and returns in <code>private</code> methods.
<p>Use the <b>Ignore assignments in and returns from private methods</b> option to ignore assignments and returns in <code>private</code> methods.
<p><small>New in 2017.3</small>
<!--<p><small>New in 2017.3</small>-->
</body>
</html>

View File

@@ -1,23 +1,21 @@
<html>
<body>
Reports <code>catch</code> clauses
which catch inappropriate exceptions. Some exceptions, for instance
<code>java.lang.NullPointerException</code> and
<code>java.lang.IllegalMonitorStateException</code> represent programming errors
and so should almost certainly not be caught in production code.
Reports a <code>catch</code> clause
that catches an inappropriate exception.
<p>Some exceptions, for example
<code>java.lang.NullPointerException</code> or
<code>java.lang.IllegalMonitorStateException</code>, represent programming errors
and therefore almost certainly should not be caught in production code.
<p><b>Example:</b></p>
<pre>
<pre><code>
try {
return component.getMousePosition(true) != null;
}
catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught
return false;
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the list below to specify which exceptions should be flagged by this inspection.
<p>
<p>Use the <b>Prohibited exceptions</b> list to specify which exceptions should be reported.<p>
</body>
</html>

View File

@@ -1,17 +1,17 @@
<html>
<body>
Reports inappropriate exceptions declared by methods. One use of this inspection would be to warn of
<code>throws</code> clauses which declare overly generic exceptions (e.g. <code>java.lang.Exception</code> or <code>java.lang.Throwable</code>).
Reports a method that declares an inappropriate exception, such as
a <code>throws</code> clause that declares an overly generic exception (for example <code>java.lang.Exception</code> or <code>java.lang.Throwable</code>).
<p><b>Example:</b></p>
<pre>
<pre><code>
void describeModule(String module) throws Exception {} // warning: Prohibited exception 'Exception' declared
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the list below to specify which exceptions should be flagged by this inspection.
<p>
Use the checkbox below to ignore exceptions declared on methods which override a library method.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Prohibited exceptions</b> list to specify which exceptions should be reported.</li>
<li>Use the <b>Ignore exceptions declared on methods overriding a library method</b> option to ignore exceptions declared by methods
that override a library method.</li>
</ul>
</body>
</html>

View File

@@ -1,21 +1,17 @@
<html>
<body>
Reports <code>throw</code> statements
which throw inappropriate exceptions. One use of this inspection would be to warn of
<code>throw</code> statements which throw overly generic exceptions
(e.g. <code>java.lang.Exception</code> or <code>java.io.IOException</code>).
Reports a <code>throw</code> statement
that throws an inappropriate exception, for example an overly generic one, such as
<code>java.lang.Exception</code> or <code>java.io.IOException</code>.
<p><b>Example:</b></p>
<pre>
<pre><code>
void setup(Mode mode) {
if (mode == null)
throw new RuntimeException("Problem during setup"); // warning: Prohibited exception 'RuntimeException' thrown
...
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the list below to specify which exceptions should be flagged by this inspection.
<p>
<p>Use the <b>Prohibited exceptions</b> list to specify which exceptions should be reported.<p>
</body>
</html>

View File

@@ -1,14 +1,12 @@
<html>
<body>
Reports checked exception classes (i.e. subclasses of <code>java.lang.Exception</code> which are
not also subclasses of <code>java.lang.RuntimeException</code>). Certain coding standards require that all user-defined exception
classes be unchecked.
Reports checked exception classes (that is, subclasses of <code>java.lang.Exception</code> that are
not subclasses of <code>java.lang.RuntimeException</code>).
<p>Some coding standards suppress checked user-defined exception classes.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
class IllegalMoveException extends Exception {}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,17 +1,10 @@
<html>
<body>
Reports any class which:
<ul>
<li>doesn't depend on any other class in its package</li>
<li>depends on classes from another package</li>
<li>is a dependency only for classes from this other package</li>
</ul>
<p>
Such class could be moved into the package on which it depends.
Reports a class that doesn't depend on any other class in its package, depends on classes from another package, and itself is a dependency
only for classes from this other package.
<p>Consider moving such a class to the package on which it depends.</p>
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
</body>
</html>

View File

@@ -1,16 +1,9 @@
<html>
<body>
Reports any class which:
<ul>
<li>doesn't depend on any other class in its package</li>
<li>is not a dependency for any other class in its package</li>
</ul>
Such classes are an indication of ad-hoc or incoherent packaging strategies,
and may often profitably be moved.
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
Reports a class that doesn't depend on any other class in its package and is not a dependency for any other class in its package.
<p>Such classes indicate ad-hoc or incoherent packaging strategies and often may be profitably moved.
<!-- tooltip end -->
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
</body>
</html>

View File

@@ -1,22 +1,17 @@
<html>
<body>
Reports methods that have too high a cyclomatic complexity. Cyclomatic
complexity is a measurement of the number of branching points in a method. Methods with too high
cyclomatic complexity may be confusing and difficult to test.
<p>
A branch point is:
Reports a method that has too many branch points.
<p>A branch point is one of the following:</p>
<ul>
<li>loop statement</li>
<li>if statement</li>
<li><code>if</code> statement</li>
<li>ternary expression</li>
<li>catch section</li>
<li>expression with one or more <code>&&</code> or <code>||</code> operators in it</li>
<li>switch block with non-default branches</li>
<li><code>catch</code> section</li>
<li>expression with one or more <code>&&</code> or <code>||</code> operators inside</li>
<li><code>switch</code> block with non-default branches</li>
</ul>
<p>Methods with too high cyclomatic complexity may be confusing and hard to test.</p>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum cyclomatic complexity a method is allowed to have.
<p>
<p>Use the <b>Method complexity limit</b> field to specify the maximum allowed cyclomatic complexity for a method.<p>
</body>
</html>

View File

@@ -1,11 +1,9 @@
<html>
<body>
Reports any packages whose classes can be separated into mutually independent subsets.
Such disjoint packages are a symptom of ad-hoc packaging, and may indicate a lack of conceptual cohesion.
Reports a package whose classes can be separated into mutually independent subsets.
<p>Such disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion.</p>
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
</body>
</html>

View File

@@ -1,13 +1,10 @@
<html>
<body>
Reports empty directories.
Reports an empty directory.
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
<p>
Use the checkbox below to have this inspection only report directories under source roots.
<p>
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
<p>Use the <b>Only report empty directories located under a source folder</b> option to have only directories under the source
roots reported.<p>
</body>
</html>

View File

@@ -1,20 +1,18 @@
<html>
<body>
Reports <code>try</code> statements which catch
<code>java.lang.Error</code> or any subclass and which do not rethrow the error.
Statements which catch <code>java.lang.ThreadDeath</code> are not
reported by this inspection.
Reports a <code>try</code> statement that catches
<code>java.lang.Error</code> or any of its subclasses and does not rethrow the error.
<p>Statements that catch <code>java.lang.ThreadDeath</code> are not
reported.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
try {
executeTests(request);
}
catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown
return false;
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,27 +1,26 @@
<html>
<body>
Reports exceptions constructed and thrown
from inside <code>catch</code> blocks, which do not "wrap" the caught
exception. It is considered good practice when throwing an exception in response to an exception
to wrap the initial exception, so that valuable context information
such as stack frames and line numbers are not lost.
Reports an exception that is constructed and thrown
from a <code>catch</code> block that does not "wrap" the caught
exception.
<p>When an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,
such as stack frames and line numbers.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
...
catch (IOException e) {
closeAllConnections();
throw new ConnectException("Connection problem."); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the first checkbox below to indicate if the inspection should ignore exceptions which
receive the result of a method call on the original exception, such as <code>getMessage()</code>,
as an argument.
<p>
Use the second checkbox below to have this inspection ignore <code>throw</code> statements which throw exceptions which do not have a
constructor which accepts a <code>Throwable</code> cause.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Ignore if result of exception method call is used</b> option to indicate whether the inspection should ignore exceptions whose
argument is the result of a method
call on the original exception, such as <code>getMessage()</code>.</li>
<li>Use the <b>Ignore if thrown exception cannot wrap an exception</b> option to ignore <code>throw</code> statements that throw exceptions without a
constructor that accepts a <code>Throwable</code> cause.</li>
</ul>
</body>
</html>

View File

@@ -1,13 +1,11 @@
<html>
<body>
Report packages which contain only classes extending <b>java.lang.Throwable</b>, either directly or indirectly.
Although exceptions usually don't depend on other classes for their implementation, they are normally not used separately.
It is often a better design to locate exceptions in the same package as the classes that use them.
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
<p><small>New in 2017.3</small>
Reports a package only with classes that extend <code>java.lang.Throwable</code>, either directly or indirectly.
<p>Although exceptions usually don't depend on other classes for their implementation, they are normally not used separately.
It is often a better design to locate exceptions in the same package as the classes that use them.</p>
<!-- tooltip end -->
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
<!--<p><small>New in 2017.3</small>-->
</body>
</html>

View File

@@ -1,16 +1,14 @@
<html>
<body>
Reports any classes which directly extend <code>java.lang.Throwable</code>.
It is generally considered bad practice to extend <code>java.lang.Throwable</code> directly and
it is usually enough to extend either <code>java.lang.RuntimeException</code> or <code>java.lang.Exception</code> or in special
cases <code>java.lang.Error</code>.
Reports a class that directly extends <code>java.lang.Throwable</code>.
<p>Extending <code>java.lang.Throwable</code> directly is generally considered bad practice.
It is usually enough to extend <code>java.lang.RuntimeException</code>, <code>java.lang.Exception</code>, or - in special
cases - <code>java.lang.Error</code>.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'
</pre>
</code></pre>
<!-- tooltip end -->
<p>
<small>New in 15</small>
<p>
<!--<p><small>New in 15</small><p>-->
</body>
</html>

View File

@@ -1,10 +1,10 @@
<html>
<body>
Reports any <code>instanceof</code> expressions on <code>catch</code> block parameters.
Testing the type of <code>catch</code> parameters is usually better done by having separate
<code>catch</code> blocks, rather than <code>instanceof</code>.
Reports cases in which an <code>instanceof</code> expression is used for testing the type of a parameter in a <code>catch</code> block.
<p>Testing the type of <code>catch</code> parameters is usually better done by having separate
<code>catch</code> blocks instead of using <code>instanceof</code>.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
void foo(Runnable runnable) {
try {
runnable.run();
@@ -14,9 +14,7 @@ Testing the type of <code>catch</code> parameters is usually better done by havi
}
}
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,17 +1,13 @@
<html>
<body>
Reports methods which are highly coupled, i.e. that reference too many other classes.
Methods with too high coupling can be very fragile, and should probably be broken up.
<p>
Note: every referenced class is counted only once no matter how many times it was referenced.
<!-- tooltip end -->
<p>
Use the field below to specify the maximum coupling a method is allowed to have.
<p>
Use the first checkbox below to count references to classes from <code>java</code>or <code>javax</code> packages
<p>
Use the second checkbox below to count references to third-party library classes
<p>
Reports a method that references too many other classes. Each referenced class is counted only once no matter how many times it is referenced.
<p>Methods with too high coupling can be very fragile and should be probably split into smaller methods.<p>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Method coupling limit</b> field to specify the maximum allowed coupling for a method.</li>
<li>Use the <b>Include couplings to java system classes</b> option to count references to classes from <code>java</code>or <code>javax</code> packages.</li>
<li>Use the <b>Include couplings to library classes</b> option to count references to third-party library classes.</li>
</ul>
</body>
</html>

View File

@@ -1,7 +1,8 @@
<html>
<body>
Reports methods that contain more than one loop statement.
<p>For example, this method contains two loops so it will be reported:</p>
Reports a method that contains more than one loop statement.
<p><b>Example:</b></p>
<p>The method below will be reported because it contains two loops:</p>
<pre><code>
void methodWithTwoLoops(int n1, int n2) {
for (int i = 0; i &lt; n1; i++) {
@@ -15,7 +16,7 @@ Reports methods that contain more than one loop statement.
}
}
</code></pre>
<p>This method will also be reported, since it contains a nested loop:</p>
<p>The following method will also be reported because it contains a nested loop:</p>
<pre><code>
void methodWithNestedLoop(int n1, int n2) {
for (int i = 0; i &lt; n1; i++) {

View File

@@ -1,9 +1,12 @@
<html>
<body>
Reports methods with too many <code>return</code> points. Methods with too many <code>return</code> points may be confusing,
and hard to refactor. A <code>return</code> point is either a <code>return</code> statement or the falling through the bottom of a
<code>void</code> method or constructor.
<p>For example, such method is reported if inspection allows only two <code>return</code> statement:</p>
Reports a method where the number of <code>return</code> points exceeds the specified maximum.
<p>A <code>return</code> point is either a <code>return</code> statement or a falling through the bottom of a
<code>void</code> method or constructor.</p>
<p>Methods with too many <code>return</code> points may be confusing
and hard to refactor.</p>
<p><b>Example:</b></p>
<p>The method below is reported if only two <code>return</code> statements are allowed:</p>
<pre><code>
void doSmth(User[] users) {
for (User user : users) {
@@ -19,7 +22,7 @@ and hard to refactor. A <code>return</code> point is either a <code>return</code
}
}
</code></pre>
<p>And it could be rewritten in an easier to understand way:</p>
<p>Consider rewriting the method so it becomes easier to understand:</p>
<pre><code>
void doSmth(User[] users) {
for (User user : users) {
@@ -31,14 +34,12 @@ and hard to refactor. A <code>return</code> point is either a <code>return</code
}
</code></pre>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum number of <code>return</code> points a method is allowed to have.
<p>
Use the first checkbox below to ignore guard clauses.
A guard clause is an <code>if</code> statement that contains only a <code>return</code> statement
<p>
Use the second checkbox below to ignore <code>return</code> points inside <code>equals()</code> methods.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Return point limit</b> field to specify the maximum allowed number of <code>return</code> points for a method.</li>
<li>Use the <b>Ignore guard clauses</b> option to ignore guard clauses.
A guard clause is an <code>if</code> statement that contains only a <code>return</code> statement</li>
<li>Use the <b>Ignore for 'equals()' methods</b> option to ignore <code>return</code> points inside <code>equals()</code> methods.</li>
</ul>
</body>
</html>

View File

@@ -1,10 +1,9 @@
<html>
<body>
Reports nested <code>try</code> statements. Nested <code>try</code> statements
may result in confusing code, and should probably have their <code>catch</code> and <code>finally</code> sections
merged.
<!-- tooltip end -->
<p>
Reports a nested <code>try</code> statement.
<p>Nested <code>try</code> statements
may result in unclear code and should probably have their <code>catch</code> and <code>finally</code> sections
merged.
<!-- tooltip end -->
</body>
</html>

View File

@@ -1,11 +1,9 @@
<html>
<body>
Reports methods whose bodies are too deeply nested. Methods with too much statement
nesting may be confusing, and are a good sign that refactoring may be necessary.
Reports a method where the number of nested statements in the method's body exceeds the specified maximum.
<p>Methods with too deep statement
nesting may be confusing and are a good sign that refactoring may be necessary.</p>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum nesting depth a method is allowed to have.
<p>
<p>Use the <b>Nesting depth limit</b> field to specify the maximum allowed nesting depth for a method.<p>
</body>
</html>

View File

@@ -1,11 +1,12 @@
<html>
<body>
Reports exception instance creation without any arguments specified. When an exception is constructed
without arguments it contains no information about the fault that happened, which makes debugging needlessly hard.
Reports creation of a exception instance without any arguments specified.
<p>When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes
debugging needlessly hard.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
throw new IOException(); // warning: exception without arguments
</pre>
</code></pre>
<!-- tooltip end -->
</body>
</html>

View File

@@ -1,21 +1,17 @@
<html>
<body>
Reports methods that have too many statements.
Methods that have too many statements may be confusing, and are a good sign that refactoring is necessary.
<p>
Note: all statements except the following are counted:
Reports a method where the number of statements exceeds the specified maximum.
<p>Methods with too many statements may be confusing and are a good sign that refactoring is necessary.</p>
<p>The following statements are not counted:</p>
<ul>
<li>empty statements (semicolon)</li>
<li>empty statements (semicolons)</li>
<li>block statements</li>
<li>for loop initialization statement i.e. in <code>for(int i = ...;...)</code>
statement <code>int i = ...</code> is not counted</li>
<li>for loop update statement i.e. in <code>for(int i = ...;...; i += 2)</code>
statement <code>i += 2</code> is not counted</li>
<li><code>for</code> loop initialization statements, that is, <code>int i = ...</code> within a <code>for(int i = ...;...)</code>
statement</li>
<li><code>for</code> loop update statements, that is, <code>i += 2</code> within a <code>for(int i = ...;...; i += 2)</code>
statement</li>
</ul>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum number of statements a method is allowed to have.
<p>
<p>Use the <b>Maximum statements per method</b> field to specify the maximum allowed number of statements in a method.<p>
</body>
</html>

View File

@@ -1,16 +1,15 @@
<html>
<body>
Reports any fields on subclasses of <code>java.lang.Exception</code> which are not declared as
<code>final</code>. Data on exception objects should not be modified,
as it may result in loss of error context for later debugging and logging.
Reports a field in a subclass of <code>java.lang.Exception</code> that is not declared
<code>final</code>.
<p>Data on exception objects should not be modified
because this may result in loosing the error context for later debugging and logging.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
public class EditorException extends Exception {
private String message; // warning: Non-final field 'message' of exception class
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,8 +1,7 @@
<html>
<body>
Reports any <code>null</code> literals which are used as the argument for a <code>throw</code> statement.
This would produce <code>java.lang.NullPointerException</code> which usually should not be thrown programmatically.
Reports a <code>null</code> literal that is used as the argument of a <code>throw</code> statement.
<p>Such constructs produce <code>java.lang.NullPointerException</code> that usually should not be thrown programmatically.</p>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,21 +1,18 @@
<html>
<body>
Reports lambda expressions that are too long.
Lambda expressions that are too long may be confusing, and it is often better to extract the statements into their own method.
<p>
Note: all statements except the following are counted:
Reports a lambda expression where the number of statements exceeds the specified maximum.
<p>Lambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method.<p>
<p>The following statements are not counted:</p>
<ul>
<li>empty statements (semicolon)</li>
<li>empty statements (semicolons)</li>
<li>block statements</li>
<li>for loop initialization statement i.e. in <code>for(int i = ...;...)</code>
statement <code>int i = ...</code> is not counted</li>
<li>for loop update statement i.e. in <code>for(int i = ...;...; i += 2)</code>
statement <code>i += 2</code> is not counted</li>
<li><code>for</code> loop initialization statements, that is, <code>int i = ...</code> within a <code>for(int i = ...;...)</code>
statement</li>
<li><code>for</code> loop update statements, that is, <code>i += 2</code> within a <code>for(int i = ...;...; i += 2)</code>
statement</li>
</ul>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum number of statements a lambda expression is allowed to have.
<p>
<small>New in 2016.3</small>
<p>Use the <b>Non-comment source statements limit</b> field to specify the maximum allowed number of statements in a lambda expression.<p>
<!--<small>New in 2016.3</small>-->
</body>
</html>

View File

@@ -1,13 +1,10 @@
<html>
<body>
Reports any non-empty packages which are present in multiple modules.
<p>
For example, you may have modules <code>first</code> and <code>second</code> in your project with same package <code>foo</code>.
Such modules cannot be used together because of a package conflict.
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
Reports a non-empty package that is present in several modules.
<p>Suppose, your project has modules <code>first</code> and <code>second</code> that both have the same package <code>foo</code>.
These modules cannot be used together because of a package conflict.</p>
<!-- tooltip end -->
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
</body>
</html>

View File

@@ -1,16 +1,14 @@
<html>
<body>
Reports instance variables declared without access modifier (also known as package-private).
Constants (i.e. variables marked <code>static</code> and <code>final</code>) are not reported.
Reports an instance variable that is declared without any access modifier (also known as package-private).
<p>Constants (that is, variables marked <code>static</code> or <code>final</code>) are not reported.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
public class A {
Object object; // warning
final static int MODE = 0; // constant, no warning
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,21 +1,20 @@
<html>
<body>
Reports nested classes declared without access modifier (also known as package-private).
Reports a nested class that is declared without any access modifier (also known as package-private).
<p><b>Example:</b></p>
<pre>
<pre><code>
public class Outer {
static class Nested {} // warning
class Inner {} // warning
enum Mode {} // warning depends on the setting
interface I {} // warning depends on the setting
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the first checkbox below to ignore package-private inner enums.
<p>
Use the seconds checkbox below to ignore package-private inner interface.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Ignore package-visible inner enums</b> option to ignore package-private inner enums.</li>
<li>Use the <b>Ignore package-visible inner interfaces</b> option to ignore package-private inner interfaces.</li>
</ul>
</body>
</html>

View File

@@ -1,12 +1,10 @@
<html>
<body>
Reports any packages which contain too few classes. Overly small packages may indicate a fragmented design.
Reports a package that contains fewer classes than the specified minimum.
<p>Overly small packages may indicate fragmented design.</p>
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
<p>
Use the field below to specify the minimum number of classes a package may have.
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
<p>Use the <b>Minimum number of classes</b> field to specify the minimum allowed number of classes in a package.</p>
</body>
</html>

View File

@@ -1,13 +1,10 @@
<html>
<body>
Reports any packages which contain too many classes.
Overly large packages may indicate a lack of design clarity.
Reports a package that contains too many classes.
<p>Overly large packages may indicate a lack of design clarity.</p>
<!-- tooltip end -->
<p>
Because this inspection requires global code analysis it is only available for <em>Analyze|Inspect Code</em> or
<em>Analyze|Run Inspection by Name</em> and it will not report in the editor.
</p>
<p>
Use the field below to specify the maximum number of classes a package may have before triggering this inspection.
<p>Available only from <b>Analyze | Inspect Code</b> or
<b>Analyze | Run Inspection by Name</b> and isn't reported in the editor.</p>
<p>Use the <b>Maximum number of classes</b> field to specify the maximum allowed number of classes in a package.</p>
</body>
</html>

View File

@@ -1,23 +1,18 @@
<html>
<body>
Reports constructors with too many parameters.
Constructors with too many parameters can be a good sign that refactoring is necessary, e.g. by applying the builder pattern.
<p>For example:</p>
<pre>
Reports a constructor with too many parameters.
<p>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
}
</pre>
<p>
Such object is hard to instantiate, especially if some parameters are optional.
It is better to rewrite such code using the builder pattern.
</p>
</code></pre>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum number of parameters a constructor is allowed to have.
<p>
Use the combobox below to specify if the inspection should ignore constructors with certain visibility.
<p>
<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>

View File

@@ -1,11 +1,9 @@
<html>
<body>
Reports methods with too many parameters. Methods with too many parameters can be a good sign that refactoring is necessary.
Methods which have super methods are ignored by this inspection.
Reports a method where the number of parameters exceeds the specified maximum.
<p>Methods with too many parameters can be a good sign that refactoring is necessary.</p>
<p>Methods that have super methods are not reported.</p>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum number of parameters a method is allowed to have.
<p>
<p>Use the <b>Parameter limit</b> field to specify the maximum allowed number of parameters for a method.<p>
</body>
</html>

View File

@@ -1,16 +1,14 @@
<html>
<body>
Reports <code>protected</code> instance variables.
Constants (i.e. variables marked <code>static</code> and <code>final</code>) are not reported.
Reports a <code>protected</code> instance variable.
<p>Constants (that is, variables marked <code>static</code> or <code>final</code>) are not reported.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
public class A {
protected Object object; // warning
protected final static int MODE = 0; // constant, no warning
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,22 +1,20 @@
<html>
<body>
Reports <code>protected</code> nested classes.
Reports a <code>protected</code> nested class.
<p><b>Example:</b></p>
<pre>
<pre><code>
public class Outer {
protected static class Nested {} // warning
protected class Inner {} // warning
protected enum Mode {} // warning depends on the setting
protected interface I {} // warning depends on the setting
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the first checkbox below to ignore <code>protected</code> inner enums.
<p>
Use the seconds checkbox below to ignore <code>protected</code> inner interface.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Ignore 'protected' inner enums</b> option to ignore <code>protected</code> inner enums.</li>
<li>Use the <b>Ignore 'protected' inner interfaces</b> option to ignore <code>protected</code> inner interfaces.</li>
</ul>
</body>
</html>

View File

@@ -1,18 +1,16 @@
<html>
<body>
Reports <code>try</code> statements which catch
<code>java.lang.ThreadDeath</code> which do not rethrow the exception.
Reports a <code>try</code> statement that catches
<code>java.lang.ThreadDeath</code> and does not rethrow the exception.
<p><b>Example:</b></p>
<pre>
<pre><code>
try {
executeInParallel(request);
}
catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown
return false;
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,10 +1,11 @@
<html>
<body>
Reports <code>throw</code> statements whose exceptions are always
caught by containing <code>try</code> statements. Using <code>throw</code>
statements as a "goto" to change the local flow of control is both confusing and likely to have poor performance.
Reports a <code>throw</code> statement whose exceptions are always
caught by a containing <code>try</code> statement.
<p>Using <code>throw</code>
statements as a "goto" to change the local flow of control is confusing and results in poor performance.
<p><b>Example:</b></p>
<pre>
<pre><code>
try {
if (!Files.isDirectory(PROJECTS)) {
throw new IllegalStateException("Directory not found."); // warning: 'throw' caught by containing 'try' statement
@@ -14,9 +15,8 @@ statements as a "goto" to change the local flow of control is both confusing and
catch (Exception e) {
LOG.error("run failed");
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
Use the checkbox below to ignore exceptions which are rethrown.
<p>Use the <b>Ignore rethrown exceptions</b> option to ignore exceptions that are rethrown.</p>
</body>
</html>

View File

@@ -1,11 +1,8 @@
<html>
<body>
Reports methods that have too many different types of exceptions in <code>throws</code> list.
Methods with too many exceptions declared are a good sign that your error handling code is getting overly complex.
Reports a method that has too many different types of exceptions in its <code>throws</code> list.
<p>Methods with too many exceptions declared are a good sign that your error handling code is getting overly complex.</p>
<!-- tooltip end -->
<p>
Use the field below to specify the maximum number of exception types in a method <code>throws</code> list.
<p>
<p>Use the <b>Exceptions thrown limit</b> field to specify the maximum number of exception types a method is allowed to have in its <code>throws</code> list.<p>
</body>
</html>

View File

@@ -1,16 +1,16 @@
<html>
<body>
Reports declarations of unchecked exceptions (<code>java.lang.RuntimeException</code> and its subclasses) in the <code>throws</code> clause of a method.
Declaration of unchecked exceptions are not required and may be deleted or moved to a Javadoc <code>@throws</code> tag.
Reports declaration of an unchecked exception (<code>java.lang.RuntimeException</code> or one of its subclasses) in the <code>throws</code>
clause of a method.
<p>Declarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc <code>@throws</code> tag.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
public class InvalidDataException extends RuntimeException {}
class TextEditor {
void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause
}
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>

View File

@@ -1,7 +1,7 @@
<html>
<body>
Reports <code>catch</code> blocks which have parameters which are more generic than the
exceptions thrown by the corresponding <code>try</code> block.
Reports a <code>catch</code> block with parameters that are more generic than the
exception thrown by the corresponding <code>try</code> block.
<p><b>Example:</b></p>
<pre><code>
try {
@@ -23,12 +23,11 @@ exceptions thrown by the corresponding <code>try</code> block.
}
</code></pre>
<!-- tooltip end -->
<p>
Use the first checkbox below to have this inspection only warn on the most generic exceptions.
<p>
Use the second checkbox below to ignore any exceptions which hide other exceptions, but which may be thrown and thus
are technically not overly broad.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Only warn on RuntimeException, Exception, Error or Throwable</b> option to have this inspection warn only on the most generic exceptions.</li>
<li>Use the <b>Ignore exceptions which hide others but are themselves thrown</b> option to ignore any exceptions that hide other exceptions but
still may be thrown and thus are technically not overly broad.</li>
</ul>
</body>
</html>

View File

@@ -1,7 +1,7 @@
<html>
<body>
Reports <code>throws</code> clauses which contain exceptions which are more generic than the
exceptions actually thrown by the method.
Reports a <code>throws</code> clause with an exception that is more generic than the
exception that the method actually throws.
<p><b>Example:</b></p>
<pre><code>
public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'
@@ -16,13 +16,15 @@ exceptions actually thrown by the method.
file.createNewFile();
</code></pre>
<!-- tooltip end -->
<p>
Use the first checkbox below to have this inspection only warn on the most generic exceptions.
<p>
Use the second checkbox below to ignore overly broad <code>throws</code> clauses in methods which override a library method.
<p>
Use the third checkbox below to ignore any exceptions which hide other exceptions, but which may be thrown from the method body and thus
are technically not overly broad.
<p>
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Only warn on RuntimeException, Exception, Error or Throwable</b> option to have this inspection warn only on the most generic
exceptions.</li>
<li>Use the <b>Ignore exceptions declared on methods overriding a library method</b> option to ignore overly broad <code>throws</code> clauses
in methods that override a library method.</li>
<li>Use the <b>Ignore exceptions which hide others but are themselves thrown</b> option to ignore any exceptions that hide other exceptions
but still may be thrown from the method body and thus
are technically not overly broad.</li>
</ul>
</body>
</html>

View File

@@ -1,13 +1,11 @@
<html>
<body>
Reports unchecked exception classes (i.e. subclasses of <code>java.lang.RuntimeException</code>).
Certain coding standards require that all user-defined exception classes be checked.
Reports a subclass of <code>java.lang.RuntimeException</code>.
<p>Some coding standards require that all user-defined exception classes are checked.</p>
<p><b>Example:</b></p>
<pre>
<pre><code>
class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'
</pre>
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>