SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.9.3

Threshold is medium

Effort is max

Summary

Classes Bugs Errors Missing Classes
69 97 0 3

Files

Class Bugs
ClassInDefaultPackageTest 2
integrationTests.AbstractClassTest 1
integrationTests.AbstractClassWithNoExecutableLines 1
integrationTests.AnEnumTest 1
integrationTests.BooleanExpressionsTest 1
integrationTests.ClassInRegularPackage 2
integrationTests.ClassNotExercised 1
integrationTests.ClassWithNestedClasses 2
integrationTests.ClassWithNestedClasses$1 1
integrationTests.ClassWithNestedClasses$NestedClass 1
integrationTests.ClassWithNestedClasses$NestedClass$DeeplyNestedClass 1
integrationTests.ClassWithNestedClasses$NestedClass$InnerClass 1
integrationTests.ClassWithNestedEnum$NestedClass 1
integrationTests.ClassWithNestedEnum$NestedEnum 1
integrationTests.ClassWithReferenceToNestedClass 1
integrationTests.ClassWithReferenceToNestedClassTest 1
integrationTests.CoverageTest 3
integrationTests.IfElseStatements 20
integrationTests.IfElseStatementsTest 3
integrationTests.InterfaceWithExecutableCode 1
integrationTests.InterfaceWithExecutableCodeTest 1
integrationTests.MiscellaneousTest 1
integrationTests.MultiThreadedCode 2
integrationTests.MultiThreadedCodeTest 1
integrationTests.UnreachableStatements 3
integrationTests.data.ClassWithFieldsAccessedByMultipleTestsTest 4
integrationTests.data.ClassWithFieldsTest 1
integrationTests.data.ClassWithInstanceFields 4
integrationTests.loops.ForStatements 5
integrationTests.loops.ForStatementsTest 1
integrationTests.loops.WhileStatements 2
integrationTests.loops.WhileStatementsTest 2
integrationTests.otherControlStructures.SwitchStatements 15
integrationTests.otherControlStructures.SwitchStatementsTest 1
integrationTests.otherControlStructures.SynchronizedBlocks 1
integrationTests.otherControlStructures.TryCatchFinallyStatements 7

ClassInDefaultPackageTest

Bug Category Details Line Priority
Return value of ClassInDefaultPackage.doSomething(ClassInDefaultPackage$NestedEnum) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 6 Medium
Return value of ClassInDefaultPackage.doSomething(ClassInDefaultPackage$NestedEnum) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 11 Medium

integrationTests.AbstractClassTest

Bug Category Details Line Priority
Return value of AbstractClassWithNoExecutableLines.returnValue() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 28 Medium

integrationTests.AbstractClassWithNoExecutableLines

Bug Category Details Line Priority
Unused public or protected field: integrationTests.AbstractClassWithNoExecutableLines.anIntField STYLE UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD Not available Medium

integrationTests.AnEnumTest

Bug Category Details Line Priority
Unread field: integrationTests.AnEnumTest.tested PERFORMANCE URF_UNREAD_FIELD 12 Medium

integrationTests.BooleanExpressionsTest

Bug Category Details Line Priority
Return value of BooleanExpressions.isSameTypeIgnoringAutoBoxing(Class, Class) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 73 Medium

integrationTests.ClassInRegularPackage

Bug Category Details Line Priority
Method integrationTests.ClassInRegularPackage.doSomething(ClassInRegularPackage$NestedEnum) ignores return value of a non mutating method CORRECTNESS NPMC_NON_PRODUCTIVE_METHOD_CALL 52 Medium
Return value of Enum.toString() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 52 Medium

integrationTests.ClassNotExercised

Bug Category Details Line Priority
Format should be constant. Use placeholder to reduce the needless cost of parameter construction. see http://www.slf4j.org/faq.html#logging_performance CORRECTNESS SLF4J_FORMAT_SHOULD_BE_CONST 26 High

integrationTests.ClassWithNestedClasses

Bug Category Details Line Priority
Return value of new ClassWithNestedClasses$1() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 83 Medium
Method integrationTests.ClassWithNestedClasses.methodContainingAnonymousClass(int) uses a Side Effect Constructor STYLE SEC_SIDE_EFFECT_CONSTRUCTOR 83 Medium

integrationTests.ClassWithNestedClasses$1

Bug Category Details Line Priority
Class integrationTests.ClassWithNestedClasses$1 implements Cloneable but does not define or use clone method BAD_PRACTICE CN_IDIOM 83 Medium

integrationTests.ClassWithNestedClasses$NestedClass

