Inspector | Description | Number |
ER-002 | Empty catch block | 2 |
ER-006 | Missing default case for switch statement | 2 |
ER-011 | Cyclomatic complexity exceeds specified limit | 1 |
ER-019 | Avoid 'return' in finally block - meaning of this is not always obvious to the maintainer | 1 |
ER-024 | Directory structure should match package structure | 2 |
ER-027 | Avoid using "new" keyword when creating String objects to hold string literals. | 1 |
ER-035 | Switch statement case without 'break' | 2 |
ER-048 | Use BigDecimal instead of Float or Double for monetary values | 9 |
ER-053 | ResultSetMetaData is banned. The disclosure of DB internals (here Column Names) on Business/Service layer is bad design | 2 |
ER-054 | Avoid calling an "abstract" method from a constructor in an "abstract" class | 1 |
ER-055 | Declare bean classes "public", but not "final" | 2 |
ER-056 | Declare 'ejbCreate ()' methods "public", but neither "static" nor "final" | 4 |
ER-057 | Declare finder methods "public" and neither "final" nor "static" | 1 |
ER-058 | Implement one or more 'ejbCreate ()' methods in bean classes | 1 |
ER-059 | Implement matching 'ejbPostCreate ()' methods for every 'ejbCreate()' in EntityBean classes | 1 |
ER-061 | Do not define 'finalize ()' method in bean classes | 1 |
ER-063 | Declare 'ejbPostCreate ()' "public" and neither "static" nor "final" | 4 |
ER-064 | Make the return type "void" for SessionBeans' 'ejbCreate ()' methods | 1 |
ER-065 | Make the return type "void" for the 'ejbPostCreate ()' method | 1 |
ER-066 | Avoid passing the "this" reference as an argument | 1 |
ER-067 | Avoid returning "this" | 1 |
ER-068 | Avoid starting, stopping, or managing threads in any way | 2 |
ER-069 | Avoid calling 'finalize ()' explicitly | 1 |
ER-072 | Avoid using constructors in the 'clone ()' method | 1 |
ER-073 | Call 'super.clone ()' in all 'clone ()' methods | 2 |
ER-075 | Avoid hiding inherited instance fields | 1 |
ER-076 | Make inner classes "private" | 1 |
ER-080 | Avoid "for", "do", "while", "if" and "if ... else" statements with empty bodies | 1 |
ER-088 | Avoid using variables of type 'java.lang.ThreadGroup' | 1 |
ER-108 | Application controlled garbage collection is banned in a J2EE environment and mostly indicates lack of design. | 1 |
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. | 3 |
Inspector | Description | Number |
ER-004 | A class should have no public fields except 'final' or 'static final'" | 5 |
ER-008 | Synchronize at the block level rather than the method level | 6 |
ER-009 | For statement requires update clause | 1 |
ER-010 | Assignment inside conditional | 1 |
ER-013 | For statement requires initialization clause (1st argument) | 1 |
ER-014 | For statement requires condition clause (2nd argument)" | 1 |
ER-016 | Missing package declaration - encourage structuring and avoid namesapace conflicts by using packages | 2 |
ER-020 | Avoid empty finally block | 1 |
ER-021 | One class/interface per file. | 1 |
ER-026 | Avoid expressions like ? true : false | 1 |
ER-033 | Source file is too long | 1 |
ER-038 | Non-sequential logic - 'continue' statement | 1 |
ER-040 | Avoid equality operations on 'true' and 'false' boolean literals. | 2 |
ER-043 | Packages should be neither too lean nor too fat. | 9 |
ER-046 | Method declares too general exception types (Exception, Throwable) in throws clause | 2 |
ER-047 | Operation (method or constructor) declares subclasses of RuntimeException in throws clause | 1 |
ER-049 | Unify logging strategy - define individual logger for class | 248 |
ER-062 | Declare all "static" fields in the EJB component "final" | 10 |
ER-070 | Avoid "static" collections; they can grow without bounds | 1 |
ER-071 | Avoid using an object to access "static" fields or methods | 1 |
ER-074 | Avoid using "public static final" array fields | 1 |
ER-077 | Avoid more than two levels of nested inner classes | 1 |
ER-079 | Avoid casting primitive data types to lower precision | 1 |
ER-081 | Do not assign loop control variables in the body of a "for" loop | 2 |
ER-089 | Avoid using 'Thread.yield' | 2 |
ER-091 | Give subclasses of Thread a 'run ()' method | 1 |
ER-093 | Call 'wait ()' only inside a "while" loop | 1 |
ER-094 | Use 'wait ()' and 'notifyAll ()' instead of polling loops | 1 |
ER-095 | Too many exceptions listed in throws clause | 1 |
ER-102 | String Arrays are deprecated and are ONLY allowed for final variables | 3 |
ER-103 | Catch-blocks should log the exeption with Log4J.error("Context String" , exception ) | 50 |
ER-104 | Use a Collection instead of arrays Object[] | 5 |
ER-112 | File doesn't contain classes or interfaces | 2 |
ER-113 | Unused private/local variables | 232 |
Inspector | Description | Number |
ER-003 | do, while, if, and for statements need a brace enclosed block | 3 |
ER-005 | Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. | 37 |
ER-007 | Use upper case 'L' rather that lower case 'l' to qualify long literals | 2 |
ER-018 | Sun coding standards - class modifiers should be in order (public protected private abstract static final strictfp) | 2 |
ER-023 | Packages should begin with project or organization package prefix | 258 |
ER-025 | Parenthesis are redundant | 2 |
ER-028 | Avoid hardwired character literals | 2 |
ER-029 | Avoid hardwired numeric literals | 12 |
ER-030 | Avoid hardwired string literals | 11 |
ER-031 | More than one statement per line | 1 |
ER-032 | Array declarators should be placed next to the type, not the variable name | 2 |
ER-034 | Variables should be declared in individual statements. | 1 |
ER-036 | Line is too long | 52 |
ER-082 | Avoid using method parameter names that conflict with class member names | 1 |
ER-083 | Avoid giving non-constructor methods the same name as the class | 1 |
ER-087 | Do not use 'notify ()'; use 'notifyAll ()' instead | 2 |
ER-096 | Empty statements | 6 |
ER-098 | No need to provide (public, abstract, ) modifiers for interface methods | 1 |
ER-105 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc | 4 |
ER-107 | Instance variables and method names shouldn't have same name | 1 |
ER-109 | It is good practice to call in any case super() in a constructor. (see also: UnnecessaryConstructorRule ) | 1 |
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. | 2 |
ER-114 | Use object.equals(anotherObject) instead of
object.compareTo(anotherObject)==0 | 8 |
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. | 9 |
ER-201 | Discourage usage of instance variables like a, j by enforcing minimal variable name length. | 5 |