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 |
---|---|---|---|
130 | 70 | 0 | 0 |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.core.BoundsPaintScale.GREEN_RED is a mutable array | MALICIOUS_CODE | MS_MUTABLE_ARRAY | 26 | High |
org.opentrafficsim.draw.core.BoundsPaintScale.GREEN_RED_DARK is a mutable array | MALICIOUS_CODE | MS_MUTABLE_ARRAY | 30 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.core.TextProperties.getTextAttributes() may expose internal representation by returning TextProperties.textAttributes | MALICIOUS_CODE | EI_EXPOSE_REP | 108 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.AbstractContourPlot.getBlockRenderer() may expose internal representation by returning AbstractContourPlot.blockRenderer | MALICIOUS_CODE | EI_EXPOSE_REP | 348 | Medium |
org.opentrafficsim.draw.graphs.AbstractContourPlot.getDataPool() may expose internal representation by returning AbstractContourPlot.dataPool | MALICIOUS_CODE | EI_EXPOSE_REP | 200 | Medium |
new org.opentrafficsim.draw.graphs.AbstractContourPlot(String, OTSSimulatorInterface, ContourDataSource, BoundsPaintScale, Number, String, String) may expose internal representation by storing an externally mutable object into AbstractContourPlot.dataPool | MALICIOUS_CODE | EI_EXPOSE_REP2 | 71 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.graphs.AbstractGraphSpace(List) may expose internal representation by storing an externally mutable object into AbstractGraphSpace.seriesNames | MALICIOUS_CODE | EI_EXPOSE_REP2 | 30 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.AbstractPlot.getChart() may expose internal representation by returning AbstractPlot.chart | MALICIOUS_CODE | EI_EXPOSE_REP | 234 | Medium |
org.opentrafficsim.draw.graphs.AbstractPlot.getUpdateTime() may expose internal representation by returning AbstractPlot.updateTime | MALICIOUS_CODE | EI_EXPOSE_REP | 289 | Medium |
new org.opentrafficsim.draw.graphs.AbstractPlot(OTSSimulatorInterface, String, Duration, Duration) may expose internal representation by storing an externally mutable object into AbstractPlot.delay | MALICIOUS_CODE | EI_EXPOSE_REP2 | 104 | Medium |
new org.opentrafficsim.draw.graphs.AbstractPlot(OTSSimulatorInterface, String, Duration, Duration) may expose internal representation by storing an externally mutable object into AbstractPlot.updateInterval | MALICIOUS_CODE | EI_EXPOSE_REP2 | 103 | Medium |
org.opentrafficsim.draw.graphs.AbstractPlot.setUpdateInterval(Duration) may expose internal representation by storing an externally mutable object into AbstractPlot.updateInterval | MALICIOUS_CODE | EI_EXPOSE_REP2 | 278 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.graphs.AbstractSamplerPlot(String, Duration, OTSSimulatorInterface, SamplerData, GraphPath, Duration) may expose internal representation by storing an externally mutable object into AbstractSamplerPlot.samplerData | MALICIOUS_CODE | EI_EXPOSE_REP2 | 57 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.graphs.AbstractSpaceTimePlot(String, Duration, OTSSimulatorInterface, Duration, Time) may expose internal representation by storing an externally mutable object into AbstractSpaceTimePlot.initialEnd | MALICIOUS_CODE | EI_EXPOSE_REP2 | 51 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.ContourDataSource.getSamplerData() may expose internal representation by returning ContourDataSource.samplerData | MALICIOUS_CODE | EI_EXPOSE_REP | 249 | Medium |
new org.opentrafficsim.draw.graphs.ContourDataSource(SamplerData, Duration, GraphPath, double[], int, double[], int, Time, Time) may expose internal representation by storing an externally mutable object into ContourDataSource.delay | MALICIOUS_CODE | EI_EXPOSE_REP2 | 226 | Medium |
new org.opentrafficsim.draw.graphs.ContourDataSource(SamplerData, Duration, GraphPath, double[], int, double[], int, Time, Time) may expose internal representation by storing an externally mutable object into ContourDataSource.samplerData | MALICIOUS_CODE | EI_EXPOSE_REP2 | 224 | Medium |
Inconsistent synchronization of org.opentrafficsim.draw.graphs.ContourDataSource.redo; locked 75% of time | MT_CORRECTNESS | IS2_INCONSISTENT_SYNC | 796 | Medium |
Inconsistent synchronization of org.opentrafficsim.draw.graphs.ContourDataSource.smooth; locked 66% of time | MT_CORRECTNESS | IS2_INCONSISTENT_SYNC | 444 | Medium |
Inconsistent synchronization of org.opentrafficsim.draw.graphs.ContourDataSource.toTime; locked 83% of time | MT_CORRECTNESS | IS2_INCONSISTENT_SYNC | 512 | Medium |
org.opentrafficsim.draw.graphs.ContourDataSource.DEFAULT_SPACE_GRANULARITIES should be package protected | MALICIOUS_CODE | MS_PKGPROTECT | 58 | Medium |
org.opentrafficsim.draw.graphs.ContourDataSource.DEFAULT_TIME_GRANULARITIES should be package protected | MALICIOUS_CODE | MS_PKGPROTECT | 64 | Medium |
Method org.opentrafficsim.draw.graphs.ContourDataSource.setStatusLabel(String) seems to be useless | STYLE | UC_USELESS_VOID_METHOD | 899 | Medium |
org.opentrafficsim.draw.graphs.ContourDataSource.getGranularity(ContourDataSource$Dimension) is unsynchronized, org.opentrafficsim.draw.graphs.ContourDataSource.setGranularity(ContourDataSource$Dimension, double) is synchronized | MT_CORRECTNESS | UG_SYNC_SET_UNSYNC_GET | 365 | Medium |
org.opentrafficsim.draw.graphs.ContourDataSource.update(Time) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 773 | Medium |
org.opentrafficsim.draw.graphs.ContourDataSource.update(Time) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 790 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.FundamentalDiagram.getLaneVisible() may expose internal representation by returning FundamentalDiagram.laneVisible | MALICIOUS_CODE | EI_EXPOSE_REP | 1426 | Medium |
org.opentrafficsim.draw.graphs.FundamentalDiagram.getLegend() may expose internal representation by returning FundamentalDiagram.legend | MALICIOUS_CODE | EI_EXPOSE_REP | 1417 | Medium |
org.opentrafficsim.draw.graphs.FundamentalDiagram.getSource() may expose internal representation by returning FundamentalDiagram.source | MALICIOUS_CODE | EI_EXPOSE_REP | 1408 | Medium |
new org.opentrafficsim.draw.graphs.FundamentalDiagram(String, FundamentalDiagram$Quantity, FundamentalDiagram$Quantity, OTSSimulatorInterface, FundamentalDiagram$FdSource, FundamentalDiagram$FdLine) may expose internal representation by storing an externally mutable object into FundamentalDiagram.source | MALICIOUS_CODE | EI_EXPOSE_REP2 | 112 | Medium |
org.opentrafficsim.draw.graphs.FundamentalDiagram.DEFAULT_PERIODS should be package protected | MALICIOUS_CODE | MS_PKGPROTECT | 55 | Medium |
org.opentrafficsim.draw.graphs.FundamentalDiagram.DEFAULT_UPDATE_FREQUENCIES should be package protected | MALICIOUS_CODE | MS_PKGPROTECT | 58 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Inconsistent synchronization of org.opentrafficsim.draw.graphs.FundamentalDiagram$AbstractSpaceSamplerFdSource.firstMeasurement; locked 75% of time | MT_CORRECTNESS | IS2_INCONSISTENT_SYNC | 1145 | Medium |
Inconsistent synchronization of org.opentrafficsim.draw.graphs.FundamentalDiagram$AbstractSpaceSamplerFdSource.secondMeasurement; locked 71% of time | MT_CORRECTNESS | IS2_INCONSISTENT_SYNC | 1145 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Possible null pointer dereference of sources in new org.opentrafficsim.draw.graphs.FundamentalDiagram$MultiFdSource(Map) | CORRECTNESS | NP_NULL_ON_SOME_PATH | 1215 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.graphs.GraphCrossSection(List, GraphPath$Section, List) may expose internal representation by storing an externally mutable object into GraphCrossSection.positions | MALICIOUS_CODE | EI_EXPOSE_REP2 | 70 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.GraphPath.getSpeedLimit() may expose internal representation by returning GraphPath.speedLimit | MALICIOUS_CODE | EI_EXPOSE_REP | 117 | Medium |
org.opentrafficsim.draw.graphs.GraphPath.getTotalLength() may expose internal representation by returning GraphPath.totalLength | MALICIOUS_CODE | EI_EXPOSE_REP | 108 | Medium |
new org.opentrafficsim.draw.graphs.GraphPath(List, List) may expose internal representation by storing an externally mutable object into GraphPath.sections | MALICIOUS_CODE | EI_EXPOSE_REP2 | 74 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exceptional return value of java.util.concurrent.BlockingQueue.offer(Object) ignored in org.opentrafficsim.draw.graphs.GraphUpdater.offer(Object) | BAD_PRACTICE | RV_RETURN_VALUE_IGNORED_BAD_PRACTICE | 69 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.TrajectoryPlot.getLaneVisible() may expose internal representation by returning TrajectoryPlot.laneVisible | MALICIOUS_CODE | EI_EXPOSE_REP | 601 | Medium |
org.opentrafficsim.draw.graphs.TrajectoryPlot.getLegend() may expose internal representation by returning TrajectoryPlot.legend | MALICIOUS_CODE | EI_EXPOSE_REP | 592 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.draw.graphs.TrajectoryPlot$OffsetTrajectory be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 477-572 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.XYInterpolatedBlockRenderer doesn't override org.jfree.chart.renderer.xy.XYBlockRenderer.equals(Object) | STYLE | EQ_DOESNT_OVERRIDE_EQUALS | 1 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Integral division result cast to double or float in org.opentrafficsim.draw.graphs.XYInterpolatedBlockRenderer$1$1.getRaster(int, int, int, int) | STYLE | ICAST_IDIV_CAST_TO_DOUBLE | 183 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.graphs.road.GraphLaneUtil$4.compare(Lane, Lane) negates the return value of org.djunits.value.vdouble.scalar.base.AbstractDoubleScalar.compareTo(AbstractDoubleScalar) | BAD_PRACTICE | RV_NEGATING_RESULT_OF_COMPARETO | 363 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.animation.gtu.colorer.IDGTUColorer stored into non-transient field DefaultCarAnimation.gtuColorer | BAD_PRACTICE | SE_BAD_FIELD_STORE | 110 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.gtu.DefaultCarAnimation$Text(DefaultCarAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface) may expose internal representation by storing an externally mutable object into DefaultCarAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 306 | Medium |
new org.opentrafficsim.draw.gtu.DefaultCarAnimation$Text(DefaultCarAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface, TextAnimation$ContrastToBackground) may expose internal representation by storing an externally mutable object into DefaultCarAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 326 | Medium |
Potentially ambiguous invocation of either an outer or inherited method org.opentrafficsim.draw.core.TextAnimation.destroy(Contextualized) in org.opentrafficsim.draw.gtu.DefaultCarAnimation$Text.paint(Graphics2D, ImageObserver) | STYLE | IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD | 342 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.gtu.GtuGeneratorQueueAnimation.paint(Graphics2D, ImageObserver) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 67 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.lane.LaneStructureLocatable.getGtu() may expose internal representation by returning LaneStructureLocatable.gtu | MALICIOUS_CODE | EI_EXPOSE_REP | 86 | Medium |
org.opentrafficsim.draw.lane.LaneStructureLocatable.getRollingLaneStructure() may expose internal representation by returning LaneStructureLocatable.rollingLaneStructure | MALICIOUS_CODE | EI_EXPOSE_REP | 78 | Medium |
new org.opentrafficsim.draw.lane.LaneStructureLocatable(RollingLaneStructure, GTU) may expose internal representation by storing an externally mutable object into LaneStructureLocatable.gtu | MALICIOUS_CODE | EI_EXPOSE_REP2 | 39 | Medium |
new org.opentrafficsim.draw.lane.LaneStructureLocatable(RollingLaneStructure, GTU) may expose internal representation by storing an externally mutable object into LaneStructureLocatable.rollingLaneStructure | MALICIOUS_CODE | EI_EXPOSE_REP2 | 38 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.network.LinkAnimation$Text(LinkAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface, TextAnimation$ScaleDependentRendering) may expose internal representation by storing an externally mutable object into LinkAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 183 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.network.NodeAnimation$ElevatedNode.getNode() may expose internal representation by returning NodeAnimation$ElevatedNode.node | MALICIOUS_CODE | EI_EXPOSE_REP | 153 | Medium |
org.opentrafficsim.draw.network.NodeAnimation$ElevatedNode.getParentIntrospectionObject() may expose internal representation by returning NodeAnimation$ElevatedNode.node | MALICIOUS_CODE | EI_EXPOSE_REP | 167 | Medium |
new org.opentrafficsim.draw.network.NodeAnimation$ElevatedNode(Node) may expose internal representation by storing an externally mutable object into NodeAnimation$ElevatedNode.node | MALICIOUS_CODE | EI_EXPOSE_REP2 | 135 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.network.NodeAnimation$Text(NodeAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface, TextAnimation$ScaleDependentRendering) may expose internal representation by storing an externally mutable object into NodeAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 206 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.road.BusStopAnimation$Text(BusStopAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface) may expose internal representation by storing an externally mutable object into BusStopAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 110 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.road.LaneAnimation.getText() may expose internal representation by returning LaneAnimation.text | MALICIOUS_CODE | EI_EXPOSE_REP | 70 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.road.LaneAnimation$Text(LaneAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface) may expose internal representation by storing an externally mutable object into LaneAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 223 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.road.SensorAnimation.getText() may expose internal representation by returning SensorAnimation.text | MALICIOUS_CODE | EI_EXPOSE_REP | 74 | Medium |
new org.opentrafficsim.draw.road.SensorAnimation(SingleSensor, Length, OTSSimulatorInterface, Color) may expose internal representation by storing an externally mutable object into SensorAnimation.sensorPosition | MALICIOUS_CODE | EI_EXPOSE_REP2 | 62 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.road.SensorAnimation$Text(SensorAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface) may expose internal representation by storing an externally mutable object into SensorAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 142 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Using floating-point loop counters can lead to unexpected behavior. | CORRECTNESS | FL_FLOATS_AS_LOOP_COUNTERS | 84 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.draw.road.TrafficLightAnimation.getText() may expose internal representation by returning TrafficLightAnimation.text | MALICIOUS_CODE | EI_EXPOSE_REP | 64 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.road.TrafficLightAnimation$Text(TrafficLightAnimation, Locatable, String, float, float, TextAlignment, Color, OTSSimulatorInterface) may expose internal representation by storing an externally mutable object into TrafficLightAnimation$Text.this$0 | MALICIOUS_CODE | EI_EXPOSE_REP2 | 156 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new org.opentrafficsim.draw.road.TrafficLightSensorAnimation(TrafficLightSensor, OTSSimulatorInterface) may expose internal representation by storing an externally mutable object into TrafficLightSensorAnimation.sensor | MALICIOUS_CODE | EI_EXPOSE_REP2 | 56 | Medium |