SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.8.6

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
66 41 0 0

Files

Class Bugs
org.opentrafficsim.demo.CircularRoadModel 4
org.opentrafficsim.demo.CircularRoadSwing 2
org.opentrafficsim.demo.InputParameterHelper 1
org.opentrafficsim.demo.NetworksModel 3
org.opentrafficsim.demo.NetworksSwing 1
org.opentrafficsim.demo.ParseXml 3
org.opentrafficsim.demo.RampMeteringDemo 4
org.opentrafficsim.demo.RampMeteringDemo$ControlledTacticalPlanner 2
org.opentrafficsim.demo.ShortMerge$ShortMergeModel 4
org.opentrafficsim.demo.StraightModel 2
org.opentrafficsim.demo.conflict.TJunctionDemo$TJunctionModel 2
org.opentrafficsim.demo.conflict.TurboRoundaboutDemo$TurboRoundaboutModel 2
org.opentrafficsim.demo.fd.FundamentalDiagramDemo 1
org.opentrafficsim.demo.fd.FundamentalDiagramDemo$SwingFundamentalDiagramNoControl 1
org.opentrafficsim.demo.fd.FundamentalDiagramModel 1
org.opentrafficsim.demo.loadfromxml.LoadXml 2
org.opentrafficsim.demo.strategies.StrategiesDemo 2
org.opentrafficsim.demo.strategies.StrategiesDemo$LmrsStrategiesPerceptionFactory 1
org.opentrafficsim.demo.strategies.StrategiesDemo$SocioIDMFactory 1
org.opentrafficsim.demo.trafficcontrol.TrafCodDemo2 1
org.opentrafficsim.demo.trafficcontrol.TrafCodDemo2$TrafCodModel 1

org.opentrafficsim.demo.CircularRoadModel

Bug Category Details Line Priority
Random object created and used only once in org.opentrafficsim.demo.CircularRoadModel.constructModel() BAD_PRACTICE DMI_RANDOM_USED_ONLY_ONCE 251 High
org.opentrafficsim.demo.CircularRoadModel.getMinimumDistance() may expose internal representation by returning CircularRoadModel.minimumDistance MALICIOUS_CODE EI_EXPOSE_REP 318 Medium
org.opentrafficsim.demo.CircularRoadModel.getNetwork() may expose internal representation by returning CircularRoadModel.network MALICIOUS_CODE EI_EXPOSE_REP 310 Medium
Exception is caught when Exception is not thrown in org.opentrafficsim.demo.CircularRoadModel.constructModel() STYLE REC_CATCH_EXCEPTION 258 Medium

org.opentrafficsim.demo.CircularRoadSwing

Bug Category Details Line Priority
Useless object stored in variable lanes of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) STYLE UC_USELESS_OBJECT 336 Medium
Useless object stored in variable positions of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) STYLE UC_USELESS_OBJECT 337 Medium

org.opentrafficsim.demo.InputParameterHelper

Bug Category Details Line Priority
new org.opentrafficsim.demo.InputParameterHelper(InputParameterMap) may expose internal representation by storing an externally mutable object into InputParameterHelper.rootMap MALICIOUS_CODE EI_EXPOSE_REP2 41 Medium

org.opentrafficsim.demo.NetworksModel

Bug Category Details Line Priority
org.opentrafficsim.demo.NetworksModel.getMaximumDistance() may expose internal representation by returning NetworksModel.maximumDistance MALICIOUS_CODE EI_EXPOSE_REP 570 Medium
org.opentrafficsim.demo.NetworksModel.getMinimumDistance() may expose internal representation by returning NetworksModel.minimumDistance MALICIOUS_CODE EI_EXPOSE_REP 562 Medium
org.opentrafficsim.demo.NetworksModel.getNetwork() may expose internal representation by returning NetworksModel.network MALICIOUS_CODE EI_EXPOSE_REP 536 Medium

org.opentrafficsim.demo.NetworksSwing

Bug Category Details Line Priority
Integer remainder modulo 1 computed in org.opentrafficsim.demo.NetworksSwing.addStatisticsTabs(OtsSimulatorInterface) STYLE INT_BAD_REM_BY_1 151 High

org.opentrafficsim.demo.ParseXml

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.demo.ParseXml at new org.opentrafficsim.demo.ParseXml() will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 39 Medium
Hard coded reference to an absolute pathname in new org.opentrafficsim.demo.ParseXml() STYLE DMI_HARDCODED_ABSOLUTE_FILENAME 39 Medium
org.opentrafficsim.demo.ParseXml.domTree(String) may fail to clean up java.io.InputStream EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 45 Medium

org.opentrafficsim.demo.RampMeteringDemo

Bug Category Details Line Priority
Dead store to lanesBC in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE DLS_DEAD_LOCAL_STORE 289 Medium
Dead store to lanesFB in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE DLS_DEAD_LOCAL_STORE 298 Medium
Boxing/unboxing to parse a primitive org.opentrafficsim.demo.RampMeteringDemo.arrayFromString(String) PERFORMANCE DM_BOXED_PRIMITIVE_FOR_PARSING 239 High
Useless object stored in variable detectors34 of method org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE UC_USELESS_OBJECT 315 Medium

org.opentrafficsim.demo.RampMeteringDemo$ControlledTacticalPlanner

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.demo.RampMeteringDemo$ControlledTacticalPlanner at new org.opentrafficsim.demo.RampMeteringDemo$ControlledTacticalPlanner(LaneBasedGtu, RampMeteringDemo$AutomaticLaneChangeSystem) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 584 Medium
Class org.opentrafficsim.demo.RampMeteringDemo$ControlledTacticalPlanner defines non-transient non-serializable instance field laneChangeSystem BAD_PRACTICE SE_BAD_FIELD Not available Medium

