SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.7.1

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
130 70 0 0

Files

Class Bugs
org.opentrafficsim.draw.core.BoundsPaintScale 2
org.opentrafficsim.draw.core.TextProperties 1
org.opentrafficsim.draw.graphs.AbstractContourPlot 3
org.opentrafficsim.draw.graphs.AbstractGraphSpace 1
org.opentrafficsim.draw.graphs.AbstractPlot 5
org.opentrafficsim.draw.graphs.AbstractSamplerPlot 1
org.opentrafficsim.draw.graphs.AbstractSpaceTimePlot 1
org.opentrafficsim.draw.graphs.ContourDataSource 12
org.opentrafficsim.draw.graphs.FundamentalDiagram 6
org.opentrafficsim.draw.graphs.FundamentalDiagram$AbstractSpaceSamplerFdSource 2
org.opentrafficsim.draw.graphs.FundamentalDiagram$MultiFdSource 1
org.opentrafficsim.draw.graphs.GraphCrossSection 1
org.opentrafficsim.draw.graphs.GraphPath 3
org.opentrafficsim.draw.graphs.GraphUpdater 1
org.opentrafficsim.draw.graphs.TrajectoryPlot 2
org.opentrafficsim.draw.graphs.TrajectoryPlot$OffsetTrajectory 1
org.opentrafficsim.draw.graphs.XYInterpolatedBlockRenderer 1
org.opentrafficsim.draw.graphs.XYInterpolatedBlockRenderer$1$1 1
org.opentrafficsim.draw.graphs.road.GraphLaneUtil$4 1
org.opentrafficsim.draw.gtu.DefaultCarAnimation 1
org.opentrafficsim.draw.gtu.DefaultCarAnimation$Text 3
org.opentrafficsim.draw.gtu.GtuGeneratorQueueAnimation 1
org.opentrafficsim.draw.lane.LaneStructureLocatable 4
org.opentrafficsim.draw.network.LinkAnimation$Text 1
org.opentrafficsim.draw.network.NodeAnimation$ElevatedNode 3
org.opentrafficsim.draw.network.NodeAnimation$Text 1
org.opentrafficsim.draw.road.BusStopAnimation$Text 1
org.opentrafficsim.draw.road.LaneAnimation 1
org.opentrafficsim.draw.road.LaneAnimation$Text 1
org.opentrafficsim.draw.road.SensorAnimation 2
org.opentrafficsim.draw.road.SensorAnimation$Text 1
org.opentrafficsim.draw.road.StripeAnimation 1
org.opentrafficsim.draw.road.TrafficLightAnimation 1
org.opentrafficsim.draw.road.TrafficLightAnimation$Text 1
org.opentrafficsim.draw.road.TrafficLightSensorAnimation 1

org.opentrafficsim.draw.core.BoundsPaintScale

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

org.opentrafficsim.draw.core.TextProperties

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

org.opentrafficsim.draw.graphs.AbstractContourPlot

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

org.opentrafficsim.draw.graphs.AbstractGraphSpace

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

org.opentrafficsim.draw.graphs.AbstractPlot

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

org.opentrafficsim.draw.graphs.AbstractSamplerPlot

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

org.opentrafficsim.draw.graphs.AbstractSpaceTimePlot

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

org.opentrafficsim.draw.graphs.ContourDataSource

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

org.opentrafficsim.draw.graphs.FundamentalDiagram

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

org.opentrafficsim.draw.graphs.FundamentalDiagram$AbstractSpaceSamplerFdSource

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

org.opentrafficsim.draw.graphs.FundamentalDiagram$MultiFdSource

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

org.opentrafficsim.draw.graphs.GraphCrossSection

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

org.opentrafficsim.draw.graphs.GraphPath

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

org.opentrafficsim.draw.graphs.GraphUpdater

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

org.opentrafficsim.draw.graphs.TrajectoryPlot

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

org.opentrafficsim.draw.graphs.TrajectoryPlot$OffsetTrajectory

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

org.opentrafficsim.draw.graphs.XYInterpolatedBlockRenderer

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

org.opentrafficsim.draw.graphs.XYInterpolatedBlockRenderer$1$1

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

org.opentrafficsim.draw.graphs.road.GraphLaneUtil$4

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

org.opentrafficsim.draw.gtu.DefaultCarAnimation

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

org.opentrafficsim.draw.gtu.DefaultCarAnimation$Text

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

org.opentrafficsim.draw.gtu.GtuGeneratorQueueAnimation

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

org.opentrafficsim.draw.lane.LaneStructureLocatable

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

org.opentrafficsim.draw.network.LinkAnimation$Text

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

org.opentrafficsim.draw.network.NodeAnimation$ElevatedNode

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

org.opentrafficsim.draw.network.NodeAnimation$Text

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

org.opentrafficsim.draw.road.BusStopAnimation$Text

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

org.opentrafficsim.draw.road.LaneAnimation

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

org.opentrafficsim.draw.road.LaneAnimation$Text

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

org.opentrafficsim.draw.road.SensorAnimation

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

org.opentrafficsim.draw.road.SensorAnimation$Text

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

org.opentrafficsim.draw.road.StripeAnimation

Bug Category Details Line Priority
Using floating-point loop counters can lead to unexpected behavior. CORRECTNESS FL_FLOATS_AS_LOOP_COUNTERS 84 Medium

org.opentrafficsim.draw.road.TrafficLightAnimation

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

org.opentrafficsim.draw.road.TrafficLightAnimation$Text

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

org.opentrafficsim.draw.road.TrafficLightSensorAnimation

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