Test cases

Results
Date2007/07/27
Packages9
Files258
Codebase59420
Reviews108389
Violations1080
Waived violations0
DPMO1099
Sigma4.562

Severity summary

Severity 1, total 55
InspectorDescriptionNumber
ER-002Empty catch block2
ER-006Missing default case for switch statement2
ER-011Cyclomatic complexity exceeds specified limit1
ER-019Avoid 'return' in finally block - meaning of this is not always obvious to the maintainer1
ER-024Directory structure should match package structure2
ER-027Avoid using "new" keyword when creating String objects to hold string literals.1
ER-035Switch statement case without 'break'2
ER-048Use BigDecimal instead of Float or Double for monetary values9
ER-053ResultSetMetaData is banned. The disclosure of DB internals (here Column Names) on Business/Service layer is bad design2
ER-054Avoid calling an "abstract" method from a constructor in an "abstract" class1
ER-055Declare bean classes "public", but not "final"2
ER-056Declare 'ejbCreate ()' methods "public", but neither "static" nor "final"4
ER-057Declare finder methods "public" and neither "final" nor "static"1
ER-058Implement one or more 'ejbCreate ()' methods in bean classes1
ER-059Implement matching 'ejbPostCreate ()' methods for every 'ejbCreate()' in EntityBean classes1
ER-061Do not define 'finalize ()' method in bean classes1
ER-063Declare 'ejbPostCreate ()' "public" and neither "static" nor "final"4
ER-064Make the return type "void" for SessionBeans' 'ejbCreate ()' methods1
ER-065Make the return type "void" for the 'ejbPostCreate ()' method1
ER-066Avoid passing the "this" reference as an argument1
ER-067Avoid returning "this"1
ER-068Avoid starting, stopping, or managing threads in any way2
ER-069Avoid calling 'finalize ()' explicitly1
ER-072Avoid using constructors in the 'clone ()' method1
ER-073Call 'super.clone ()' in all 'clone ()' methods2
ER-075Avoid hiding inherited instance fields1
ER-076Make inner classes "private"1
ER-080Avoid "for", "do", "while", "if" and "if ... else" statements with empty bodies1
ER-088Avoid using variables of type 'java.lang.ThreadGroup'1
ER-108Application controlled garbage collection is banned in a J2EE environment and mostly indicates lack of design.1
ER-111LOG4J is mandatory for all logging in ERC. System.out.println will be lost in a system console of our web/app server.3

Severity 2, total 599
InspectorDescriptionNumber
ER-004A class should have no public fields except 'final' or 'static final'"5
ER-008Synchronize at the block level rather than the method level6
ER-009For statement requires update clause1
ER-010Assignment inside conditional1
ER-013For statement requires initialization clause (1st argument)1
ER-014For statement requires condition clause (2nd argument)"1
ER-016Missing package declaration - encourage structuring and avoid namesapace conflicts by using packages2
ER-020Avoid empty finally block1
ER-021One class/interface per file.1
ER-026Avoid expressions like ? true : false1
ER-033Source file is too long1
ER-038Non-sequential logic - 'continue' statement1
ER-040Avoid equality operations on 'true' and 'false' boolean literals.2
ER-043Packages should be neither too lean nor too fat.9
ER-046Method declares too general exception types (Exception, Throwable) in throws clause2
ER-047Operation (method or constructor) declares subclasses of RuntimeException in throws clause1
ER-049Unify logging strategy - define individual logger for class248
ER-062Declare all "static" fields in the EJB component "final"10
ER-070Avoid "static" collections; they can grow without bounds1
ER-071Avoid using an object to access "static" fields or methods1
ER-074Avoid using "public static final" array fields1
ER-077Avoid more than two levels of nested inner classes1
ER-079Avoid casting primitive data types to lower precision1
ER-081Do not assign loop control variables in the body of a "for" loop2
ER-089Avoid using 'Thread.yield'2
ER-091Give subclasses of Thread a 'run ()' method1
ER-093Call 'wait ()' only inside a "while" loop1
ER-094Use 'wait ()' and 'notifyAll ()' instead of polling loops1
ER-095Too many exceptions listed in throws clause1
ER-102String Arrays are deprecated and are ONLY allowed for final variables3
ER-103Catch-blocks should log the exeption with Log4J.error("Context String" , exception )50
ER-104Use a Collection instead of arrays Object[]5
ER-112File doesn't contain classes or interfaces2
ER-113Unused private/local variables232