Bug Category Details Line Priority
Class integrationTests.ClassWithNestedClasses$NestedClass defines fields that are used only as locals CORRECTNESS FCBL_FIELD_COULD_BE_LOCAL 26 Medium

integrationTests.ClassWithNestedClasses$NestedClass$DeeplyNestedClass

Bug Category Details Line Priority
Format should be constant. Use placeholder to reduce the needless cost of parameter construction. see http://www.slf4j.org/faq.html#logging_performance CORRECTNESS SLF4J_FORMAT_SHOULD_BE_CONST 41 High

integrationTests.ClassWithNestedClasses$NestedClass$InnerClass

Bug Category Details Line Priority
To make log readable, log format ({}: {}) should contain non-sign character. BAD_PRACTICE SLF4J_SIGN_ONLY_FORMAT 57 Medium

integrationTests.ClassWithNestedEnum$NestedClass

Bug Category Details Line Priority
Return value of ClassWithNestedEnum$NestedEnum.values() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 26 Medium

integrationTests.ClassWithNestedEnum$NestedEnum

Bug Category Details Line Priority
Enum class integrationTests.ClassWithNestedEnum$NestedEnum only declares one enum value CORRECTNESS ENMI_ONE_ENUM_VALUE 11 Medium

integrationTests.ClassWithReferenceToNestedClass

Bug Category Details Line Priority
Return value of java.util.concurrent.locks.ReentrantReadWriteLock.readLock() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 14 Medium

integrationTests.ClassWithReferenceToNestedClassTest

Bug Category Details Line Priority
Return value of ClassWithReferenceToNestedClass.doSomething() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 12 Medium

integrationTests.CoverageTest

Bug Category Details Line Priority
Unconstrained method integrationTests.CoverageTest.fileData() converts checked exception to unchecked STYLE EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS 83 High
integrationTests.CoverageTest.fileData should be package protected MALICIOUS_CODE MS_PKGPROTECT Not available Medium
Method integrationTests.CoverageTest.setTestedFieldToNewInstanceIfApplicable(Field) uses AccessibleObject.setAccessible to modify accessibility of classes CORRECTNESS RFI_SET_ACCESSIBLE 63 Medium

integrationTests.IfElseStatements

