-
Notifications
You must be signed in to change notification settings - Fork 147
/
checkstyle-metadata.properties
executable file
·116 lines (91 loc) · 17 KB
/
checkstyle-metadata.properties
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
AvoidConstantAsFirstOperandInCondition.name = Avoid Constant As First Operand In Condition
AvoidConstantAsFirstOperandInCondition.desc = If comparing values, C(C++) developers prefer to put the constant first in the equality check, to prevent situations of assignment rather than equality checking.<br><br>But in Java, in IF condition it is impossible to use assignment, so that habit become unnecessary and do damage readability of code.<br><br>In C(C++), comparison for null is tricky, and it is easy to write "=" instead of "==", and no complication error will be but condition will work in different way<br><br>Example:<br><code>if (null == variable)</code><br>rather than<br><code>if (variable == null)</code><br>because if you forget one (typo mistake) of the equal sign, you end up with<br><code>if (variable = null)</code><br>which assigns null to variable and IF always evaluate to true.
AvoidConstantAsFirstOperandInCondition.targetConstantTypes = Target Constant Types
AvoidDefaultSerializableInInnerClasses.name = Avoid default implementation of serializable interface
AvoidDefaultSerializableInInnerClasses.desc = This check prevents the default implementation Serializable interface in inner classes (Serializable interface are default if methods readObject() or writeObject() are not override in class). Check has option, that allow implementation only one method, if it true, but if it false - class must implement both methods. For more information read "Effective Java (2nd edition)" chapter 11, item 74, page 294.
AvoidHidingCauseException.name = Avoid Hiding Cause of the Exception
AvoidHidingCauseException.desc = Warns when you try to hide cause of an exception when rethrowing
AvoidNotShortCircuitOperatorsForBoolean.name = Avoid using bitwise operations for boolean expressions
AvoidNotShortCircuitOperatorsForBoolean.desc = Avoid using bitwise operations for boolean expressions
AvoidModifiersForTypes.name = Avoid Modifiers For Types
AvoidModifiersForTypes.desc = Disallow some set of modifiers for Java types specified by regexp.<br><br>Only 4 types according to Java Spec: static, final, transient, volatile.<br><br>Example:<br>"static" modifier for ULCComponents (http://ulc-community.canoo.com/snipsnap/space/Good+Practices) is not allowed.<br>So we can disallow "static" modifier for all ULC* components by setting up "forbiddenClassesRegexpStatic" option to "ULC.+" regexp String.
AvoidModifiersForTypes.forbiddenClassesRegexpFinal = The regexp defines the names of classes, that could not have 'final' modifier.
AvoidModifiersForTypes.forbiddenClassesRegexpStatic = The regexp defines the names of classes, that could not have 'static' modifier.
AvoidModifiersForTypes.forbiddenClassesRegexpTransient = The regexp defines the names of classes, that could not have 'transient' modifier.
AvoidModifiersForTypes.forbiddenClassesRegexpVolatile = The regexp defines the names of classes, that could not have 'volatile' modifier.
CustomDeclarationOrder.name = Custom Declaration Order
CustomDeclarationOrder.desc = Checks the class for a custom oder of declarations
ConfusingConditionCheck.name = Confusing Condition Check
ConfusingConditionCheck.desc = This check prevents negation within an "if" expression if "else" is present.<br>For example, rephrase: <br> if (x != y) smth1();<br> else smth2(); <br>as:<br> if (x == y) smth2(); <br>else smth1();
ConfusingConditionCheck.multiplyFactorForElseBlocks = Disable warnings if "else" block length is in "multiplyFactorForElseBlocks" time less then "if" block.
ConfusingConditionCheck.ignoreInnerIf = Disable warnings for all inner "if" . It is useful for save similarity.
ConfusingConditionCheck.ignoreSequentialIf = Disable warnings for all sequential "if" . It is useful for save similarity.
ConfusingConditionCheck.ignoreNullCaseInIf = Disable warnings for "if" if it expression contains "null".
ConfusingConditionCheck.ignoreThrowInElse = Disable warnings for "if" if "else" block contain "throw".
ForbidCertainImports.name = Forbid Certain Imports
ForbidCertainImports.desc = Forbids certain imports usage in certain packages. <br/><br/>You can configure this check using following parameters:<ol><li>Package qualified name regexp;</li><li>Forbidden imports regexp;</li><li>Forbidden imports excludes regexp.</li></ol>This check reads packages and imports qualified names without words "package","import" and semicolons, so, please, do NOT include "package" or "import" words or semicolons into your regular expressions when configuring.<br/><br/>Real-life example of usage: forbid to use all "*.ui.*" packages in "*.dao.*" packages, but ignore all Exception imports (such as <b>org.springframework.dao.InvalidDataAccessResourceUsageException</b>). For doing that, you should use the following check parameters: <br/><br/><dl><li>Package name regexp = ".*ui.*"</li><li>Forbidden imports regexp = ".*dao.*"</li><li>Forbidden imports excludes regexp = "^.+Exception$"</li></dl><br/>By means of few instances of this check will be possible to cover any rules.<br/><br/>Author: <a href="https://github.com/daniilyar"> Daniil Yaroslavtsev</a>
ForbidCertainImports.packageNameRegexp = Package name regexp.
ForbidCertainImports.forbiddenImportsRegexp = Regexp for matching forbidden imports
ForbidCertainImports.forbiddenImportsExcludesRegexp = Regexp for excluding imports from checking
ForbidInstantiation.name = Forbid Instantiation
ForbidInstantiation.desc = Forbids instantiation of certain object types by their full classname.<br><p>For example:<br>"java.lang.NullPointerException" will forbid the NPE instantiation.</p><p>Note: className should to be full: use "java.lang.NullPointerException" instead of "NullpointerException".</p>
ForbidInstantiation.forbiddenClasses = ClassNames for objects that are forbidden to instantiate.
ForbidCCommentsInMethods.name = Forbid C comments in method body
ForbidCCommentsInMethods.desc = Forbid C-style comments (/* ... */) in method body.
ForbidReturnInFinalBlockCheck.name = Forbid return statement in finally block
ForbidReturnInFinalBlockCheck.desk = Verifies the finally block design
IllegalCatchExtended.name = Illegal Catch Check Extended
IllegalCatchExtended.desc = Check for illegal catch but with option to ignore these catches in some cases
IllegalCatchExtended.allowThrow = Allow catching when throwing some exception
IllegalCatchExtended.allowRethrow = Allow catching when re-throwing exception
LogicConditionNeedOptimizationCheck.name = Logic condition need optimization
LogicConditionNeedOptimizationCheck.desc = This check prevents the placement of local variables and fields after calling methods in '&&' and '||' conditions.
MultipleVariableDeclarationsExtended.name = Multiple Variable Declarations Extended
MultipleVariableDeclarationsExtended.desc = Warn when declaring several variables in one line
MultipleStringLiteralsExtended.allowedDuplicates = The maximum number of occurences to allow without generating a warning
MultipleStringLiteralsExtended.desc = Checks for multiple occurrences of the same string literal within a single file.<br/>\r\nRationale: Code duplication makes maintenance more difficult, so it can be better to replace the multiple occurrences with a constant.
MultipleStringLiteralsExtended.ignoreOccurrenceContext = Token type names where duplicate strings are ignored even if they don't match ignoredStringsRegexp. This allows you to exclude syntactical contexts like Annotations or static initializers from the check.
MultipleStringLiteralsExtended.ignoreStringsRegexp = Regexp pattern for ignored strings (with quotation marks)
MultipleStringLiteralsExtended.name = Multiple String Literals Extended
MultipleStringLiteralsExtended.highlightAllDuplicates = Check to highlight all dublicates
NestedTernaryCheck.name = Nested Ternary Check
NestedTernaryCheck.desc = Highlights the usage of nested ternary operators. <br>Example of nested ternary operator: <br><p><code>final int d = (a == b) ? (a == b) ? 5 : 6 : 6;</code></p>
NestedTernaryCheck.ignoreFinal = Ignore nested ternary operators which are used for assigning the final variables. This option doesn`t ignore nested ternary operators which initializes final variables in constructors.
NoMainMethodInAbstractClass.name = No Main Method In Abstract Class
NoMainMethodInAbstractClass.desc = Checks if an abstract class does not have "main()" method, because it can mislead a developer to consider this class as a ready-to-use implementation
NoNullForCollectionReturnCheck.name = No null for collection return
NoNullForCollectionReturnCheck.desc = Check report you, when method, that must return array or collection, return null value instead of empty collection or empty array.
NoNullForCollectionReturnCheck.collectionList = List of the collections that will be check
NoNullForCollectionReturnCheck.searchThroughMethodBody = Search null value not only into return block
OverridableMethodInConstructor.desc = <p>Prevents any calls to overridable methods that are take place in:<ol><li>Any constructor body (verification is always done by default and not configurable).<li>Any method which works same as a constructor: clone() method from Cloneable interface and readObject() method from Serializable interface (you can individually switch on/of these methods verification by changing CheckCloneMethod and CheckReadObjectMethod properties).</li></ol><p>Rationale:<ol><li><q>Constructors must not invoke overridable methods, directly or indirectly.If you violate this rule, program failure will result. The superclass constructor runs before the subclass constructor, so the overriding method in the subclass will be invoked before the subclass constructor has run. If the overriding method depends on any initialization performed by the subclass constructor, the method will not behave as expected.</q><li><q>If you do decide to implement Cloneable or Serializable in a class designed for inheritance, you should be aware that because the clone() and readObject() methods behave a lot like constructors, a similar restriction applies: neither clone nor readObject may invoke an overridable method, directly or indirectly.</q></ol></p><br><p align="right">[Joshua Bloch - Effective Java 2nd Edition,Chapter 4, Item 17]</p><br>
OverridableMethodInConstructor.name = Overridable Method In Constructor
OverridableMethodInConstructor.checkCloneMethod = Enables the searching of calls to overridable methods from body of any clone() method is implemented from Cloneable interface.
OverridableMethodInConstructor.checkReadObjectMethod = Enables the searching of calls to overridable methods from the body of any readObject() method is implemented from Serializable interface.
OverridableMethodInConstructor.matchMethodsByArgCount = Enables matching methods by number of their parameters
ReturnBooleanFromTernary.name = Returning Boolean from Ternary Operator
ReturnBooleanFromTernary.desc = Avoid returning boolean values from ternary operator - use the boolean value from the inside directly.
ReturnCountExtended.name=Return Count Check Extended
ReturnCountExtended.desc=Checks that method/ctor "return" literal count is not greater than the given value ("maxReturnCount" property).<br><br>Rationale:<br><br>One return per method is a good practice as its ease understanding of method logic.<br><br>Reasoning is that:<dl><li>It is easier to understand control flow when you know exactly where the method returns.<li>Methods with 2-3 or many "return" statements are much more difficult to understand, debug and refactor.</dl>Setting up the check options will make it to ignore:<ol><li>Methods by name ("ignoreMethodsNames" property). Note, that the "ignoreMethodsNames" property type is NOT regexp: using this property you can list the names of ignored methods separated by comma.</li><li>Methods which linelength less than given value ("linesLimit" property).<li>"return" statements which depth is greater or equal to the given value ("returnDepthLimit" property). There are few supported<br>coding blocks when depth counting: "if-else", "for", "while"/"do-while" and "switch".<li>"Empty" return statements = return statements in void methods and ctors that have not any expression ("ignoreEmptyReturns" property).<li>Return statements, which are located in the top lines of method/ctor (you can specify the count of top method/ctor lines that will be ignored using "rowsToIgnoreCount" property).</ol>So, this is much improved version of the existing <i>Return Count</i> check.<br><br>
ReturnCountExtended.maxReturnCount=maximum allowed number of return statements per method/ctor (1 by default).
ReturnCountExtended.ignoreMethodLinesCount=Option to ignore methods/ctors which body has the linelength is less than given (20 lines by default). Set "0" to switch this option off and check all methods/ctors.
ReturnCountExtended.minIgnoreReturnDepth=Option to ignore methods/ctors that have return statement(s) with depth value is less than N levels(scopes). 4 by default. 0 is the min depth. Depth is 0 when the "return" statement is not wrapped on one of the supported coding blocks.
ReturnCountExtended.ignoreEmptyReturns=Option to ignore "empty" (with no any expression) return statements in void methods and ctors. 'False' by default.
ReturnCountExtended.topLinesToIgnoreCount=Option to set the count of code lines that will be ignored in top of all methods.
ReturnCountExtended.ignoreMethodsNames=Option to set the RegExp patterns for methods' names which would be ignored by check.
ReturnNullInsteadOfBoolean.name = Returning Null Instead of Boolean
ReturnNullInsteadOfBoolean.desc = Method declares to return Boolean, but returns null
RedundantReturnCheck.name=Redundant Return Check
RedundantReturnCheck.desc=Check code for presence of redundant return
RedundantReturnCheck.allowReturnInEmptyMethodsAndConstructors=If True, allow 'return' in empty constructors and methods that return void.
SimpleAccessorNameNotationCheck.name=Simple Accessor Name Notation
SimpleAccessorNameNotationCheck.desc=This check verify incorrect name of setter or getter methods if it used field with other name. For example, method has name 'setXXX', but define field with name 'YYY'
SimpleAccessorNameNotationCheck.prefix=prefix of field's name
UnnecessaryParenthesesExtended.desc = Checks for the use of unnecessary parentheses.
UnnecessaryParenthesesExtended.name = Unnecessary Parentheses Extended
UnnecessaryParenthesesExtended.ignoreCalculationOfBooleanVariables = Cancel validation setups of unnecessary parentheses in Boolean computations.
UnnecessaryParenthesesExtended.ignoreCalculationOfBooleanVariablesWithReturn = Cancel validation setups of unnecessary parentheses in Boolean computations with return state.
UnnecessaryParenthesesExtended.ignoreCalculationOfBooleanVariablesWithAssert = Cancel validation setups of unnecessary parentheses in Boolean computations with assert state.
EitherLogOrThrowCheck.desc = <p>Either log the exception, or throw it, but never do both. Logging and throwing results in multiple log messages for a single problem in the code, and makes problems for the support engineer who is trying to dig through the logs. This is one of the most annoying error-handling antipatterns. All of these examples are equally wrong.</p><p><b>Examples:</b><pre>catch (NoSuchMethodException e) {\t\nLOG.error("Message", e);\t\nthrow e;\n}</pre><b>or</b><pre>catch (NoSuchMethodException e) {\t\nLOG.error("Message", e);\t\nthrow new MyServiceException("AnotherMessage", e);\n}</pre><b>or</b><pre>catch (NoSuchMethodException e) {\t\ne.printStackTrace();\t\nthrow new MyServiceException("Message", e);\n}</pre></p><p><b>What check can detect:</b> <br><b>Loggers</b><ul><li>logger is declared as class field</li><li>logger is declared as method's local variable</li><li>logger is declared as local variable in <code>catch</code> block</li><li>logger is passed through method's parameters</li></ul><b>Exceptions</b><ul><li>logger logs <code>catch</code> parameter exception or it's message</li><li>throw <code>catch</code> parameter exception</li><li>throw another exception which is based on <code>catch</code> parameter exception</li><li>printStackTrace was called on <code>catch</code> parameter exception</li></ul></p><b>What check can not detect:</b> <br><ul><li>loggers that is used like method's return value. Example:<pre>getLogger().error("message", e)</pre></li> <li>loggers that is used like static fields from another classes:<pre>MyAnotherClass.LOGGER.error("message", e);<pre></li></ul></p><p>Default parameters are:<ul><li><b>loggerFullyQualifiedClassName</b> - fully qualified class name of logger type. Default value is <i>"org.slf4j.Logger"</i>.</li><li><b>loggingMethodNames</b> - comma separated names of logging methods. Default value is <i>"error, warn, info, debug"</i>.</li></ul></p><p>Note that check works with only one logger type. If you have multiple different loggers, then create another instance of this check.</p>
EitherLogOrThrowCheck.name = Either log exception or throw exception.
EitherLogOrThrowCheck.loggerFullyQualifiedClassName = Logger fully qualified class name. Example: "org.slf4j.Logger".
EitherLogOrThrowCheck.loggingMethodNames = Logging method names separated with commas. Example: "error,warn".