SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.1.4

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
33 19 0 0

Files

Class Bugs
org.opentrafficsim.trafficcontrol.FixedTimeController 2
org.opentrafficsim.trafficcontrol.FixedTimeController$Flank 3
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup 1
org.opentrafficsim.trafficcontrol.ccol.CCOL 4
org.opentrafficsim.trafficcontrol.trafcod.Diagram 1
org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep 1
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD 5
org.opentrafficsim.trafficcontrol.trafcod.Variable 2

org.opentrafficsim.trafficcontrol.FixedTimeController

Bug Category Details Line Priority
new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OTSSimulatorInterface, Network, Duration, Duration, Set) concatenates strings using + in a loop PERFORMANCE SBSC_USE_STRINGBUFFER_CONCATENATION 201 Medium
new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OTSSimulatorInterface, Network, Duration, Duration, Set) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 116 Medium

org.opentrafficsim.trafficcontrol.FixedTimeController$Flank

Bug Category Details Line Priority
org.opentrafficsim.trafficcontrol.FixedTimeController$Flank.compareTo(FixedTimeController$Flank) incorrectly handles double value BAD_PRACTICE CO_COMPARETO_INCORRECT_FLOATING 764 Medium
org.opentrafficsim.trafficcontrol.FixedTimeController$Flank defines compareTo(FixedTimeController$Flank) and uses Object.equals() BAD_PRACTICE EQ_COMPARETO_USE_OBJECT_EQUALS 755-776 Medium
Should org.opentrafficsim.trafficcontrol.FixedTimeController$Flank be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 706-776 Medium

org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup

Bug Category Details Line Priority
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup defines clone() but doesn't implement Cloneable BAD_PRACTICE CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE 583 High

org.opentrafficsim.trafficcontrol.ccol.CCOL

Bug Category Details Line Priority
Dead store to $L2 in org.opentrafficsim.trafficcontrol.ccol.CCOL.step() STYLE DLS_DEAD_LOCAL_STORE 181 Medium
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.ccol.CCOL.setClientSocket(Socket): new java.io.InputStreamReader(InputStream) I18N DM_DEFAULT_ENCODING 141 High
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.ccol.CCOL.setClientSocket(Socket): new java.io.PrintWriter(OutputStream) I18N DM_DEFAULT_ENCODING 142 High
new org.opentrafficsim.trafficcontrol.ccol.CCOL(String, String, Set, Set, DEVSSimulator) invokes Thread.start() MT_CORRECTNESS SC_START_IN_CTOR 115 Medium

org.opentrafficsim.trafficcontrol.trafcod.Diagram

Bug Category Details Line Priority
Integer is incompatible with expected argument type Short in org.opentrafficsim.trafficcontrol.trafcod.Diagram.routePoint(int, Diagram$RouteStep[]) CORRECTNESS GC_UNRELATED_TYPES 691 High

org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep

Bug Category Details Line Priority
Should org.opentrafficsim.trafficcontrol.trafcod.Diagram$RouteStep be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 419-522 Medium

org.opentrafficsim.trafficcontrol.trafcod.TrafCOD

Bug Category Details Line Priority
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.loadTextFromURL(URL): new java.io.InputStreamReader(InputStream) I18N DM_DEFAULT_ENCODING 240 High
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.evalRule(Object[]) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead PERFORMANCE DM_NUMBER_CTOR 886 Medium
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.parse(String, String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead PERFORMANCE DM_NUMBER_CTOR 1526 Medium
v could be null and is guaranteed to be dereferenced in org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.notify(EventInterface) CORRECTNESS NP_GUARANTEED_DEREF 1848 High
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.loadTextFromURL(URL) may fail to close stream BAD_PRACTICE OS_OPEN_STREAM 240 Medium

org.opentrafficsim.trafficcontrol.trafcod.Variable

Bug Category Details Line Priority
Load of known null value in org.opentrafficsim.trafficcontrol.trafcod.Variable.cloneState(Variable, Network) STYLE NP_LOAD_OF_KNOWN_NULL_VALUE 2432 Medium
A known null value is checked to see if it is an instance of org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight in org.opentrafficsim.trafficcontrol.trafcod.Variable.cloneState(Variable, Network) CORRECTNESS NP_NULL_INSTANCEOF 2432 Medium