SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.8.3

Threshold is medium

Effort is default

Summary

Classes Bugs Errors Missing Classes
38 50 0 0

Files

Class Bugs
com.example.renderer.adapter.LegacyRendererImpl 4
com.example.renderer.bridge.SVGRenderer 5
com.example.renderer.bridge.SwingRenderer 2
com.example.renderer.bridge.TestRenderer 5
com.example.renderer.command.AddShapeCommand 1
com.example.renderer.command.DeleteShapeCommand 2
com.example.renderer.config.GlobalConfig 3
com.example.renderer.factory.Circle 2
com.example.renderer.factory.Ellipse 1
com.example.renderer.factory.Rectangle 2
com.example.renderer.factory.ShapeFactoryImpl 2
com.example.renderer.factory.Triangle 1
com.example.renderer.proxy.RemoteRendererProxy 6
com.example.renderer.singleton.PersistenceManager 2
com.example.renderer.ui.DrawingPanel 2
com.example.renderer.ui.SwingUI 2
com.example.renderer.visitor.JSONExportVisitor 4
com.example.renderer.visitor.XMLExportVisitor 4

com.example.renderer.adapter.LegacyRendererImpl

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

com.example.renderer.bridge.SVGRenderer

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

com.example.renderer.bridge.SwingRenderer

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

com.example.renderer.bridge.TestRenderer

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

com.example.renderer.command.AddShapeCommand

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

com.example.renderer.command.DeleteShapeCommand

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

com.example.renderer.config.GlobalConfig

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

com.example.renderer.factory.Circle

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

com.example.renderer.factory.Ellipse

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

com.example.renderer.factory.Rectangle

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

com.example.renderer.factory.ShapeFactoryImpl

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

com.example.renderer.factory.Triangle

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

com.example.renderer.proxy.RemoteRendererProxy

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

com.example.renderer.singleton.PersistenceManager

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

com.example.renderer.ui.DrawingPanel

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

com.example.renderer.ui.SwingUI

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

com.example.renderer.visitor.JSONExportVisitor

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

com.example.renderer.visitor.XMLExportVisitor

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