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
81 49 0 0

Files

Class Bugs
org.opentrafficsim.swing.graphs.SwingContourPlot 1
org.opentrafficsim.swing.graphs.SwingFundamentalDiagram 2
org.opentrafficsim.swing.graphs.SwingPlot 3
org.opentrafficsim.swing.graphs.SwingTrajectoryPlot 2
org.opentrafficsim.swing.gui.AppearanceApplication$SubMenuShower 1
org.opentrafficsim.swing.gui.AppearanceControl 1
org.opentrafficsim.swing.gui.GhostText 1
org.opentrafficsim.swing.gui.OtsGtuColorPanel 1
org.opentrafficsim.swing.gui.OtsGtuColorPanel$CustomTickUnitSource 1
org.opentrafficsim.swing.gui.OtsGtuColorPanel$DivisibleNumberAxis 1
org.opentrafficsim.swing.gui.OtsSearchPanel 1
org.opentrafficsim.swing.gui.OtsSimulationControlPanel 1
org.opentrafficsim.swing.gui.OtsSimulationControlPanel$2 1
org.opentrafficsim.swing.gui.OtsSimulationPanel 7
org.opentrafficsim.swing.gui.OtsSimulationPanel$AppearanceJToggleButton 1
org.opentrafficsim.swing.gui.OtsSimulationPanel$OtsAnimationPanel 1
org.opentrafficsim.swing.gui.ProbabilityDistributionEditor 1
org.opentrafficsim.swing.gui.PropertiesStore 11
org.opentrafficsim.swing.script.AbstractSimulationScript 6
org.opentrafficsim.swing.script.IdmOptions 5

org.opentrafficsim.swing.graphs.SwingContourPlot

Bug Category Details Line Priority
org.opentrafficsim.swing.graphs.SwingContourPlot.notify(Event) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 168 Medium

org.opentrafficsim.swing.graphs.SwingFundamentalDiagram

Bug Category Details Line Priority
org.opentrafficsim.swing.graphs.SwingFundamentalDiagram.notify(Event) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 303 Medium
org.opentrafficsim.swing.graphs.SwingFundamentalDiagram.notify(Event) makes inefficient use of keySet iterator instead of entrySet iterator PERFORMANCE WMI_WRONG_MAP_ITERATOR 312 Medium

org.opentrafficsim.swing.graphs.SwingPlot

Bug Category Details Line Priority
org.opentrafficsim.swing.graphs.SwingPlot.getChartPanel() may expose internal representation by returning SwingPlot.chartPanel MALICIOUS_CODE EI_EXPOSE_REP 288 Medium
org.opentrafficsim.swing.graphs.SwingPlot.getPlot() may expose internal representation by returning SwingPlot.plot MALICIOUS_CODE EI_EXPOSE_REP 279 Medium
new org.opentrafficsim.swing.graphs.SwingPlot(AbstractPlot) may expose internal representation by storing an externally mutable object into SwingPlot.plot MALICIOUS_CODE EI_EXPOSE_REP2 68 Medium

org.opentrafficsim.swing.graphs.SwingTrajectoryPlot

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.swing.graphs.SwingTrajectoryPlot at new org.opentrafficsim.swing.graphs.SwingTrajectoryPlot(TrajectoryPlot) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 80 Medium
Exception thrown in class org.opentrafficsim.swing.graphs.SwingTrajectoryPlot at new org.opentrafficsim.swing.graphs.SwingTrajectoryPlot(TrajectoryPlot, boolean) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 95 Medium

org.opentrafficsim.swing.gui.AppearanceApplication$SubMenuShower

Bug Category Details Line Priority
Should org.opentrafficsim.swing.gui.AppearanceApplication$SubMenuShower be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 434-448 Medium

org.opentrafficsim.swing.gui.AppearanceControl

Bug Category Details Line Priority
The class name org.opentrafficsim.swing.gui.AppearanceControl shadows the simple name of implemented interface nl.tudelft.simulation.dsol.swing.gui.appearance.AppearanceControl BAD_PRACTICE NM_SAME_SIMPLE_NAME_AS_INTERFACE 38-46 Medium

org.opentrafficsim.swing.gui.GhostText

Bug Category Details Line Priority
new org.opentrafficsim.swing.gui.GhostText(JTextComponent, String) may expose internal representation by storing an externally mutable object into GhostText.textComp MALICIOUS_CODE EI_EXPOSE_REP2 49 Medium

