SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.9.1

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
75 29 1 0

Files

Class Bugs
org.opentrafficsim.demo.CircularRoadModel 5
org.opentrafficsim.demo.CircularRoadSwing 2
org.opentrafficsim.demo.HumanFactorsDemo$HumanFactorsModel 1
org.opentrafficsim.demo.InputParameterHelper 1
org.opentrafficsim.demo.NetworksModel 4
org.opentrafficsim.demo.NetworksSwing 1
org.opentrafficsim.demo.NetworksSwing$NetworksParameterDialog 1
org.opentrafficsim.demo.ParseXml 2
org.opentrafficsim.demo.RampMeteringDemo 3
org.opentrafficsim.demo.ShortMerge$ShortMergeModel 1
org.opentrafficsim.demo.StraightModel 2
org.opentrafficsim.demo.StraightSwing$1 1
org.opentrafficsim.demo.fd.FundamentalDiagramModel 1
org.opentrafficsim.demo.loadfromxml.LoadXml 2
org.opentrafficsim.demo.strategies.StrategiesDemo 2

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 257 High
org.opentrafficsim.demo.CircularRoadModel.getMinimumDistance() may expose internal representation by returning CircularRoadModel.minimumDistance MALICIOUS_CODE EI_EXPOSE_REP 323 Medium
org.opentrafficsim.demo.CircularRoadModel.getNetwork() may expose internal representation by returning CircularRoadModel.network MALICIOUS_CODE EI_EXPOSE_REP 314 Medium
org.opentrafficsim.demo.CircularRoadModel.getPaths() may expose internal representation by returning CircularRoadModel.paths MALICIOUS_CODE EI_EXPOSE_REP 162 Medium
Exception is caught when Exception is not thrown in org.opentrafficsim.demo.CircularRoadModel.constructModel() STYLE REC_CATCH_EXCEPTION 263 Medium

org.opentrafficsim.demo.CircularRoadSwing

Bug Category Details Line Priority
Useless object stored in variable lanes of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulationPanel, Network, List) STYLE UC_USELESS_OBJECT 170 Medium
Useless object stored in variable positions of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulationPanel, Network, List) STYLE UC_USELESS_OBJECT 171 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 167 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 43 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 553 Medium
org.opentrafficsim.demo.NetworksModel.getMinimumDistance() may expose internal representation by returning NetworksModel.minimumDistance MALICIOUS_CODE EI_EXPOSE_REP 544 Medium
org.opentrafficsim.demo.NetworksModel.getNetwork() may expose internal representation by returning NetworksModel.network MALICIOUS_CODE EI_EXPOSE_REP 507 Medium
org.opentrafficsim.demo.NetworksModel.getPaths() may expose internal representation by returning NetworksModel.paths MALICIOUS_CODE EI_EXPOSE_REP 535 Medium

org.opentrafficsim.demo.NetworksSwing

Bug Category Details Line Priority
Integer remainder modulo 1 computed in org.opentrafficsim.demo.NetworksSwing.addStatisticsTabs(OtsSimulationPanel, Network, List) STYLE INT_BAD_REM_BY_1 152 High

org.opentrafficsim.demo.NetworksSwing$NetworksParameterDialog

Bug Category Details Line Priority
The method 'process(InputParameterMap)' in class 'NetworksParameterDialog' hides a method in class 'TabbedParameterDialog'. Declare the respective methods non-static or private to eradicate the problem. CORRECTNESS HSM_HIDING_METHOD 219 Medium

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 40 Medium
org.opentrafficsim.demo.ParseXml.domTree(String) may fail to clean up java.io.InputStream EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 51 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 291 Medium
Dead store to lanesFB in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE DLS_DEAD_LOCAL_STORE 301 Medium
Useless object stored in variable detectors34 of method org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) STYLE UC_USELESS_OBJECT 318 Medium

org.opentrafficsim.demo.ShortMerge$ShortMergeModel

Bug Category Details Line Priority
Bad attempt to compute absolute value of signed random integer in org.opentrafficsim.demo.ShortMerge$ShortMergeModel.addGenerator() CORRECTNESS RV_ABSOLUTE_VALUE_OF_RANDOM_INT 267 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 210 Medium
org.opentrafficsim.demo.StraightModel.getPath() may expose internal representation by returning StraightModel.path MALICIOUS_CODE EI_EXPOSE_REP 219 Medium

org.opentrafficsim.demo.StraightSwing$1

Bug Category Details Line Priority
Unchecked/unconfirmed cast from org.opentrafficsim.core.network.Network to org.opentrafficsim.road.network.RoadNetwork in org.opentrafficsim.demo.StraightSwing$1.addTabs(OtsSimulationPanel, Network) STYLE BC_UNCONFIRMED_CAST 94 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 38 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 138 High
Found reliance on default encoding in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]): new String(byte[]) I18N DM_DEFAULT_ENCODING 125 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 148 Medium
Integral division result cast to double or float in org.opentrafficsim.demo.strategies.StrategiesDemo.setupSimulation(OtsSimulatorInterface) STYLE ICAST_IDIV_CAST_TO_DOUBLE 559 Medium