The following document contains the results of SpotBugs
SpotBugs Version is 4.7.1
Threshold is medium
Effort is default
Classes | Bugs | Errors | Missing Classes |
---|---|---|---|
36 | 39 | 0 | 0 |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.trafficcontrol.FixedTimeController.getCycleTime() may expose internal representation by returning FixedTimeController.cycleTime | MALICIOUS_CODE | EI_EXPOSE_REP | 320 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.getOffset() may expose internal representation by returning FixedTimeController.offset | MALICIOUS_CODE | EI_EXPOSE_REP | 328 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController.getSignalGroups() may expose internal representation by returning FixedTimeController.signalGroups | MALICIOUS_CODE | EI_EXPOSE_REP | 336 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OTSSimulatorInterface, Network, Duration, Duration, Set) may expose internal representation by storing an externally mutable object into FixedTimeController.cycleTime | MALICIOUS_CODE | EI_EXPOSE_REP2 | 94 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController(String, OTSSimulatorInterface, Network, Duration, Duration, Set) may expose internal representation by storing an externally mutable object into FixedTimeController.offset | MALICIOUS_CODE | EI_EXPOSE_REP2 | 95 | 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 |
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 |
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.FixedTimeController$SignalGroup.getGreen() may expose internal representation by returning FixedTimeController$SignalGroup.green | MALICIOUS_CODE | EI_EXPOSE_REP | 672 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getOffset() may expose internal representation by returning FixedTimeController$SignalGroup.offset | MALICIOUS_CODE | EI_EXPOSE_REP | 656 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getPreGreen() may expose internal representation by returning FixedTimeController$SignalGroup.preGreen | MALICIOUS_CODE | EI_EXPOSE_REP | 664 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getRed() may expose internal representation by returning FixedTimeController$SignalGroup.red | MALICIOUS_CODE | EI_EXPOSE_REP | 640 | Medium |
org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup.getYellow() may expose internal representation by returning FixedTimeController$SignalGroup.yellow | MALICIOUS_CODE | EI_EXPOSE_REP | 680 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.green | MALICIOUS_CODE | EI_EXPOSE_REP2 | 434 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.offset | MALICIOUS_CODE | EI_EXPOSE_REP2 | 432 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.preGreen | MALICIOUS_CODE | EI_EXPOSE_REP2 | 433 | Medium |
new org.opentrafficsim.trafficcontrol.FixedTimeController$SignalGroup(String, Set, Duration, Duration, Duration, Duration) may expose internal representation by storing an externally mutable object into FixedTimeController$SignalGroup.yellow | MALICIOUS_CODE | EI_EXPOSE_REP2 | 435 | Medium |
Using floating-point loop counters can lead to unexpected behavior. | CORRECTNESS | FL_FLOATS_AS_LOOP_COUNTERS | 462 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Dead store to $L2 in org.opentrafficsim.trafficcontrol.ccol.CCOL.step() | STYLE | DLS_DEAD_LOCAL_STORE | 179 | Medium |
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.ccol.CCOL.setClientSocket(Socket): new java.io.InputStreamReader(InputStream) | I18N | DM_DEFAULT_ENCODING | 139 | High |
Found reliance on default encoding in org.opentrafficsim.trafficcontrol.ccol.CCOL.setClientSocket(Socket): new java.io.PrintWriter(OutputStream) | I18N | DM_DEFAULT_ENCODING | 140 | High |
new org.opentrafficsim.trafficcontrol.ccol.CCOL(String, String, Set, Set, OTSSimulator) may expose internal representation by storing an externally mutable object into CCOL.simulator | MALICIOUS_CODE | EI_EXPOSE_REP2 | 92 | Medium |
new org.opentrafficsim.trafficcontrol.ccol.CCOL(String, String, Set, Set, OTSSimulator) invokes Thread.start() | MT_CORRECTNESS | SC_START_IN_CTOR | 113 | Medium |
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 |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Write to static field org.opentrafficsim.trafficcontrol.trafcod.Diagram.checkBoxPanel from instance method org.opentrafficsim.trafficcontrol.trafcod.Diagram$2.run() | STYLE | ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD | 815 | Medium |
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 |
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 | 237 | High |
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.parse(String, String) invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead | PERFORMANCE | DM_NUMBER_CTOR | 1523 | Medium |
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.getDisplayContainer() may expose internal representation by returning TrafCOD.displayContainer | MALICIOUS_CODE | EI_EXPOSE_REP | 1896 | Medium |
new org.opentrafficsim.trafficcontrol.trafcod.TrafCOD(String, List, OTSSimulatorInterface, BufferedImage, List) may expose internal representation by storing an externally mutable object into TrafCOD.displayBackground | MALICIOUS_CODE | EI_EXPOSE_REP2 | 190 | Medium |
new org.opentrafficsim.trafficcontrol.trafcod.TrafCOD(String, List, OTSSimulatorInterface, BufferedImage, List) may expose internal representation by storing an externally mutable object into TrafCOD.displayObjectLocations | MALICIOUS_CODE | EI_EXPOSE_REP2 | 191 | Medium |
new org.opentrafficsim.trafficcontrol.trafcod.TrafCOD(String, List, OTSSimulatorInterface, BufferedImage, List) may expose internal representation by storing an externally mutable object into TrafCOD.trafCODRules | MALICIOUS_CODE | EI_EXPOSE_REP2 | 193 | Medium |
v could be null and is guaranteed to be dereferenced in org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.notify(EventInterface) | CORRECTNESS | NP_GUARANTEED_DEREF | 1845 | High |
org.opentrafficsim.trafficcontrol.trafcod.TrafCOD.loadTextFromURL(URL) may fail to close stream | BAD_PRACTICE | OS_OPEN_STREAM | 237 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.trafficcontrol.trafcod.TrafCODDisplay(BufferedImage) may expose internal representation by storing an externally mutable object into TrafCODDisplay.image | MALICIOUS_CODE | EI_EXPOSE_REP2 | 65 | Medium |
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 | 2429 | 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 | 2429 | Medium |