org.opentrafficsim.swing.gui.OtsGtuColorPanel

Bug Category Details Line Priority
org.opentrafficsim.swing.gui.OtsGtuColorPanel.getGtuColorerManager() may expose internal representation by returning OtsGtuColorPanel.gtuColorerManager MALICIOUS_CODE EI_EXPOSE_REP 106 Medium

org.opentrafficsim.swing.gui.OtsGtuColorPanel$CustomTickUnitSource

Bug Category Details Line Priority
Test for floating point equality in org.opentrafficsim.swing.gui.OtsGtuColorPanel$CustomTickUnitSource.nextCeil(double, boolean) STYLE FE_FLOATING_POINT_EQUALITY 282 High

org.opentrafficsim.swing.gui.OtsGtuColorPanel$DivisibleNumberAxis

Bug Category Details Line Priority
org.opentrafficsim.swing.gui.OtsGtuColorPanel$DivisibleNumberAxis doesn't override org.jfree.chart.axis.NumberAxis.equals(Object) STYLE EQ_DOESNT_OVERRIDE_EQUALS 1 Medium

org.opentrafficsim.swing.gui.OtsSearchPanel

Bug Category Details Line Priority
new org.opentrafficsim.swing.gui.OtsSearchPanel(OtsSimulationPanel) may expose internal representation by storing an externally mutable object into OtsSearchPanel.otsAnimationPanel MALICIOUS_CODE EI_EXPOSE_REP2 64 Medium

org.opentrafficsim.swing.gui.OtsSimulationControlPanel

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.swing.gui.OtsSimulationControlPanel at new org.opentrafficsim.swing.gui.OtsSimulationControlPanel(OtsSimulatorInterface, OtsSimulationPanel) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 146 Medium

org.opentrafficsim.swing.gui.OtsSimulationControlPanel$2

Bug Category Details Line Priority
Possible null pointer dereference of root in org.opentrafficsim.swing.gui.OtsSimulationControlPanel$2.run() CORRECTNESS NP_NULL_ON_SOME_PATH 360 Medium

org.opentrafficsim.swing.gui.OtsSimulationPanel

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.swing.gui.OtsSimulationPanel at new org.opentrafficsim.swing.gui.OtsSimulationPanel(Rectangle2D, Network) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 195 Medium
Exception thrown in class org.opentrafficsim.swing.gui.OtsSimulationPanel at new org.opentrafficsim.swing.gui.OtsSimulationPanel(Rectangle2D, Network, OtsSimulationPanelDecorator) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 226 Medium
Exception thrown in class org.opentrafficsim.swing.gui.OtsSimulationPanel at new org.opentrafficsim.swing.gui.OtsSimulationPanel(Network, OtsSimulationPanelDecorator) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 211 Medium
org.opentrafficsim.swing.gui.OtsSimulationPanel.getAnimationPanel() may expose internal representation by returning OtsSimulationPanel.otsAnimationPanel MALICIOUS_CODE EI_EXPOSE_REP 850 Medium
org.opentrafficsim.swing.gui.OtsSimulationPanel.getDemoPanel() may expose internal representation by returning OtsSimulationPanel.demoPanel MALICIOUS_CODE EI_EXPOSE_REP 886 Medium
org.opentrafficsim.swing.gui.OtsSimulationPanel.getTabbedPane() may expose internal representation by returning OtsSimulationPanel.tabbedPane MALICIOUS_CODE EI_EXPOSE_REP 436 Medium
Nullcheck of network at line 338 of value previously dereferenced in new org.opentrafficsim.swing.gui.OtsSimulationPanel(Rectangle2D, Network, OtsSimulationPanelDecorator) CORRECTNESS RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE 231 High

org.opentrafficsim.swing.gui.OtsSimulationPanel$AppearanceJToggleButton

Bug Category Details Line Priority
Should org.opentrafficsim.swing.gui.OtsSimulationPanel$AppearanceJToggleButton be a _static_ inner class? PERFORMANCE SIC_INNER_SHOULD_BE_STATIC 1017-1031 Medium

org.opentrafficsim.swing.gui.OtsSimulationPanel$OtsAnimationPanel

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

