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
72 47 0 0

Files

Class Bugs
org.opentrafficsim.demo.CircularRoadModel 4
org.opentrafficsim.demo.CircularRoadSwing 2
org.opentrafficsim.demo.HumanFactorsDemo$CarFollowingTask 2
org.opentrafficsim.demo.HumanFactorsDemo$HumanFactorsModel 3
org.opentrafficsim.demo.HumanFactorsDemo$TaskManagerAr 1
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 247 High
org.opentrafficsim.demo.CircularRoadModel.getMinimumDistance() may expose internal representation by returning CircularRoadModel.minimumDistance MALICIOUS_CODE EI_EXPOSE_REP 312 Medium
org.opentrafficsim.demo.CircularRoadModel.getNetwork() may expose internal representation by returning CircularRoadModel.network MALICIOUS_CODE EI_EXPOSE_REP 304 Medium
Exception is caught when Exception is not thrown in org.opentrafficsim.demo.CircularRoadModel.constructModel() STYLE REC_CATCH_EXCEPTION 254 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 335 Medium
Useless object stored in variable positions of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) STYLE UC_USELESS_OBJECT 336 Medium

org.opentrafficsim.demo.HumanFactorsDemo$CarFollowingTask

Bug Category Details Line Priority
new org.opentrafficsim.demo.HumanFactorsDemo$CarFollowingTask(HumanFactorsDemo) may expose internal representation by storing an externally mutable object into HumanFactorsDemo$CarFollowingTask.this$0 MALICIOUS_CODE EI_EXPOSE_REP2 550 Medium
Should org.opentrafficsim.demo.HumanFactorsDemo$CarFollowingTask be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 543-567 Medium

org.opentrafficsim.demo.HumanFactorsDemo$HumanFactorsModel

Bug Category Details Line Priority
org.opentrafficsim.demo.HumanFactorsDemo$HumanFactorsModel.getNetwork() may expose internal representation by returning HumanFactorsDemo$HumanFactorsModel.network MALICIOUS_CODE EI_EXPOSE_REP 220 Medium
Class org.opentrafficsim.demo.HumanFactorsDemo$HumanFactorsModel defines non-transient non-serializable instance field characteristics BAD_PRACTICE SE_BAD_FIELD Not available Medium
org.opentrafficsim.road.gtu.generator.characteristics.DefaultLaneBasedGtuCharacteristicsGeneratorOd stored into non-transient field HumanFactorsDemo$HumanFactorsModel.characteristics BAD_PRACTICE SE_BAD_FIELD_STORE 371 Medium

org.opentrafficsim.demo.HumanFactorsDemo$TaskManagerAr

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.demo.HumanFactorsDemo$TaskManagerAr at new org.opentrafficsim.demo.HumanFactorsDemo$TaskManagerAr(String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 498 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 546 Medium
org.opentrafficsim.demo.NetworksModel.getMinimumDistance() may expose internal representation by returning NetworksModel.minimumDistance MALICIOUS_CODE EI_EXPOSE_REP 538 Medium
org.opentrafficsim.demo.NetworksModel.getNetwork() may expose internal representation by returning NetworksModel.network MALICIOUS_CODE EI_EXPOSE_REP 512 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 149 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 286 Medium
Dead store to lanesFB in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE DLS_DEAD_LOCAL_STORE 296 Medium
Boxing/unboxing to parse a primitive org.opentrafficsim.demo.RampMeteringDemo.arrayFromString(String) PERFORMANCE DM_BOXED_PRIMITIVE_FOR_PARSING 238 High
Useless object stored in variable detectors34 of method org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE UC_USELESS_OBJECT 313 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 579 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 269 Medium
org.opentrafficsim.demo.ShortMerge$ShortMergeModel.getNetwork() may expose internal representation by returning ShortMerge$ShortMergeModel.network MALICIOUS_CODE EI_EXPOSE_REP 284 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 261 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 301 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 215 Medium
org.opentrafficsim.demo.StraightModel.getPath() may expose internal representation by returning StraightModel.path MALICIOUS_CODE EI_EXPOSE_REP 223 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 110 Medium
org.opentrafficsim.demo.conflict.TJunctionDemo$TJunctionModel.getNetwork() may expose internal representation by returning TJunctionDemo$TJunctionModel.network MALICIOUS_CODE EI_EXPOSE_REP 123 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 108 Medium
org.opentrafficsim.demo.conflict.TurboRoundaboutDemo$TurboRoundaboutModel.getNetwork() may expose internal representation by returning TurboRoundaboutDemo$TurboRoundaboutModel.network MALICIOUS_CODE EI_EXPOSE_REP 121 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 569 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 796-804 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 40 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 139 High
Found reliance on default encoding in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]): new String(byte[]) I18N DM_DEFAULT_ENCODING 126 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 177 Medium
Integral division result cast to double or float in org.opentrafficsim.demo.strategies.StrategiesDemo.setupSimulation(OtsSimulatorInterface) STYLE ICAST_IDIV_CAST_TO_DOUBLE 576 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-687 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 651-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 203 Medium