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 |
---|---|---|---|
70 | 39 | 0 | 0 |
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 | 252 | High |
org.opentrafficsim.demo.CircularRoadModel.getMinimumDistance() may expose internal representation by returning CircularRoadModel.minimumDistance | MALICIOUS_CODE | EI_EXPOSE_REP | 321 | Medium |
org.opentrafficsim.demo.CircularRoadModel.getNetwork() may expose internal representation by returning CircularRoadModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 313 | Medium |
Using floating-point loop counters can lead to unexpected behavior. | CORRECTNESS | FL_FLOATS_AS_LOOP_COUNTERS | 247 | Medium |
Exception is caught when Exception is not thrown in org.opentrafficsim.demo.CircularRoadModel.constructModel() | STYLE | REC_CATCH_EXCEPTION | 259 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Useless object stored in variable lanes of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) | STYLE | UC_USELESS_OBJECT | 333 | Medium |
Useless object stored in variable positions of method org.opentrafficsim.demo.CircularRoadSwing.addStatisticsTabs(OtsSimulatorInterface) | STYLE | UC_USELESS_OBJECT | 334 | Medium |
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 |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.demo.NetworksModel.getMaximumDistance() may expose internal representation by returning NetworksModel.maximumDistance | MALICIOUS_CODE | EI_EXPOSE_REP | 550 | Medium |
org.opentrafficsim.demo.NetworksModel.getMinimumDistance() may expose internal representation by returning NetworksModel.minimumDistance | MALICIOUS_CODE | EI_EXPOSE_REP | 542 | Medium |
org.opentrafficsim.demo.NetworksModel.getNetwork() may expose internal representation by returning NetworksModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 516 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Integer remainder modulo 1 computed in org.opentrafficsim.demo.NetworksSwing.addStatisticsTabs(OtsSimulatorInterface) | STYLE | INT_BAD_REM_BY_1 | 150 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Hard coded reference to an absolute pathname in new org.opentrafficsim.demo.ParseXml() | STYLE | DMI_HARDCODED_ABSOLUTE_FILENAME | 50 | Medium |
org.opentrafficsim.demo.ParseXml.domTree(String) may fail to clean up java.io.InputStream | EXPERIMENTAL | OBL_UNSATISFIED_OBLIGATION | 56 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Dead store to lanesBC in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) | STYLE | DLS_DEAD_LOCAL_STORE | 296 | Medium |
Dead store to lanesFB in org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) | STYLE | DLS_DEAD_LOCAL_STORE | 305 | Medium |
Boxing/unboxing to parse a primitive org.opentrafficsim.demo.RampMeteringDemo.arrayFromString(String) | PERFORMANCE | DM_BOXED_PRIMITIVE_FOR_PARSING | 246 | High |
Useless object stored in variable detectors34 of method org.opentrafficsim.demo.RampMeteringDemo.setupSimulation(OtsSimulatorInterface) | STYLE | UC_USELESS_OBJECT | 325 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Class org.opentrafficsim.demo.RampMeteringDemo$ControlledTacticalPlanner defines non-transient non-serializable instance field laneChangeSystem | BAD_PRACTICE | SE_BAD_FIELD | Not available | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Hard coded reference to an absolute pathname in org.opentrafficsim.demo.ShortMerge$ShortMergeModel.constructModel() | STYLE | DMI_HARDCODED_ABSOLUTE_FILENAME | 239 | Medium |
org.opentrafficsim.demo.ShortMerge$ShortMergeModel.getNetwork() may expose internal representation by returning ShortMerge$ShortMergeModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 255 | 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 | 230 | 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 | 273 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.demo.StraightModel.getNetwork() may expose internal representation by returning StraightModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 219 | Medium |
org.opentrafficsim.demo.StraightModel.getPath() may expose internal representation by returning StraightModel.path | MALICIOUS_CODE | EI_EXPOSE_REP | 227 | Medium |
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 | 117 | Medium |
org.opentrafficsim.demo.conflict.TJunctionDemo$TJunctionModel.getNetwork() may expose internal representation by returning TJunctionDemo$TJunctionModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 183 | Medium |
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 | 121 | Medium |
org.opentrafficsim.demo.conflict.TurboRoundaboutDemo$TurboRoundaboutModel.getNetwork() may expose internal representation by returning TurboRoundaboutDemo$TurboRoundaboutModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 200 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.demo.fd.FundamentalDiagramDemo$SwingFundamentalDiagramNoControl be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 790-799 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.demo.fd.FundamentalDiagramModel.getNetwork() may expose internal representation by returning FundamentalDiagramModel.network | MALICIOUS_CODE | EI_EXPOSE_REP | 43 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Dead store to $L7 in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]) | STYLE | DLS_DEAD_LOCAL_STORE | 144 | High |
Found reliance on default encoding in org.opentrafficsim.demo.loadfromxml.LoadXml.main(String[]): new String(byte[]) | I18N | DM_DEFAULT_ENCODING | 133 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Do not catch NullPointerException like in org.opentrafficsim.demo.loadfromxml.LoadXml$XmlModel.constructModel() | STYLE | DCN_NULLPOINTER_EXCEPTION | 199 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Integral division result cast to double or float in org.opentrafficsim.demo.strategies.StrategiesDemo.setupSimulation(OtsSimulatorInterface) | STYLE | ICAST_IDIV_CAST_TO_DOUBLE | 581 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.demo.strategies.StrategiesDemo$LmrsStrategiesPerceptionFactory be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 692-712 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.demo.strategies.StrategiesDemo$SocioIDMFactory be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 672-687 | Medium |
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 | 105 | Medium |
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 | 205 | Medium |