Project:
SpotBugs version: 3.1.1
Code analyzed:
1174 lines of code analyzed, in 32 classes, in 10 packages.
| Metric | Total | Density* |
|---|---|---|
| High Priority Warnings | 1 | 0.85 |
| Medium Priority Warnings | 14 | 11.93 |
| Low Priority Warnings | 4 | 3.41 |
| Total Warnings | 19 | 16.18 |
(* Defects per Thousand lines of non-commenting source statements)
| Warning Type | Number |
|---|---|
| Bad practice Warnings | 4 |
| Malicious code vulnerability Warnings | 1 |
| Dodgy code Warnings | 14 |
| Total | 19 |
Click on a warning row to see full context information.
| Code | Warning |
|---|---|
| OS | org.openstreetmap.josm.plugins.streetside.oauth.OAuthPortListenerTest.responseTest() may fail to close stream |
| UI | Usage of GetResource in org.openstreetmap.josm.plugins.streetside.utils.api.JsonImageDetectionDecoderTest.testDecodeImageDetections() may be unsafe if class is extended |
| UI | Usage of GetResource in org.openstreetmap.josm.plugins.streetside.utils.api.JsonMapObjectDecoderTest.testDecodeMapObjects() may be unsafe if class is extended |
| UI | Usage of GetResource in org.openstreetmap.josm.plugins.streetside.utils.api.JsonSequencesDecoderTest.testDecodeSequences() may be unsafe if class is extended |
| Code | Warning |
|---|---|
| DP | Invocation of reflect.Field.setAccessible(boolean), which should be invoked from within a doPrivileged block, in org.openstreetmap.josm.plugins.streetside.utils.TestUtil.getAccessibleField(Class, String) |
| Code | Warning |
|---|---|
| DLS | Dead store to keyField in org.openstreetmap.josm.plugins.streetside.model.MapObjectTest.setUp() |
| ST | Write to static field org.openstreetmap.josm.plugins.streetside.model.MapObjectTest.iconUrlGen from instance method org.openstreetmap.josm.plugins.streetside.model.MapObjectTest.setUp() |
| ST | Write to static field org.openstreetmap.josm.plugins.streetside.model.MapObjectTest.iconUrlGenValue from instance method org.openstreetmap.josm.plugins.streetside.model.MapObjectTest.setUp() |
| ST | Write to static field org.openstreetmap.josm.Main.main from instance method org.openstreetmap.josm.plugins.streetside.utils.PluginStateTest.uploadTest() |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.cache.StreetsideCacheTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.gui.ImageDisplayTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.gui.StreetsidePreferenceSettingTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.history.StreetsideRecordTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.model.MapObjectTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.StreetsideAbstractImageTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.StreetsideDataTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.StreetsideLayerTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.utils.api.JsonMapObjectDecoderTest.rules |
| UrF | Unread public/protected field: org.openstreetmap.josm.plugins.streetside.utils.StreetsidePropertiesTest.rules |
This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.
Note that Sun's javac compiler often generates dead stores for final local variables. Because SpotBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.
This code invokes a method that requires a security permission check. If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the invocation needs to occur inside a doPrivileged block.
The method creates an IO stream object, does not assign it to any
fields, pass it to other methods that might close it,
or return it, and does not appear to close
the stream on all paths out of the method. This may result in
a file descriptor leak. It is generally a good
idea to use a finally block to ensure that streams are
closed.
This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.
Calling this.getClass().getResource(...) could give
results other than expected if this class is extended by a class in
another package.
This field is never read. The field is public or protected, so perhaps it is intended to be used with classes not seen as part of the analysis. If not, consider removing it from the class.