The following document contains the results of SpotBugs
SpotBugs Version is 4.8.3
Threshold is medium
Effort is default
Classes | Bugs | Errors | Missing Classes |
---|---|---|---|
38 | 50 | 0 | 0 |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Format string should use %n rather than \n in com.example.renderer.adapter.LegacyRendererImpl.drawLegacyCircle(int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 11 | Medium |
Format string should use %n rather than \n in com.example.renderer.adapter.LegacyRendererImpl.drawLegacyEllipse(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 27 | Medium |
Format string should use %n rather than \n in com.example.renderer.adapter.LegacyRendererImpl.drawLegacyRectangle(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 16 | Medium |
Format string should use %n rather than \n in com.example.renderer.adapter.LegacyRendererImpl.drawLegacyTriangle(int, int, int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 21 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
com.example.renderer.bridge.SVGRenderer.getContext() may expose internal representation by returning SVGRenderer.svgBuilder | MALICIOUS_CODE | EI_EXPOSE_REP | 50 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.SVGRenderer.drawCircle(int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 95 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.SVGRenderer.drawEllipse(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 138 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.SVGRenderer.drawRectangle(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 105 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.SVGRenderer.drawTriangle(int, int, int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 130 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
com.example.renderer.bridge.SwingRenderer.getContext() may expose internal representation by returning SwingRenderer.g | MALICIOUS_CODE | EI_EXPOSE_REP | 105 | Medium |
com.example.renderer.bridge.SwingRenderer.setGraphics(Graphics2D) may expose internal representation by storing an externally mutable object into SwingRenderer.g | MALICIOUS_CODE | EI_EXPOSE_REP2 | 63 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Format string should use %n rather than \n in com.example.renderer.bridge.TestRenderer.drawCircle(int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 36 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.TestRenderer.drawEllipse(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 48 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.TestRenderer.drawRectangle(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 42 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.TestRenderer.drawTriangle(int, int, int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 54 | Medium |
Format string should use %n rather than \n in com.example.renderer.bridge.TestRenderer.setStyle(String, String, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 13 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new com.example.renderer.command.AddShapeCommand(List, Shape) may expose internal representation by storing an externally mutable object into AddShapeCommand.shapes | MALICIOUS_CODE | EI_EXPOSE_REP2 | 42 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new com.example.renderer.command.DeleteShapeCommand(List, Shape) may expose internal representation by storing an externally mutable object into DeleteShapeCommand.shapes | MALICIOUS_CODE | EI_EXPOSE_REP2 | 25 | Medium |
Format string should use %n rather than \n in com.example.renderer.command.DeleteShapeCommand.execute() | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 41 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Public static com.example.renderer.config.GlobalConfig.getInstance() may expose internal representation by returning GlobalConfig.instance | MALICIOUS_CODE | MS_EXPOSE_REP | 81 | Medium |
com.example.renderer.config.GlobalConfig.loadFromConfigFile() may fail to close stream | BAD_PRACTICE | OS_OPEN_STREAM | 64 | Medium |
com.example.renderer.config.GlobalConfig.getRenderMode() is unsynchronized, com.example.renderer.config.GlobalConfig.setRenderMode(String) is synchronized | MT_CORRECTNESS | UG_SYNC_SET_UNSYNC_GET | 101 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
com.example.renderer.factory.Circle defines clone() but doesn't implement Cloneable | BAD_PRACTICE | CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE | 150 | High |
Exception thrown in class com.example.renderer.factory.Circle at new com.example.renderer.factory.Circle(int, int, int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 77 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
com.example.renderer.factory.Ellipse defines clone() but doesn't implement Cloneable | BAD_PRACTICE | CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE | 152 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
com.example.renderer.factory.Rectangle defines clone() but doesn't implement Cloneable | BAD_PRACTICE | CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE | 152 | High |
Exception thrown in class com.example.renderer.factory.Rectangle at new com.example.renderer.factory.Rectangle(int, int, int, int) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 73 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Format string should use %n rather than \n in com.example.renderer.factory.ShapeFactoryImpl.createCircle(int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 13 | Medium |
Format string should use %n rather than \n in com.example.renderer.factory.ShapeFactoryImpl.createTriangle(int, int, int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 28 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
com.example.renderer.factory.Triangle defines clone() but doesn't implement Cloneable | BAD_PRACTICE | CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE | 152 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new com.example.renderer.proxy.RemoteRendererProxy(Renderer) may expose internal representation by storing an externally mutable object into RemoteRendererProxy.realRenderer | MALICIOUS_CODE | EI_EXPOSE_REP2 | 50 | Medium |
Unread field: com.example.renderer.proxy.RemoteRendererProxy.fillColor | PERFORMANCE | URF_UNREAD_FIELD | 37 | Medium |
Unread field: com.example.renderer.proxy.RemoteRendererProxy.strokeColor | PERFORMANCE | URF_UNREAD_FIELD | 36 | Medium |
Unread field: com.example.renderer.proxy.RemoteRendererProxy.strokeWidth | PERFORMANCE | URF_UNREAD_FIELD | 38 | Medium |
Format string should use %n rather than \n in com.example.renderer.proxy.RemoteRendererProxy.drawEllipse(int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 121 | Medium |
Format string should use %n rather than \n in com.example.renderer.proxy.RemoteRendererProxy.drawTriangle(int, int, int, int, int, int) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 107 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Found reliance on default encoding in com.example.renderer.singleton.PersistenceManager.loadShapesFromFile(String): new java.io.FileReader(String) | I18N | DM_DEFAULT_ENCODING | 141 | High |
Found reliance on default encoding in com.example.renderer.singleton.PersistenceManager.saveShapesToFile(List, String): new java.io.FileWriter(String) | I18N | DM_DEFAULT_ENCODING | 115 | High |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
new com.example.renderer.ui.DrawingPanel(List, Renderer) may expose internal representation by storing an externally mutable object into DrawingPanel.renderer | MALICIOUS_CODE | EI_EXPOSE_REP2 | 58 | Medium |
new com.example.renderer.ui.DrawingPanel(List, Renderer) may expose internal representation by storing an externally mutable object into DrawingPanel.shapes | MALICIOUS_CODE | EI_EXPOSE_REP2 | 57 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Exception thrown in class com.example.renderer.ui.SwingUI at new com.example.renderer.ui.SwingUI() will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks. | BAD_PRACTICE | CT_CONSTRUCTOR_THROW | 133 | Medium |
Format string should use %n rather than \n in new com.example.renderer.ui.SwingUI() | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 134 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Format string should use %n rather than \n in com.example.renderer.visitor.JSONExportVisitor.visitCircle(Circle) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 97 | Medium |
Format string should use %n rather than \n in com.example.renderer.visitor.JSONExportVisitor.visitEllipse(Ellipse) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 141 | Medium |
Format string should use %n rather than \n in com.example.renderer.visitor.JSONExportVisitor.visitRectangle(Rectangle) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 119 | Medium |
Format string should use %n rather than \n in com.example.renderer.visitor.JSONExportVisitor.visitTriangle(Triangle) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 160 | Medium |
Bug | Category | Details | Line | Priority |
---|---|---|---|---|
Format string should use %n rather than \n in com.example.renderer.visitor.XMLExportVisitor.visitCircle(Circle) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 14 | Medium |
Format string should use %n rather than \n in com.example.renderer.visitor.XMLExportVisitor.visitEllipse(Ellipse) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 33 | Medium |
Format string should use %n rather than \n in com.example.renderer.visitor.XMLExportVisitor.visitRectangle(Rectangle) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 26 | Medium |
Format string should use %n rather than \n in com.example.renderer.visitor.XMLExportVisitor.visitTriangle(Triangle) | BAD_PRACTICE | VA_FORMAT_STRING_USES_NEWLINE | 43 | Medium |