org.opentrafficsim.swing.gui.ProbabilityDistributionEditor

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.swing.gui.ProbabilityDistributionEditor at new org.opentrafficsim.swing.gui.ProbabilityDistributionEditor(List, double[], int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 62 Medium

org.opentrafficsim.swing.gui.PropertiesStore

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.swing.gui.PropertiesStore at new org.opentrafficsim.swing.gui.PropertiesStore(Properties, String, String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 102 Medium
Boxing/unboxing to parse a primitive org.opentrafficsim.swing.gui.PropertiesStore.stringToColor(String) PERFORMANCE DM_BOXED_PRIMITIVE_FOR_PARSING 494 High
Found reliance on default encoding in new org.opentrafficsim.swing.gui.PropertiesStore(Properties, String, String): new java.io.FileReader(File) I18N DM_DEFAULT_ENCODING 107 High
Found reliance on default encoding in org.opentrafficsim.swing.gui.PropertiesStore.lambda$save$2(long): new java.io.FileWriter(File) I18N DM_DEFAULT_ENCODING 151 High
new org.opentrafficsim.swing.gui.PropertiesStore(Properties, String, String) may fail to clean up java.io.Reader EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 107 Medium
org.opentrafficsim.swing.gui.PropertiesStore.lambda$save$2(long) may fail to clean up java.io.Writer EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION 151 Medium
new org.opentrafficsim.swing.gui.PropertiesStore(Properties, String, String) may fail to close stream BAD_PRACTICE OS_OPEN_STREAM 107 Medium
org.opentrafficsim.swing.gui.PropertiesStore.lambda$save$2(long) may fail to close stream BAD_PRACTICE OS_OPEN_STREAM 151 Medium
Exceptional return value of java.io.File.mkdirs() ignored in org.opentrafficsim.swing.gui.PropertiesStore.lambda$save$2(long) BAD_PRACTICE RV_RETURN_VALUE_IGNORED_BAD_PRACTICE 148 Medium
Call to method of static java.text.DateFormat in org.opentrafficsim.swing.gui.PropertiesStore.contextKey(String, Object) MT_CORRECTNESS STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE 285 High
Call to method of static java.text.DateFormat in org.opentrafficsim.swing.gui.PropertiesStore.limitContexts0() MT_CORRECTNESS STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE 330 High

org.opentrafficsim.swing.script.AbstractSimulationScript

Bug Category Details Line Priority
Exception thrown in class org.opentrafficsim.swing.script.AbstractSimulationScript at new org.opentrafficsim.swing.script.AbstractSimulationScript(String, String) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. BAD_PRACTICE CT_CONSTRUCTOR_THROW 109 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.start() invokes System.exit(...), which shuts down the entire virtual machine BAD_PRACTICE DM_EXIT 197 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getNetwork() may expose internal representation by returning AbstractSimulationScript.network MALICIOUS_CODE EI_EXPOSE_REP 236 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getSimulationTime() may expose internal representation by returning AbstractSimulationScript.simulationTime MALICIOUS_CODE EI_EXPOSE_REP 146 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getStartTime() may expose internal representation by returning AbstractSimulationScript.startTime MALICIOUS_CODE EI_EXPOSE_REP 128 Medium
org.opentrafficsim.swing.script.AbstractSimulationScript.getWarmupTime() may expose internal representation by returning AbstractSimulationScript.warmupTime MALICIOUS_CODE EI_EXPOSE_REP 137 Medium

org.opentrafficsim.swing.script.IdmOptions

Bug Category Details Line Priority
org.opentrafficsim.swing.script.IdmOptions.getACar() may expose internal representation by returning IdmOptions.aCar MALICIOUS_CODE EI_EXPOSE_REP 64 Medium
org.opentrafficsim.swing.script.IdmOptions.getATruck() may expose internal representation by returning IdmOptions.aTruck MALICIOUS_CODE EI_EXPOSE_REP 73 Medium
org.opentrafficsim.swing.script.IdmOptions.getB() may expose internal representation by returning IdmOptions.b MALICIOUS_CODE EI_EXPOSE_REP 82 Medium
org.opentrafficsim.swing.script.IdmOptions.getTMax() may expose internal representation by returning IdmOptions.tMax MALICIOUS_CODE EI_EXPOSE_REP 100 Medium
org.opentrafficsim.swing.script.IdmOptions.getTMin() may expose internal representation by returning IdmOptions.tMin MALICIOUS_CODE EI_EXPOSE_REP 91 Medium