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 |
| 65 |
30 |
1 |
0 |
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 |
244 |
High |
| org.opentrafficsim.demo.CircularRoadModel.getMinimumDistance() may expose internal representation by returning CircularRoadModel.minimumDistance |
MALICIOUS_CODE |
EI_EXPOSE_REP |
310 |
Medium |
| org.opentrafficsim.demo.CircularRoadModel.getNetwork() may expose internal representation by returning CircularRoadModel.network |
MALICIOUS_CODE |
EI_EXPOSE_REP |
301 |
Medium |
| Exception is caught when Exception is not thrown in org.opentrafficsim.demo.CircularRoadModel.constructModel() |
STYLE |
REC_CATCH_EXCEPTION |
250 |
Medium |
org.opentrafficsim.demo.CircularRoadSwing
| Bug |
Category |
Details |
Line |
Priority |
| Dead store to network in new org.opentrafficsim.demo.CircularRoadSwing(String, OtsAnimationPanel, CircularRoadModel) |
STYLE |
DLS_DEAD_LOCAL_STORE |
73 |
Medium |
| Useless object stored in variable lanes of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) |
STYLE |
UC_USELESS_OBJECT |
169 |
Medium |
| Useless object stored in variable positions of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) |
STYLE |
UC_USELESS_OBJECT |
170 |
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 |
160 |
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 |
544 |
Medium |
| org.opentrafficsim.demo.NetworksModel.getMinimumDistance() may expose internal representation by returning NetworksModel.minimumDistance |
MALICIOUS_CODE |
EI_EXPOSE_REP |
535 |
Medium |
| org.opentrafficsim.demo.NetworksModel.getNetwork() may expose internal representation by returning NetworksModel.network |
MALICIOUS_CODE |
EI_EXPOSE_REP |
507 |
Medium |
org.opentrafficsim.demo.NetworksSwing
| Bug |
Category |
Details |
Line |
Priority |
| Dead store to network in new org.opentrafficsim.demo.NetworksSwing(String, OtsAnimationPanel, NetworksModel) |
STYLE |
DLS_DEAD_LOCAL_STORE |
69 |
Medium |
| Integer remainder modulo 1 computed in org.opentrafficsim.demo.NetworksSwing.addStatisticsTabs(OtsSimulatorInterface) |
STYLE |
INT_BAD_REM_BY_1 |
149 |
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 |
216 |
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 |
289 |
Medium |
| Dead store to lanesFB in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) |
STYLE |
DLS_DEAD_LOCAL_STORE |
299 |
Medium |
| Boxing/unboxing to parse a primitive org.opentrafficsim.demo.RampMeteringDemo.arrayFromString(String) |
PERFORMANCE |
DM_BOXED_PRIMITIVE_FOR_PARSING |
243 |
High |
| Useless object stored in variable detectors34 of method org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) |
STYLE |
UC_USELESS_OBJECT |
316 |
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 |
259 |
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 |
209 |
Medium |
| org.opentrafficsim.demo.StraightModel.getPath() may expose internal representation by returning StraightModel.path |
MALICIOUS_CODE |
EI_EXPOSE_REP |
218 |
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 |
792-800 |
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 |
141 |
High |
| Found reliance on default encoding in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]): new String(byte[]) |
I18N |
DM_DEFAULT_ENCODING |
127 |
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 |
144 |
Medium |
| Integral division result cast to double or float in org.opentrafficsim.demo.strategies.StrategiesDemo.setupSimulation(OtsSimulatorInterface) |
STYLE |
ICAST_IDIV_CAST_TO_DOUBLE |
502 |
Medium |