org.opentrafficsim.demo.ShortMerge$ShortMergeModel

Bug Category Details Line Priority
Hard coded reference to an absolute pathname in org.opentrafficsim.demo.ShortMerge$ShortMergeModel.constructModel() STYLE DMI_HARDCODED_ABSOLUTE_FILENAME 273 Medium
org.opentrafficsim.demo.ShortMerge$ShortMergeModel.getNetwork() may expose internal representation by returning ShortMerge$ShortMergeModel.network MALICIOUS_CODE EI_EXPOSE_REP 289 Medium
org.opentrafficsim.demo.ShortMerge$ShortMergeModel.setNetwork(RoadNetwork) may expose internal representation by storing an externally mutable object into ShortMerge$ShortMergeModel.network MALICIOUS_CODE EI_EXPOSE_REP2 264 Medium
Bad attempt to compute absolute value of signed random integer in org.opentrafficsim.demo.ShortMerge$ShortMergeModel.addGenerator() CORRECTNESS RV_ABSOLUTE_VALUE_OF_RANDOM_INT 307 High

org.opentrafficsim.demo.StraightModel

Bug Category Details Line Priority
org.opentrafficsim.demo.StraightModel.getNetwork() may expose internal representation by returning StraightModel.network MALICIOUS_CODE EI_EXPOSE_REP 220 Medium
org.opentrafficsim.demo.StraightModel.getPath() may expose internal representation by returning StraightModel.path MALICIOUS_CODE EI_EXPOSE_REP 228 Medium

org.opentrafficsim.demo.conflict.TJunctionDemo$TJunctionModel

Bug Category Details Line Priority
Hard coded reference to an absolute pathname in org.opentrafficsim.demo.conflict.TJunctionDemo$TJunctionModel.constructModel() STYLE DMI_HARDCODED_ABSOLUTE_FILENAME 111 Medium
org.opentrafficsim.demo.conflict.TJunctionDemo$TJunctionModel.getNetwork() may expose internal representation by returning TJunctionDemo$TJunctionModel.network MALICIOUS_CODE EI_EXPOSE_REP 125 Medium

org.opentrafficsim.demo.conflict.TurboRoundaboutDemo$TurboRoundaboutModel

Bug Category Details Line Priority
Hard coded reference to an absolute pathname in org.opentrafficsim.demo.conflict.TurboRoundaboutDemo$TurboRoundaboutModel.constructModel() STYLE DMI_HARDCODED_ABSOLUTE_FILENAME 111 Medium
org.opentrafficsim.demo.conflict.TurboRoundaboutDemo$TurboRoundaboutModel.getNetwork() may expose internal representation by returning TurboRoundaboutDemo$TurboRoundaboutModel.network MALICIOUS_CODE EI_EXPOSE_REP 125 Medium

org.opentrafficsim.demo.fd.FundamentalDiagramDemo

Bug Category Details Line Priority
org.opentrafficsim.swing.graphs.OtsPlotScheduler stored into non-transient field FundamentalDiagramDemo.scheduler BAD_PRACTICE SE_BAD_FIELD_STORE 572 Medium

org.opentrafficsim.demo.fd.FundamentalDiagramDemo$SwingFundamentalDiagramNoControl

Bug Category Details Line Priority
Should org.opentrafficsim.demo.fd.FundamentalDiagramDemo$SwingFundamentalDiagramNoControl be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 800-809 Medium

org.opentrafficsim.demo.fd.FundamentalDiagramModel

Bug Category Details Line Priority
org.opentrafficsim.demo.fd.FundamentalDiagramModel.getNetwork() may expose internal representation by returning FundamentalDiagramModel.network MALICIOUS_CODE EI_EXPOSE_REP 41 Medium

org.opentrafficsim.demo.loadfromxml.LoadXml

Bug Category Details Line Priority
Dead store to $L7 in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]) STYLE DLS_DEAD_LOCAL_STORE 140 High
Found reliance on default encoding in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]): new String(byte[]) I18N DM_DEFAULT_ENCODING 128 High

org.opentrafficsim.demo.strategies.StrategiesDemo

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.demo.strategies.StrategiesDemo at new org.opentrafficsim.demo.strategies.StrategiesDemo() will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 179 Medium
Integral division result cast to double or float in org.opentrafficsim.demo.strategies.StrategiesDemo.setupSimulation(OtsSimulatorInterface) STYLE ICAST_IDIV_CAST_TO_DOUBLE 572 Medium

org.opentrafficsim.demo.strategies.StrategiesDemo$LmrsStrategiesPerceptionFactory

Bug Category Details Line Priority
Should org.opentrafficsim.demo.strategies.StrategiesDemo$LmrsStrategiesPerceptionFactory be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 669-689 Medium

org.opentrafficsim.demo.strategies.StrategiesDemo$SocioIDMFactory

Bug Category Details Line Priority
Should org.opentrafficsim.demo.strategies.StrategiesDemo$SocioIDMFactory be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 649-664 Medium

org.opentrafficsim.demo.trafficcontrol.TrafCodDemo2

Bug Category Details Line Priority
Hard coded reference to an absolute pathname in org.opentrafficsim.demo.trafficcontrol.TrafCodDemo2.demo(boolean) STYLE DMI_HARDCODED_ABSOLUTE_FILENAME 104 Medium

org.opentrafficsim.demo.trafficcontrol.TrafCodDemo2$TrafCodModel

Bug Category Details Line Priority
org.opentrafficsim.demo.trafficcontrol.TrafCodDemo2$TrafCodModel.getNetwork() may expose internal representation by returning TrafCodDemo2$TrafCodModel.network MALICIOUS_CODE EI_EXPOSE_REP 204 Medium