The following document contains the results of SpotBugs
SpotBugs Version is 3.1.12
Threshold is medium
Effort is default
Classes | Bugs | Errors | Missing Classes |
---|---|---|---|
290 | 51 | 0 | 0 |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.compatibility.GTUCompatibility.isCompatible(GTUType, GTUDirectionality) has Boolean return type and returns explicit null | BAD_PRACTICE | NP_BOOLEAN_RETURN_NULL | 68 | High |
org.opentrafficsim.core.compatibility.GTUCompatibility.isCompatibleWith(Compatibility, boolean) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 175 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Null passed for non-null parameter of java.util.List.addAll(Collection) in new org.opentrafficsim.core.distributions.Distribution(List, StreamInterface) | CORRECTNESS | NP_NULL_PARAM_DEREF | 48 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Class org.opentrafficsim.core.dsol.OTSDEVSRTParallelMove defines non-transient non-serializable instance field executor | BAD_PRACTICE | SE_BAD_FIELD | Not available | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Class org.opentrafficsim.core.dsol.OTSLoggingAnimator defines non-transient non-serializable instance field animationThread | BAD_PRACTICE | SE_BAD_FIELD | Not available | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Possible null pointer dereference of wMean in org.opentrafficsim.core.egtf.EGTF.filterSI(double[], double[], Quantity[]) | CORRECTNESS | NP_NULL_ON_SOME_PATH | 663 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.core.egtf.EGTF$DualWeightedMean be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 1067-1143 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.core.egtf.EGTF$WeightedMean be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 1152-1184 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.egtf.FilterDouble.getLocation() may expose internal representation by returning FilterDouble.location | MALICIOUS_CODE | EI_EXPOSE_REP | 44 | Medium |
org.opentrafficsim.core.egtf.FilterDouble.getTime() may expose internal representation by returning FilterDouble.time | MALICIOUS_CODE | EI_EXPOSE_REP | 51 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Possible null pointer dereference of boundingBox in new org.opentrafficsim.core.geometry.OTS2DSet(Rectangle2D, double) | CORRECTNESS | NP_NULL_ON_SOME_PATH | 59 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.geometry.OTS2DSet$QuadTreeIterator is serializable and an inner class | BAD_PRACTICE | SE_INNER_CLASS | 275-319 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.geometry.OTS2DSet$QuadTreeNode is serializable and an inner class | BAD_PRACTICE | SE_INNER_CLASS | 333-759 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.geometry.OTSLine3D.getPoints() may expose internal representation by returning OTSLine3D.points | MALICIOUS_CODE | EI_EXPOSE_REP | 916 | Medium |
Test for floating point equality in org.opentrafficsim.core.geometry.OTSLine3D.extract(double, double) | STYLE | FE_FLOATING_POINT_EQUALITY | 637 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.geometry.OTSShape doesn't override OTSLine3D.equals(Object) | STYLE | EQ_DOESNT_OVERRIDE_EQUALS | 1 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.gtu.AbstractGTU.ALIGN_COUNT should be package protected | MALICIOUS_CODE | MS_PKGPROTECT | 111 | Medium |
org.opentrafficsim.core.gtu.AbstractGTU.ALIGNED isn't final but should be | MALICIOUS_CODE | MS_SHOULD_BE_FINAL | 107 | High |
Exception is caught when Exception is not thrown in org.opentrafficsim.core.gtu.AbstractGTU.move(DirectedPoint) | STYLE | REC_CATCH_EXCEPTION | 340 | Medium |
Write to static field org.opentrafficsim.core.gtu.AbstractGTU.staticUNIQUENUMBER from instance method new org.opentrafficsim.core.gtu.AbstractGTU(String, GTUType, OTSSimulatorInterface, PerceivableContext) | STYLE | ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD | 154 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Found reliance on default encoding in org.opentrafficsim.core.gtu.GTUDumper.dump(): new java.io.PrintWriter(File) | I18N | DM_DEFAULT_ENCODING | 37 | High |
Format string should use %n rather than \n in org.opentrafficsim.core.gtu.GTUDumper.dump() | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 41 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.gtu.GTUType is Serializable but its superclass doesn't define an accessible void constructor | BAD_PRACTICE | SE_NO_SUITABLE_CONSTRUCTOR | 131-279 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.gtu.perception.AbstractPerception.contains(Class) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 80 | Medium |
org.opentrafficsim.core.gtu.perception.AbstractPerception.getPerceptionCategoryOrNull(Class) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 116 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Dead store to p in org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.getLocation(Time) | STYLE | DLS_DEAD_LOCAL_STORE | 439 | Medium |
Redundant nullcheck of p, which is known to be non-null in org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.timeAtPoint(DirectedPoint, boolean) | STYLE | RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE | 610 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.gtu.plan.operational.OperationalPlan$SegmentProgress is serializable and an inner class | BAD_PRACTICE | SE_INNER_CLASS | 320-357 | Medium |
Should org.opentrafficsim.core.gtu.plan.operational.OperationalPlan$SegmentProgress be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 320-357 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.network.CapacityOTSLink doesn't override OTSLink.equals(Object) | STYLE | EQ_DOESNT_OVERRIDE_EQUALS | 1 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.network.DirectedLinkPosition doesn't override LinkDirection.equals(Object) | STYLE | EQ_DOESNT_OVERRIDE_EQUALS | 1 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Class org.opentrafficsim.core.network.LinkType defines non-transient non-serializable instance field compatibility | BAD_PRACTICE | SE_BAD_FIELD | Not available | High |
org.opentrafficsim.core.network.LinkType is Serializable but its superclass doesn't define an accessible void constructor | BAD_PRACTICE | SE_NO_SUITABLE_CONSTRUCTOR | 25-203 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Should org.opentrafficsim.core.network.LinkType$ReversedLinkType be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 218-256 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.network.OTSNetwork.buildGraph(GTUType, LinkWeight) allocates an object, only to get the class object | PERFORMANCE | DM_NEW_FOR_GETCLASS | 694 | Medium |
org.opentrafficsim.core.network.OTSNetwork.getObjectMap(Class) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 377 | Medium |
org.opentrafficsim.core.network.OTSNetwork.getRoute(String) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 630 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Return value of OTSNode.clone1(Network) ignored, is this OK in org.opentrafficsim.core.network.OTSNetworkUtils.clone(OTSNetwork, String, OTSSimulatorInterface) | STYLE | RV_RETURN_VALUE_IGNORED_INFERRED | 46 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.network.OTSNode.clone2(Network) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 456 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.network.route.FixedRouteGenerator is Serializable but its superclass doesn't define an accessible void constructor | BAD_PRACTICE | SE_NO_SUITABLE_CONSTRUCTOR | 29-46 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.parameters.ParameterFactoryByType.setParameter(ParameterType, Object, Parameters, Map) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 187 | Medium |
org.opentrafficsim.core.parameters.ParameterFactoryByType.setValues(Parameters, GTUType) makes inefficient use of keySet iterator instead of entrySet iterator | PERFORMANCE | WMI_WRONG_MAP_ITERATOR | 93 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.parameters.ParameterFactoryByType$DistributedEntry is serializable but also an inner class of a non-serializable class | BAD_PRACTICE | SE_BAD_FIELD_INNER_CLASS | 456-496 | High |
Should org.opentrafficsim.core.parameters.ParameterFactoryByType$DistributedEntry be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 456-496 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.parameters.ParameterFactoryByType$DistributedEntryDouble is serializable but also an inner class of a non-serializable class | BAD_PRACTICE | SE_BAD_FIELD_INNER_CLASS | 512-551 | High |
Should org.opentrafficsim.core.parameters.ParameterFactoryByType$DistributedEntryDouble be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 512-551 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.parameters.ParameterFactoryByType$DistributedEntryInteger is serializable but also an inner class of a non-serializable class | BAD_PRACTICE | SE_BAD_FIELD_INNER_CLASS | 567-606 | High |
Should org.opentrafficsim.core.parameters.ParameterFactoryByType$DistributedEntryInteger be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 567-606 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.parameters.ParameterFactoryByType$FixedEntry is serializable but also an inner class of a non-serializable class | BAD_PRACTICE | SE_BAD_FIELD_INNER_CLASS | 414-437 | High |
Should org.opentrafficsim.core.parameters.ParameterFactoryByType$FixedEntry be a _static_ inner class? | PERFORMANCE | SIC_INNER_SHOULD_BE_STATIC | 414-437 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
org.opentrafficsim.core.perception.collections.AbstractHistoricalList.get(int) is unsynchronized, org.opentrafficsim.core.perception.collections.AbstractHistoricalList.set(int, Object) is synchronized | MT_CORRECTNESS | UG_SYNC_SET_UNSYNC_GET | 114 | Medium |