Bug Category Details Line Priority
integrationTests.IfElseStatements.anotherIfWithBooleanAndOperator(boolean, boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 304 High
integrationTests.IfElseStatements.ifAndElse(boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 30 High
integrationTests.IfElseStatements.ifSpanningMultipleLines(boolean, int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 322 High
integrationTests.IfElseStatements.ifWithBooleanAndOperator(boolean, boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 276 High
integrationTests.IfElseStatements.ifWithBooleanOrOperator(boolean, boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 290 High
integrationTests.IfElseStatements.infeasiblePaths(boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 230 High
integrationTests.IfElseStatements.methodWithFourDifferentPathsAndSegmentedLines(boolean, int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 90 High
integrationTests.IfElseStatements.methodWithFourDifferentPathsAndSimpleLines(boolean, int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 70 High
integrationTests.IfElseStatements.simpleIf(boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 17 High
integrationTests.IfElseStatements.singleLineIf(boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 44 High
integrationTests.IfElseStatements.singleLineIfAndElse(boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 56 High
Method integrationTests.IfElseStatements.ifAndElse(boolean) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 32 Medium
Method integrationTests.IfElseStatements.infeasiblePaths(boolean) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 234 Medium
Method integrationTests.IfElseStatements.methodWithFourDifferentPathsAndSegmentedLines(boolean, int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 92 Medium
Method integrationTests.IfElseStatements.methodWithFourDifferentPathsAndSegmentedLines(boolean, int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 98 Medium
Method integrationTests.IfElseStatements.methodWithFourDifferentPathsAndSimpleLines(boolean, int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 72 Medium
Method integrationTests.IfElseStatements.simpleIf(boolean) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 18 Medium
Method integrationTests.IfElseStatements.singleLineIfAndElse(boolean) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 56 Medium
Self assignment of x in integrationTests.IfElseStatements.returnInput(int, boolean, boolean, boolean) STYLE SA_LOCAL_SELF_ASSIGNMENT 147 High
Unread field: integrationTests.IfElseStatements.instanceField PERFORMANCE URF_UNREAD_FIELD 336 Medium

integrationTests.IfElseStatementsTest

Bug Category Details Line Priority
Return value of IfElseStatements.ifElseWithComplexBooleanCondition(boolean, boolean) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 121 Medium
Return value of IfElseStatements.yetAnotherSingleLineIfAndElse(boolean) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 61 Medium
Return value of IfElseStatements.anotherSingleLineIfAndElse(boolean) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 53 Medium

integrationTests.InterfaceWithExecutableCode

Bug Category Details Line Priority
Random object created and used only once in integrationTests.InterfaceWithExecutableCode.<static initializer for InterfaceWithExecutableCode>() BAD_PRACTICE DMI_RANDOM_USED_ONLY_ONCE 12 High

integrationTests.InterfaceWithExecutableCodeTest

Bug Category Details Line Priority
Unused field: integrationTests.InterfaceWithExecutableCodeTest.tested PERFORMANCE UUF_UNUSED_FIELD Not available Medium

integrationTests.MiscellaneousTest

Bug Category Details Line Priority
Method integrationTests.MiscellaneousTest.methodWithIINCWideInstruction() seems to be useless STYLE UC_USELESS_VOID_METHOD 25 Medium

integrationTests.MultiThreadedCode

Bug Category Details Line Priority
Return value of new MultiThreadedCode$1() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 14 Medium
Method integrationTests.MultiThreadedCode.lambda$nonBlockingOperation$0() uses a Side Effect Constructor STYLE SEC_SIDE_EFFECT_CONSTRUCTOR 14 Medium

integrationTests.MultiThreadedCodeTest

Bug Category Details Line Priority
Unused field: integrationTests.MultiThreadedCodeTest.tested PERFORMANCE UUF_UNUSED_FIELD Not available Medium

integrationTests.UnreachableStatements

Bug Category Details Line Priority
integrationTests.UnreachableStatements.branchingMethodWithUnreachableLines(int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 26 High
integrationTests.UnreachableStatements.nonBranchingMethodWithUnreachableLines() forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 14 High
Method integrationTests.UnreachableStatements.branchingMethodWithUnreachableLines(int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 29 Medium

integrationTests.data.ClassWithFieldsAccessedByMultipleTestsTest

Bug Category Details Line Priority
Return value of ClassWithFieldsAccessedByMultipleTests.getInstanceField2() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 62 Medium
Return value of ClassWithFieldsAccessedByMultipleTests.isStaticField2() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 30 Medium
Return value of ClassWithFieldsAccessedByMultipleTests.getInstanceField1() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 50 Medium
Return value of ClassWithFieldsAccessedByMultipleTests.isStaticField1() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 18 Medium

integrationTests.data.ClassWithFieldsTest

Bug Category Details Line Priority
Method integrationTests.data.ClassWithFieldsTest.setInstance2() needlessly boxes a boolean constant PERFORMANCE NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION 46 Medium

integrationTests.data.ClassWithInstanceFields

Bug Category Details Line Priority
integrationTests.data.ClassWithInstanceFields.getArrayField() may expose internal representation by returning ClassWithInstanceFields.arrayField MALICIOUS_CODE EI_EXPOSE_REP 90 Medium
integrationTests.data.ClassWithInstanceFields.setArrayField(int[]) may expose internal representation by storing an externally mutable object into ClassWithInstanceFields.arrayField MALICIOUS_CODE EI_EXPOSE_REP2 94 Medium
Primitive field integrationTests.data.ClassWithInstanceFields.shortField is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility. BAD_PRACTICE PA_PUBLIC_PRIMITIVE_ATTRIBUTE 54 Medium
Unread public/protected field: integrationTests.data.ClassWithInstanceFields.shortField STYLE URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD 54 Medium

integrationTests.loops.ForStatements

Bug Category Details Line Priority
integrationTests.loops.ForStatements.forInSeparateLines() forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 10 High
integrationTests.loops.ForStatements.forInSingleLine(int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 16 High
integrationTests.loops.ForStatements.forEachCollectionElement(List): 1st parameter 'values' could be declared as java.lang.Iterable instead STYLE OCP_OVERLY_CONCRETE_PARAMETER 31 Medium
integrationTests.loops.ForStatements.nestedFor(List): 1st parameter 'list' could be declared as java.lang.Iterable instead STYLE OCP_OVERLY_CONCRETE_PARAMETER 66 Medium
Method integrationTests.loops.ForStatements.nestedFor(List) seems to be useless STYLE UC_USELESS_VOID_METHOD 71 High

integrationTests.loops.ForStatementsTest

Bug Category Details Line Priority
Return value of ForStatements.forWithNestedIfWhichReturns(int, int[]) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 79 Medium

integrationTests.loops.WhileStatements

Bug Category Details Line Priority
Method integrationTests.loops.WhileStatements.bothKindsOfWhileCombined(int, int) seems to be useless STYLE UC_USELESS_VOID_METHOD 80 Medium
Method integrationTests.loops.WhileStatements.nestedWhile(int, int) seems to be useless STYLE UC_USELESS_VOID_METHOD 58 Medium

integrationTests.loops.WhileStatementsTest

Bug Category Details Line Priority
Return value of WhileStatements.whileWithBreak(int) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 59 Medium
Return value of WhileStatements.whileWithContinue(int) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 44 Medium

integrationTests.otherControlStructures.SwitchStatements

Bug Category Details Line Priority
integrationTests.otherControlStructures.SwitchStatements.anotherSwitchStatementWithCompactCasesAndDefault(int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 53 High
integrationTests.otherControlStructures.SwitchStatements.anotherSwitchStatementWithSparseCasesAndDefault(char) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 25 High
integrationTests.otherControlStructures.SwitchStatements.switchStatementWithCompactCasesAndDefault(int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 35 High
integrationTests.otherControlStructures.SwitchStatements.switchStatementWithCompactCasesAndNoDefault(int) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 75 High
integrationTests.otherControlStructures.SwitchStatements.switchStatementWithSparseCasesAndDefault(char) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 7 High
integrationTests.otherControlStructures.SwitchStatements.switchStatementWithSparseCasesAndNoDefault(char) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 62 High
Method integrationTests.otherControlStructures.SwitchStatements.anotherSwitchStatementWithCompactCasesAndDefault(int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 54 Medium
Method integrationTests.otherControlStructures.SwitchStatements.anotherSwitchStatementWithSparseCasesAndDefault(char) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 28 Medium
Method integrationTests.otherControlStructures.SwitchStatements.switchStatementWithCompactCasesAndDefault(int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 40 Medium
Method integrationTests.otherControlStructures.SwitchStatements.switchStatementWithCompactCasesAndNoDefault(int) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 76 Medium
Method integrationTests.otherControlStructures.SwitchStatements.switchStatementWithSparseCasesAndDefault(char) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 12 Medium
Method integrationTests.otherControlStructures.SwitchStatements.switchStatementWithSparseCasesAndNoDefault(char) triggers finalization when calling System.runFinalization() CORRECTNESS MDM_RUNFINALIZATION 65 Medium
Switch statement found in integrationTests.otherControlStructures.SwitchStatements.switchStatementWithCompactCasesAndNoDefault(int) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 74-77 Medium
Switch statement found in integrationTests.otherControlStructures.SwitchStatements.switchStatementWithSparseCasesAndNoDefault(char) where default case is missing STYLE SF_SWITCH_NO_DEFAULT 60-65 Medium
Method integrationTests.otherControlStructures.SwitchStatements.switchStatementWithCompactCasesAndNoDefault(int) stores return result in local before immediately returning it STYLE USBR_UNNECESSARY_STORE_BEFORE_RETURN 81 Medium

integrationTests.otherControlStructures.SwitchStatementsTest

Bug Category Details Line Priority
Return value of SwitchStatements.switchOnString(String, boolean) ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 94 Medium

integrationTests.otherControlStructures.SynchronizedBlocks

Bug Category Details Line Priority
Method integrationTests.otherControlStructures.SynchronizedBlocks.doInSynchronizedBlock() ignores return value of a non mutating method CORRECTNESS NPMC_NON_PRODUCTIVE_METHOD_CALL 13 Medium

integrationTests.otherControlStructures.TryCatchFinallyStatements

Bug Category Details Line Priority
integrationTests.otherControlStructures.TryCatchFinallyStatements.regularTryFinally(boolean) forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 27 High
integrationTests.otherControlStructures.TryCatchFinallyStatements.tryCatch() forces garbage collection; extremely dubious except in benchmarking code PERFORMANCE DM_GC 6 High
Method integrationTests.otherControlStructures.TryCatchFinallyStatements.tryCatch() prints the stack trace to the console STYLE IMC_IMMATURE_CLASS_PRINTSTACKTRACE 8 Medium
Method integrationTests.otherControlStructures.TryCatchFinallyStatements.finallyBlockContainingIfWithBodyInSameLine() ignores return value of a non mutating method CORRECTNESS NPMC_NON_PRODUCTIVE_METHOD_CALL 70 Medium
Method integrationTests.otherControlStructures.TryCatchFinallyStatements.finallyBlockContainingIfWithBodyInSameLine() ignores return value of a non mutating method CORRECTNESS NPMC_NON_PRODUCTIVE_METHOD_CALL 73 Medium
Return value of Object.toString() ignored, but method has no side effect STYLE RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT 73 Medium
Method integrationTests.otherControlStructures.TryCatchFinallyStatements.finallyBlockContainingIfWithBodyInSameLine() calls toString() on an instance of a class that hasn't overridden toString() STYLE SPP_NON_USEFUL_TOSTRING 70 Medium