Inspector | Description | Number |
ER-002 | Empty catch block | 4 |
ER-011 | Cyclomatic complexity exceeds specified limit | 52 |
ER-048 | Use BigDecimal instead of Float or Double for monetary values | 88 |
ER-073 | Call 'super.clone ()' in all 'clone ()' methods | 1 |
ER-076 | Make inner classes "private" | 12 |
ER-080 | Avoid "for", "do", "while", "if" and "if ... else" statements with empty bodies | 11 |
ER-111 | LOG4J is mandatory for all logging in ERC. System.out.println will be lost in a system console of our web/app server. | 46 |
ER-207 | SQL Resource Management - Create Statement Without Close Rule: You have to close each created SQL Statement on method level. Use the finally block, but check for null value. If you use a operation in the finally block for closing your SQL resource, please define the operation name in the inspector.xml. Hammurapi will search for this method call and check the parameter list. This rule is only applicable in a connection-pooled environment. | 3 |
ER-209 | SQL Resource Management - Create Statement Number doesn't fit to Close Statement : You have to close each created SQL Statement on method level. The inspector counts the number of create- and close statement calls, and report a violation if there are less close calls as create calls. This may be wrong diagnosis if you nest your create statements in if-then-else blocks. If you use a operation in the finally block for closing your SQL resource, please define the operation name in the inspector.xml. Hammurapi will search for this method call and check the parameter list. This rule is only applicable in a connection-pooled environment. | 3 |
ER-214 | Heterogenous Collection detected: The code adds objects of different types in a collection. This can cause serious mainteance issues.
The creator and consumer of the collection have to have implicit knowledge about the index of a specific object inside of the collection.
Go with a dedicated parameter or Data Transfer Object instead.
There is only one exception for using Heterogenous Collection: If all objects in the collection implement a specific interface, this is acceptable.
| 8 |
Inspector | Description | Number |
ER-004 | A class should have no public fields except 'final' or 'static final'" | 64 |
ER-008 | Synchronize at the block level rather than the method level | 1 |
ER-009 | For statement requires update clause | 10 |
ER-010 | Assignment inside conditional | 3 |
ER-017-E | Do not assign new value to a parameter. For comprehensibility, formal parameters should be final | 9 |
ER-033 | Source file is too long | 1 |
ER-037 | Logical nesting limit exceeded | 3 |
ER-038 | Non-sequential logic - 'continue' statement | 2 |
ER-040 | Avoid equality operations on 'true' and 'false' boolean literals. | 1 |
ER-041 | Method is too long | 19 |
ER-043 | Packages should be neither too lean nor too fat. | 11 |
ER-046 | Method declares too general exception types (Exception, Throwable) in throws clause | 13 |
ER-047 | Operation (method or constructor) declares subclasses of RuntimeException in throws clause | 17 |
ER-049 | Unify logging strategy - define individual logger for class | 331 |
ER-070 | Avoid "static" collections; they can grow without bounds | 2 |
ER-079 | Avoid casting primitive data types to lower precision | 24 |
ER-093 | Call 'wait ()' only inside a "while" loop | 1 |
ER-095 | Too many exceptions listed in throws clause | 2 |
ER-102 | String Arrays are deprecated and are ONLY allowed for final variables | 64 |
ER-103 | Catch-blocks should log the exeption with Log4J.error("Context String" , exception ) | 321 |
ER-104 | Use a Collection instead of arrays Object[] | 79 |
ER-106 | If you have to compare with a string do not use degree.equals("1")) but "1".equals(degree) | 5 |
ER-113 | Unused private/local variables | 75 |
ER-212 | Statefull Singleton could cause problems in an environment of EJB, Clustering, or Load Balancing Architecture. Make sure that all you class and instance variables are final. This inspector found non-final variable(s), beside the variable referenzing the singleton. | 2 |
ER-215 | There are many add calls on a collection in a code snippet. This is a strong indication of miss using collections as a parameter container.
Use well-designed Value Objects or DTO instead.
| 8 |
Inspector | Description | Number |
ER-001 | Imports should be ordered according to the configuartion parameters and further for each parameter, imports should be arrange alphabetically | 31 |
ER-003 | do, while, if, and for statements need a brace enclosed block | 20 |
ER-005 | Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. | 102 |
ER-018 | Sun coding standards - class modifiers should be in order (public protected private abstract static final strictfp) | 5 |
ER-023 | Packages should begin with project or organization package prefix | 333 |
ER-025 | Parenthesis are redundant | 52 |
ER-028 | Avoid hardwired character literals | 137 |
ER-029 | Avoid hardwired numeric literals | 286 |
ER-030 | Avoid hardwired string literals | 2687 |
ER-031 | More than one statement per line | 10 |
ER-032 | Array declarators should be placed next to the type, not the variable name | 5 |
ER-034 | Variables should be declared in individual statements. | 4 |
ER-036 | Line is too long | 3463 |
ER-082 | Avoid using method parameter names that conflict with class member names | 202 |
ER-096 | Empty statements | 35 |
ER-098 | No need to provide (public, abstract, ) modifiers for interface methods | 100 |
ER-105 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc | 1518 |
ER-107 | Instance variables and method names shouldn't have same name | 7 |
ER-109 | It is good practice to call in any case super() in a constructor. (see also: UnnecessaryConstructorRule ) | 53 |
ER-110 | Unnecessary constructor detects when a constructor is not necessary; i.e., when there's only one constructor, it's public, has an empty body, and takes no arguments. | 5 |
ER-114 | Use object.equals(anotherObject) instead of
object.compareTo(anotherObject)==0 | 3 |
ER-116 | Use StringBuffer for excessive String concatenation. This inspector skips
static fields initializers, single concatenations (one +) and concatenations of constants like
"a"+"b"+"c" because they are calculated at compile time. | 405 |
ER-201 | Discourage usage of instance variables like a, j by enforcing minimal variable name length. | 8 |
ER-210 | StringTokenizer is deprecated, use String.split() instead. | 11 |
ER-213 | Singleton could cause problems in an environment of EJB, Clustering, or Load Balancing Architecture. Please double check thread safety and any unwanted side effects. | 1 |