Severity 3, total 426
InspectorDescriptionNumber
ER-003do, while, if, and for statements need a brace enclosed block3
ER-005Classes, interfaces, methods, and variables should be named according to Sun's naming conventions.37
ER-007Use upper case 'L' rather that lower case 'l' to qualify long literals2
ER-018Sun coding standards - class modifiers should be in order (public protected private abstract static final strictfp)2
ER-023Packages should begin with project or organization package prefix258
ER-025Parenthesis are redundant2
ER-028Avoid hardwired character literals2
ER-029Avoid hardwired numeric literals12
ER-030Avoid hardwired string literals11
ER-031More than one statement per line1
ER-032Array declarators should be placed next to the type, not the variable name2
ER-034Variables should be declared in individual statements.1
ER-036Line is too long52
ER-082Avoid using method parameter names that conflict with class member names1
ER-083Avoid giving non-constructor methods the same name as the class1
ER-087Do not use 'notify ()'; use 'notifyAll ()' instead2
ER-096Empty statements6
ER-098No need to provide (public, abstract, ) modifiers for interface methods1
ER-105Document all Interfaces and public methods. Use a Class header. Provide Javadoc4
ER-107Instance variables and method names shouldn't have same name1
ER-109It is good practice to call in any case super() in a constructor. (see also: UnnecessaryConstructorRule )1
ER-110Unnecessary 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-114Use object.equals(anotherObject) instead of object.compareTo(anotherObject)==08
ER-116Use 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-201Discourage usage of instance variables like a, j by enforcing minimal variable name length.5

Metrics
NameNumberMinAvgMaxTotal
Change ratio2581.001.001.00258.00
Class complexity2690.002.3716.00640.00
Code length4360.003.8143.001662.00
File length2580.0053.51115.0013808.00
Operation complexity4350.001.4713.00643.00
Work order25810.0771.4199.0018424.34

Annotations

JavaDoc

Files


NameReviewsViolationsDPMOSigma
EmptyFileViolationTestCase.java165818752.893
MissingPackageDeclarationRuleViolationTestCase.java28437394.679

com.hammurapi.inspectors.testcases.violations
NameReviewsViolationsDPMOSigma
RootPackageRuleViolationTestCase.java29523724.872

org.hammurapi.inspectors.performance.testcases.fixes
NameReviewsViolationsDPMOSigma
StringConcatenationInspectorFixTestCase.java472199744.598

org.hammurapi.inspectors.performance.testcases.violations
NameReviewsViolationsDPMOSigma
StringConcatenationInspectorViolationTestCase.java16237404.678

org.hammurapi.inspectors.testcases
NameReviewsViolationsDPMOSigma
HammurapiTestCasesException.java27934304.833

org.hammurapi.inspectors.testcases.fixes
NameReviewsViolationsDPMOSigma
AbstractMethodFromConstructorRuleFixTestCase.java38833094.923
AbstractMethodInConstructorRuleFixTestCase.java78214104.487
AccessToStaticMembersRuleFixTestCase.java36123044.927
AlphabeticalImportRuleFixTestCase.java167312574.522
ArrayDeclarationRuleFixTestCase.java31336704.707
AssignmentInsideConditionalRuleFixTestCase.java44534714.807
AssignmentSnooperFixTestCase.java78214104.487
BooleanEqualityRuleFixTestCase.java56733704.874
BraceRuleFixTestCase.java83732504.98
CastingPrimitiveTypesRuleFixTestCase.java27937524.674
CatchTooGeneralExceptionTypeRuleFixTestCase.java48534324.831
CloseJdbcResourcesRuleFixTestCase.java78214104.487
CloseStreamsInFinallyBlockRuleFixTestCase.java78214104.487
CodeTooLongRuleFixTestCase.java127861875.057
CommonPrefixRuleFixTestCase.java78214104.487
ConditionalExpressionRuleFixTestCase.java38535454.766
ConstructorsInCloneRuleFixTestCase.java49344464.822
ConstructorWithoutSuperRuleFixTestCase.java26637894.66
ContinueRuleFixTestCase.java46234544.817
CyclomaticComplexityRule2FixTestCase.java49734224.838
CyclomaticComplexityRuleFixTestCase.java195271285.156
DeadlockRuleFixTestCase.java78214104.487
DeclareStaticFieldsFinalInEjbRuleFixTestCase.java51144304.832
DefineFinalizeInEjbRuleFixTestCase.java48832454.985
DefineLoggerForClassRuleFixTestCase.java267511984.536
DefineLoggerPrivateStaticFixTestCase.java78214104.487
DeprecatedRuleFixTestCase.java42645164.781
DirectoryStructureRuleFixTestCase.java169312424.525
DoNotUseFinalizeRuleFixTestCase.java78214104.487
DoNotUseNewForStringsRuleFixTestCase.java34336124.733
DoNotUseTypeRuleFixTestCase.java167312574.522
DuplicateImportRuleFixTestCase.java49134274.834
EjbClassModifiersRuleFixTestCase.java46832564.974
EjbCreateModifiersRuleFixTestCase.java103431165.181
EjbPostCreateModifiersRuleFixTestCase.java103043004.931
EmptyBodiesRuleFixTestCase.java35735884.745
EmptyCatchBlockRuleFixTestCase.java61945004.79
EmptyCompilationUnitRuleFixTestCase.java170312354.527
EmptyFinallyBlockRuleFixTestCase.java84154874.798
EmptyStatementsFixTestCase.java37735574.76
EnsureEjbCreateRuleFixTestCase.java75831585.101
EnsureEjbPostCreateRuleFixTestCase.java75831585.101
EnsureVoidReturnTypeForEjbPostCreateRuleFixTestCase.java76131575.102
EnsureVoidReturnTypeForSessionBeanEjbCreateRuleFixTestCase.java46746634.71
FileHeaderRuleFixTestCase.java168312504.523
FilesPerPackageFixTestCase.java78214104.487
FinalParametersRuleFixTestCase.java27937524.674
FinderModifiersRuleFixTestCase.java88831355.142
ForConditionRuleFixTestCase.java53464494.82
ForInitRuleFixTestCase.java53464494.82
ForIteratorRuleFixTestCase.java53464494.82
ForLoopControlVariablesRuleFixTestCase.java934165564.76
HardcodedCharacterLiteralsRuleFixTestCase.java40335214.779
HardcodedNumericLiteralsRuleFixTestCase.java36535754.751
HardcodedStringLiteralsRuleFixTestCase.java403510174.585
HidingInheritedFieldsRuleFixTestCase.java227514094.487
IndentationRuleFixTestCase.java78214104.487
InnerClassNestingRuleFixTestCase.java299617054.428
InnerClassVisibilityRuleFixTestCase.java214414484.478
InterfaceMethodModifiersRuleFixTestCase.java8811135.187
InvocationVisitorFixTestCase.java78214104.487
InvokeFinalizeRuleFixTestCase.java23024784.803
JavaDocRuleFixTestCase.java158413924.491
JavaLangImportRuleFixTestCase.java31536664.709
LineLengthRuleFixTestCase.java50158184.649
LoadNativeLibrariesInEjbRuleFixTestCase.java55832155.021
LogExceptionsRuleFixTestCase.java48634324.831
LogicalNestingRuleFixTestCase.java87932384.993
ManageThreadsFromEjbRuleFixTestCase.java55332165.018
MaxLinesInFileRuleFixTestCase.java113553614.881
MethodNameSameAsConstructorRuleFixTestCase.java21339854.594
MinimalInstanceVariableLengthRuleFixTestCase.java203415274.462
MissingPackageDeclarationRuleFixTestCase.java26437954.658
ModifiersOrderRuleFixTestCase.java53444114.845
NamingStandardRuleFixTestCase.java1212107504.674
NoPublicFieldsRuleFixTestCase.java372613704.495
NoStarImportsRuleFixTestCase.java47134454.823
NotifyRuleFixTestCase.java69067394.679
OneStatementPerLineRuleFixTestCase.java40235224.778
OneTypePerFileRule2FixTestCase.java172312204.53
OneTypePerFileRuleFixTestCase.java171312284.529
OperationParameterNamesRuleFixTestCase.java27437664.668
OperationWithRuntimeExceptionInThrowsFixTestCase.java51554464.822
OperationWithTooGeneralExceptonTypeInThrowsFixTestCase.java48734314.832
PrintStackTraceRuleFixTestCase.java49434254.836
PublicStaticArrayFieldsRuleFixTestCase.java270411484.549
RedundantParenthesisRuleFixTestCase.java55833764.87
ResultSetMetaDataFixTestCase.java78214104.487
ReturnFromFinallyRuleFixTestCase.java76855334.772
ReturnSnooperFixTestCase.java78214104.487
ReturnThisFromEjbRuleFixTestCase.java54732195.016
RootPackageRuleFixTestCase.java78214104.487
StaticCollectionsRuleFixTestCase.java225413774.494
StringArraysRuleFixTestCase.java323615784.452
StringLiteralEqualsRuleFixTestCase.java30536884.699
SuperCloneRuleFixTestCase.java25738174.65
SuperSnooperFixTestCase.java78214104.487
SwitchCaseBreakRuleFixTestCase.java49234264.835
SwitchDefaultRuleFixTestCase.java68533064.926
SynchronizationInServletsRuleFixTestCase.java78214104.487
SynchronizedRuleFixTestCase.java30636864.7
SynchronizedRunnableRunMethodRuleFixTestCase.java220414094.487
SystemGcMisuseRuleFixTestCase.java46732564.973
SystemPrintlnLoggingRuleFixTestCase.java106321035.21
TextLabelsInSwitchStatementRuleFixTestCase.java68176314.724
ThisReferenceAsArgumentInEjbRuleFixTestCase.java62631915.051
ThreadGroupRuleFixTestCase.java169312424.525
ThreadSubclassesRuleFixTestCase.java60633464.892
ThreadYieldRuleFixTestCase.java47422325.001
ThrowsClauseRuleFixTestCase.java67256104.734
ThrowTooGeneralExceptionTypeRuleFixTestCase.java48634324.831
TooManyParametersRuleFixTestCase.java41696494.716
TooManyParametersRuleParamClass.java106531975.044
TooManyThrowsRuleFixTestCase.java98465184.78
TooMuchLoggingRuleFixTestCase.java78214104.487
UnnecessaryConstructorRuleFixTestCase.java27437664.668
UnusedVariablesRuleFixTestCase.java31323514.888
UpperLRuleFixTestCase.java26958554.636
UseBigDecimalInsteadOfFloatAndDoubleRuleFixTestCase.java45634604.814
UseCollectionsInsteadOfArraysRuleFixTestCase.java32236524.715
VariableNameClashesWithTypeNameRuleFixTestCase.java203415274.462
VariablesAndMethodsNameClashingRuleFixTestCase.java26837834.662
VariablesRuleFixTestCase.java44634704.807
WaitAndNotifyInsteadOfPollingRuleFixTestCase.java47134454.823
WaitAndNotifyRuleFixTestCase.java78214104.487
WaitInLoopRuleFixTestCase.java46034564.816

org.hammurapi.inspectors.testcases.violations
NameReviewsViolationsDPMOSigma
AbstractMethodFromConstructorRuleViolationTestCase.java411327004.282
AbstractMethodInConstructorRuleViolationTestCase.java78214104.487
AccessToStaticMembersRuleViolationTestCase.java36735724.752
AlphabeticalImportRuleViolationTestCase.java167312574.522
ArrayDeclarationRuleViolationTestCase.java31347024.693
AssignmentInsideConditionalRuleViolationTestCase.java45646794.703
AssignmentSnooperViolationTestCase.java78214104.487
BooleanEqualityRuleViolationTestCase.java58157054.692
BraceRuleViolationTestCase.java81062964.935
CastingPrimitiveTypesRuleViolationTestCase.java343999703.827
CatchTooGeneralExceptionTypeRuleViolationTestCase.java48234354.829
CloseJdbcResourcesRuleViolationTestCase.java78214104.487
CloseStreamsInFinallyBlockRuleViolationTestCase.java78214104.487
CodeTooLongRuleViolationTestCase.java151393564.884
CommonPrefixRuleViolationTestCase.java78214104.487
ConditionalExpressionRuleViolationTestCase.java43347154.688
ConstructorsInCloneRuleViolationTestCase.java323568423.965
ConstructorWithoutSuperRuleViolationTestCase.java25848524.637
ContinueRuleViolationTestCase.java46746634.71
CyclomaticComplexityRuleViolationTestCase.java185686734.706
DeadlockRuleViolationTestCase.java78214104.487
DeclareStaticFieldsFinalInEjbRuleViolationTestCase.java509610014.59
DefineFinalizeInEjbRuleViolationTestCase.java528524814.309
DefineLoggerForClassRuleViolation2TestCase.java269515244.463
DefineLoggerForClassRuleViolationTestCase.java167312574.522
DefineLoggerPrivateStaticViolationTestCase.java78214104.487
DeprecatedRuleViolationTestCase.java36648464.639
DoNotUseFinalizeRuleViolationTestCase.java78214104.487
DoNotUseNewForStringsRuleViolationTestCase.java352434374.203
DoNotUseTypeRuleViolationTestCase.java373716354.441
DuplicateImportRuleViolationTestCase.java49134274.834
EjbClassModifiersRuleViolationTestCase.java471527814.273
EjbClassModifiersRuleViolationTestCase2.java466528114.269
EjbCreateModifiersRuleViolationTestCase.java1026842004.135
EjbPostCreateModifiersRuleViolationTestCase.java1025842044.135
EmptyBodiesRuleViolationTestCase.java357534174.205
EmptyCatchBlockRuleViolationTestCase.java4821052484.059
EmptyCompilationUnitRuleViolationTestCase.java40227504.276
EmptyFinallyBlockRuleViolationTestCase.java67687844.662
EmptyStatementsViolationTestCase.java38145774.75
EnsureEjbCreateRuleViolationTestCase.java607623224.331
EnsureEjbPostCreateRuleViolationTestCase.java720415554.457
EnsureVoidReturnTypeForEjbPostCreateRuleViolationTestCase.java767414604.476
EnsureVoidReturnTypeForSessionBeanEjbCreateRuleViolationTestCase.java478423434.328
FileHeaderRuleViolationTestCase.java168312504.523
FilesPerPackageViolationTestCase.java78214104.487
FinalParametersRuleViolationTestCase.java27737584.672
FinderModifiersRuleViolationTestCase.java889412594.521
ForConditionRuleViolationTestCase.java50766504.716
ForInitRuleViolationTestCase.java53766144.732
ForIteratorRuleViolationTestCase.java53678024.655
ForLoopControlVariablesRuleViolationTestCase.java57475924.743
HardcodedCharacterLiteralsRuleViolationTestCase.java36156374.722
HardcodedNumericLiteralsRuleViolationTestCase.java32346814.703
HardcodedStringLiteralsRuleViolationTestCase.java361711914.538
HidingInheritedFieldsRuleBase.java205310244.583
HidingInheritedFieldsRuleViolationTestCase.java212561794.002
IndentationRuleViolationTestCase.java78214104.487
InnerClassNestingRuleViolationTestCase.java299720404.372
InnerClassVisibilityRuleViolationTestCase.java217560364.01
InterfaceMethodModifiersRuleViolationTestCase.java9022225.012
InvocationVisitorViolationTestCase.java78214104.487
InvokeFinalizeRuleViolationTestCase.java386533934.207
JavaDocRuleViolationTestCase.java150716664.435
JavaLangImportRuleViolationTestCase.java31436684.708
LineLengthRuleViolationTestCase.java49768454.64
LoadNativeLibrariesInEjbRuleViolationTestCase.java69131735.077
LogExceptionsRuleViolationTestCase.java48722255.008
LogicalNestingRuleViolationTestCase.java90632315.001
ManageThreadsFromEjbRuleViolationTestCase.java755528074.269
MaxLinesInFileRuleViolationTestCase.java136463734.871
MethodNameSameAsConstructorRuleViolationTestCase.java213510794.567
MinimalInstanceVariableLengthRuleViolationTestCase.java203515764.452
ModifiersOrderRuleViolationTestCase.java53454304.832
NamingStandardRuleViolationTestCase.java1212228494.638
NoPublicFieldsRuleViolationTestCase.java381510764.568
NoStarImportsRuleViolationTestCase.java47134454.823
NotifyRuleViolationTestCase.java69087684.668
OneStatementPerLineRuleViolationTestCase.java40145484.764
OneTypePerFileRuleViolationTestCase.java306616664.435
OperationParameterNamesRuleViolationTestCase.java28047854.661
OperationWithRuntimeExceptionInThrowsViolationTestCase.java52076534.714
OperationWithTooGeneralExceptonTypeInThrowsViolationTestCase.java371511054.56
PrintStackTraceRuleViolationTestCase.java46058914.624
PublicStaticArrayFieldsRuleViolationTestCase.java274511674.544
RedundantParenthesisRuleViolationTestCase.java56243914.859
ResultSetMetaDataViolationTestCase.java499544284.117
ReturnFromFinallyRuleViolationTestCase.java776618174.408
ReturnSnooperViolationTestCase.java78214104.487
ReturnThisFromEjbRuleViolationTestCase.java522421454.356
RootPackageRuleViolationTestCase.java78214104.487
StaticCollectionsRuleViolationTestCase.java227518064.41
StringArraysRuleViolationTestCase.java314822614.339
StringLiteralEqualsRuleViolationTestCase.java30636864.7
SuperCloneRuleViolationTestCase.java230452604.058
SuperSnooperViolationTestCase.java78214104.487
SwitchCaseBreakRuleViolationTestCase.java488424794.31
SwitchDefaultRuleViolationTestCase.java643649924.076
SynchronizationInServletsRuleViolationTestCase.java78214104.487
SynchronizedRuleViolationTestCase.java279411114.559
SynchronizedRunnableRunMethodRuleViolationTestCase.java22039544.604
SystemGcMisuseRuleViolationTestCase.java502422314.343
SystemPrintlnLoggingRuleViolationTestCase.java1083629634.252
TextLabelsInSwitchStatementRuleViolationTestCase.java46946604.711
ThisReferenceAsArgumentInEjbRuleViolationTestCase.java602418604.401
ThreadGroupRuleViolationTestCase.java262650384.073
ThreadSubclassesRuleViolationTestCase.java57245414.768
ThreadYieldRuleViolationTestCase.java52256134.733
ThrowsClauseRuleViolationTestCase.java51757934.658
ThrowTooGeneralExceptionTypeRuleViolationTestCase.java370511084.56
TooManyParametersRuleViolationTestCase.java33287834.662
TooManyThrowsRuleViolationTestCase.java48066874.7
TooMuchLoggingRuleViolationTestCase.java78214104.487
UnnecessaryConstructorRuleViolationTestCase.java216410184.585
UnusedVariablesRuleViolationTestCase.java205415124.465
UpperLRuleViolationTestCase.java26979294.612
UseBigDecimalInsteadOfFloatAndDoubleRuleViolationTestCase.java3949157613.65
UseCollectionsInsteadOfArraysRuleViolationTestCase.java31336704.707
VariableNameClashesWithTypeNameRuleViolationTestCase.java203515764.452
VariablesAndMethodsNameClashingRuleViolationTestCase.java26848204.648
VariablesRuleViolationTestCase.java43545054.787
WaitAndNotifyInsteadOfPollingRuleViolationTestCase.java49146314.724
WaitAndNotifyRuleViolationTestCase.java78214104.487
WaitInLoopRuleViolationTestCase.java46146724.706

org.hammurapi.inspectors.testcases.violations.badpackage
NameReviewsViolationsDPMOSigma
DirectoryStructureRuleViolationTestCase.java302336754.181

org.hammurapi.inspectors.testcases.violations.badPackageName
NameReviewsViolationsDPMOSigma
BadPackageNameTestCase.java81213584.498

Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.