KafenioPanelConfiguration.java

Index Score
de.xeinfach.kafenio
FreeMind

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
DECL_COMMENTSComments in declarations
FUNCTIONSNumber of function declarations
DOC_COMMENTNumber of javadoc comment lines
RETURNSNumber of return points from functions
COMMENTSComment lines
INTERFACE_COMPLEXITYInterface complexity
BLOCKSNumber of blocks
CYCLOMATICCyclomatic complexity
LINESNumber of lines in the source file
SIZESize of the file in bytes
PARAMSNumber of formal parameter declarations
JAVA0034JAVA0034 Missing braces in if statement
JAVA0259JAVA0259 Return of collection/array field
COMPARISONSNumber of comparison operators
UNIQUE_OPERANDSNumber of unique operands
PROGRAM_VOCABHalstead program vocabulary
LOCLines of code
JAVA0270JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
LOGICAL_LINESNumber of statements
ELOCEffective lines of code
JAVA0256JAVA0256 Assignment of external collection/array to field
JAVA0117JAVA0117 Missing javadoc: method 'method'
EXITSProcedure exits
PROGRAM_VOLUMEHalstead program volume
JAVA0136JAVA0136 N methods defined in class (maximum: M)
JAVA0116JAVA0116 Missing javadoc: field 'field'
OPERATORSNumber of operators
JAVA0288JAVA0288 Inconsistent null check
EXEC_COMMENTSComments in executable code
JAVA0126JAVA0126 Method declares unchecked exception in throws
LINE_COMMENTNumber of line comments
JAVA0030JAVA0030 Private field not used
PROGRAM_LENGTHHalstead program length
JAVA0100JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
LOOPSNumber of loops
NEST_DEPTHMaximum nesting depth
package de.xeinfach.kafenio; import java.awt.Color; import java.net.URL; import java.util.Properties; import java.util.Vector; import de.xeinfach.kafenio.interfaces.KafenioPanelConfigurationInterface; import de.xeinfach.kafenio.util.LeanLogger; /** * Description: contains the KafenioPanel configuration, encapsulates the configuration of the * editor component. * * @author Karsten Pawlik */ public class KafenioPanelConfiguration implements KafenioPanelConfigurationInterface { private static LeanLogger log = new LeanLogger("KafenioPanelConfiguration.class"); public static final int STANDALONE_MODE = 0; public static final int APPLET_MODE = 1; public static final int JWS_MODE = 2; private static String defaultToolbar1Items = "NEW,OPEN,SAVE,SEPARATOR,CUT,COPY,PASTE,SEPARATOR,BOLD" + ",ITALIC,UNDERLINE,SEPARATOR,LEFT,CENTER,RIGHT,JUSTIFY" + ",SEPARATOR,STYLESELECT"; private static String defaultToolbar2Items = "ULIST,OLIST,SEPARATOR,DEINDENT,INDENT,SEPARATOR,ANCHOR" + ",SEPARATOR,IMAGE,SEPARATOR,CLEARFORMATS,SEPARATOR" + ",VIEWSOURCE,SEPARATOR,STRIKE,SUPERSCRIPT,SUBSCRIPT" + ",INSERTCHARACTER,SEPARATOR,FIND,COLOR,TABLE,SEPARATOR"; private Object kafenioParent = null; private String outputmode = null; private String contentParameter = null; private String postUrl = null; private String servletMode = null; private String servletUrl = null; private boolean unicode = false; private String treePilotSystemID = null; private String imageDir = null; private String fileDir = null; private boolean showMenuBar = true; private boolean showToolbar2 = true; private boolean showToolbar = true; private String document = null; private String styleSheet = null; private String rawDocument = null; private URL urlStyleSheet = null; private boolean showViewSource = false; private boolean showMenuIcons = true; private String language = null; private String country = null; private boolean base64 = false; private boolean debugMode = false; private String[] styleSheetFileList = null; private String codeBase = null; private boolean applet = false; private Color bgcolor = null; private Vector customMenuItems = null; private Vector customToolBar1; private Vector customToolBar2; private int mode = 0; private Properties properties = new Properties(); /** * default constructor.creates a new instance of this class. * the default toolbars are loaded. (as proposed by yangyu) */ public KafenioPanelConfiguration() { customToolBar1 = parseToolbarItems(defaultToolbar1Items); customToolBar2 = parseToolbarItems(defaultToolbar2Items); } /** * @return returns true if Kafenio should be run in applet mode, false otherwise. */ public boolean isApplet() { return (mode == APPLET_MODE); } /** * @return returns true if Kafenio should be run in web start mode, false otherwise. */ public boolean isWebStart(){ return (mode == JWS_MODE); } /** * @return returns true if Kafenio should be run in standalones mode, false otherwise. */ public boolean isStandalone(){ return (mode == STANDALONE_MODE); } /** * @return returns true if document is encoded in base64, false otherwise */ public boolean isBase64() { return base64; } /** * @return returns the background color to be set. if not set, the default system value * is assumed. */ public Color getBgcolor() { return bgcolor; } /** * @return returns true if applet should be run in debug mode, false otherwise. */ public boolean isDebugMode() { return debugMode; } /** * @return returns the applet's codebase (only applicable for isApplet() == true */ public String getCodeBase() { return codeBase; } /** * @return returns the currently set countrycode. if not countrycode is set, the default * locale is assumed. */ public String getCountry() { return country; } /** * @return returns the currently set document. */ public String getDocument() { return document; } /** * @return returns true if menu icons should be displayed, false otherwise. */ public boolean isShowMenuIcons() { return showMenuIcons; } /** * @return returns true if html source view should be displayed on startup, false otherwise */ public boolean isShowViewSource() { return showViewSource; } /** * @return returns the currently set language code */ public String getLanguage() { return language; } /** * @return returns the currently set raw document. */ public String getRawDocument() { return rawDocument; } /** * @return returns the currently set CSS Stylesheet used for this document. */ public String getStyleSheet() { return styleSheet; } /** * @return returns the list of CSS Stylesheet files to be included. */ public String[] getStyleSheetFileList() { return styleSheetFileList; } /** * @return returns the url to the CSS Stylesheet to use. */ public URL getUrlStyleSheet() { return urlStyleSheet; } /** * sets the parameter that defines if Kafenio should be run as an applet. * @param newMode application mode-ID as specified by constants */ public void setMode(int newMode) { mode = newMode; } /** * @param b true if base64 encoding should be used when reading the document into the editor. */ public void setBase64(boolean b) { base64 = b; } /** * @param color sets the applications background color. */ public void setBgcolor(Color color) { bgcolor = color; } /** * @param color parses the string into a color object and then sets the applications background color. */ public void setBgcolor(String color) { bgcolor = parseBgColor(color); } /** * @param b true if debug mode is enabled, false for debug mode disabled. */ public void setDebugMode(boolean b) { debugMode = b; } /** * @param string sets the applets codebase to the given value. */ public void setCodeBase(String string) { codeBase = string; } /** * @param string sets the countrycode to use. (i.e.: DE for germany or UK for united kingdom. */ public void setCountry(String string) { country = string; } /** * @param string sets the document text */ public void setDocument(String string) { document = string; } /** * @param b true if menu icons should be displayed, false otherwise. */ public void setShowMenuIcons(boolean b) { showMenuIcons = b; } /** * @param b true if sourceview should be displayed, false otherwise. */ public void setShowViewSource(boolean b) { showViewSource = b; } /** * @param string sets the language code to use. (i.e.: de for germany or UK for united kingdom) */ public void setLanguage(String string) { language = string; } /** * @param string sets the raw document text */ public void setRawDocument(String string) { rawDocument = string; } /** * @param string sets the css stylesheet for the document. */ public void setStyleSheet(String string) { styleSheet = string; } /** * @param strings sets the css stylesheet files to use. */ public void setStyleSheetFileList(String[] strings) { styleSheetFileList = strings; } /** * @param url sets the url to the stylesheet to use. */ public void setUrlStyleSheet(URL url) { urlStyleSheet = url; } /** * @return returns the current mode of the application as int value. */ public int getMode() { return mode; } /** * @return returns vector that contains the keys of the * menu items to be included in the menu bar. */ public Vector getCustomMenuItems() { return customMenuItems; } /** * @param vector sets the menu items in a vector that contains the keys of the * menu items to be included in the menu bar. */ public void setCustomMenuItems(Vector vector) { customMenuItems = vector; } /** * @param menuItems parses the top-level menu items to be shown from the given string. */ public void setCustomMenuItems(String menuItems) { if (menuItems != null) { customMenuItems = parseMenuItems(menuItems); } } /** * @param b true if toolbar 1 is to be displayed. */ public void setShowToolbar(boolean b) { showToolbar = b; } /** * @param b true if toolbar 1 is to be displayed. */ public void setShowToolbar2(boolean b) { showToolbar2 = b; } /** * @param b true if menubar should be displayed. */ public void setShowMenuBar(boolean b) { showMenuBar = b; } /** * @return returns true if menubar should be displayed. */ public boolean isShowMenuBar() { return showMenuBar; } /** * @return returns true if toolbar 1 should be displayed. */ public boolean isShowToolbar() { return showToolbar; } /** * @return returns true if toolbar 2 should be displayed. */ public boolean isShowToolbar2() { return showToolbar2; } /** * @param string path to image folder */ public void setImageDir(String string) { imageDir = string; } /** * @param string path to file folder */ public void setFileDir(String string) { fileDir = string; } /** * @return returns the currently set file folder path */ public String getFileDir() { return fileDir; } /** * @return returns the currently set image folder path */ public String getImageDir() { return imageDir; } /** * @param string sets the treepilot system id. */ public void setTreePilotSystemID(String string) { treePilotSystemID = string; } /** * @return returns the treepilot system id. */ public String getTreePilotSystemID() { return treePilotSystemID; } /** * @param string sets the servlet URL that is called when fetching image- or file information * for the insert anchor or insert image dialogs. */ public void setServletUrl(String string) { servletUrl = string; } /** * @return returns the servlet URL. */ public String getServletUrl() { return servletUrl; } /** * servlet mode can be either "java" or "cgi". default is "java".<BR> * if the standard tagging-servlet is used, servlet mode should be "java".<BR> * if you're using a php- or perl-script for file-input, the servlet mode should be "cgi".<BR> * <BR>interface description for mode <b>cgi:</b><BR> * the script can take the following parameters:<BR> * <UL> * <LI><B>GetImages</B> i.e.: .../lister.cgi?GetImages=true</LI> * <LI><B>GetFiles:</B> i.e.: .../lister.cgi?GetFiles=true</LI> * <LI><B>FileExtensions (optional)</B> i.e.: .../lister.cgi?GetFiles=true&FileExtensions=.gif:.jpg:.jpeg:.png</LI> * </UL> * the script must output a document of MIME-type text/plain.<BR> * the first line of the output defines the http-path to the root directory of your images and files. * each further line contains one relative file-path. * the path is relative to the root specified in the first line.<BR> * <BR>i.e.:<BR> * physical path to images root directory: /usr/local/httpd/htdocs/images<BR> * http path to images root directory: http://www.mydomain.com/images<BR> * files in the images root directory: car.gif<BR> * files in the images root directory: holiday2002/me.gif<BR> * files in the images root directory: holiday2002/myself.gif<BR> * files in the images root directory: holiday2002/i.gif<BR> * files in the images root directory: holiday2002/mygirlfriend.gif<BR> * Sample output of the script:<BR> * <tt> * http://www.mydomain.com/images<BR> * car.gif<BR> * holiday2002/me.gif<BR> * holiday2002/myself.gif<BR> * holiday2002/i.gif<BR> * holiday2002/mygirlfriend.gif<BR> * </tt> * @param newServletMode the current ServletMode (can be "cgi" or "java", case insensitive) */ public void setServletMode(String newServletMode) { if (newServletMode.equalsIgnoreCase("cgi") || newServletMode.equalsIgnoreCase("java")) { servletMode = newServletMode; } else if(newServletMode == null || "".equals(newServletMode) || "none".equalsIgnoreCase(newServletMode)) { servletMode = "cgi"; } else { throw new IllegalArgumentException("Valid arguments: \"cgi\", \"java\", \"none\""); } } /** * @param string set url to post content to for saving documents on the web. */ public void setPostUrl(String string) { postUrl = string; } /** * @return returns the post url. */ public String getPostUrl() { return postUrl; } /** * @return returns servlet mode as string. */ public String getServletMode() { return servletMode; } /** * @param string sets the content parameter. (the document to edit as string value) */ public void setContentParameter(String string) { contentParameter = string; } /** * @return returns the content as string. */ public String getContentParameter() { return contentParameter; } /** * sets the outputmode of the editor.<BR> * normal = output is standard plain-ascii html code * off = no content is posted at all * base64 = content is posted as base64 encoded ascii-string * * @param string outputmode to set (can be "normal", "off" or "base64" */ public void setOutputmode(String string) { if ("normal".equalsIgnoreCase(string)) { outputmode = string.toUpperCase(); } else if ("off".equalsIgnoreCase(string)) { outputmode = string.toUpperCase(); } else if ("base64".equalsIgnoreCase(string)) { outputmode = string.toUpperCase(); } } /** * @return returns the outputmode as string. */ public String getOutputmode() { return outputmode; } /** * @param parentApplet Parent of KafenioPanel */ public void setKafenioParent(Object parentApplet) { kafenioParent = parentApplet; } /** * @return returns the kafenioParent Object. */ public Object getKafenioParent() { return kafenioParent; } /** * keys for the items are the constants from KafenioToolBar class * @return returns vector that contains all items as string for toolbar1 */ public Vector getCustomToolBar1() { return customToolBar1; } /** * keys for the items are the constants from KafenioToolBar class * @return returns vector that contains all items as string for toolbar 2 */ public Vector getCustomToolBar2() { return customToolBar2; } /** * keys for the items are the constants from KafenioToolBar class * @param vector vector that contains all items as string for toolbar 1 */ public void setCustomToolBar1(Vector vector) { customToolBar1 = vector; } /** * keys for the items are the constants from KafenioToolBar class * @param toolbarItems string that contains all items as space separated list for toolbar 1 */ public void setCustomToolBar1(String toolbarItems) { if (toolbarItems != null) { customToolBar1 = parseToolbarItems(toolbarItems); } } /** * keys for the items are the constants from KafenioToolBar class * @param vector vector that contains all items as string for toolbar 2 */ public void setCustomToolBar2(Vector vector) { customToolBar2 = vector; } /** * keys for the items are the constants from KafenioToolBar class * @param toolbarItems string that contains all items as space separated list for toolbar 2 */ public void setCustomToolBar2(String toolbarItems) { if (toolbarItems != null) { customToolBar2 = parseToolbarItems(toolbarItems); } } /** * @return returns a string representation of this object. */ public String toString() { StringBuffer out = new StringBuffer(); out.append("codebase: "+getCodeBase()); out.append("\ncontent parameter: "+getContentParameter()); out.append("\ncountry: "+getCountry()); out.append("\ncustom menuitems: "+getCustomMenuItems()); out.append("\ntoolbar1: "+getCustomToolBar1()); out.append("\ntoolbar2: "+getCustomToolBar2()); out.append("\ndocument: "+getDocument()); out.append("\nfiledir: "+getFileDir()); out.append("\nimagedir: "+getImageDir()); out.append("\nparent: "+getKafenioParent()); out.append("\nlanguage: "+getLanguage()); out.append("\noutputmode: "+getOutputmode()); out.append("\npost url: "+getPostUrl()); out.append("\nraw document: "+getRawDocument()); out.append("\nservlet mode: "+getServletMode()); out.append("\nservlet url: "+getServletUrl()); out.append("\nstylesheet: "+getStyleSheet()); out.append("\nstylesheet file list: "+getStyleSheetFileList()); out.append("\ntreepilot sys id: "+getTreePilotSystemID()); out.append("\nstylesheet url: "+getUrlStyleSheet()); out.append("\nisApplet: "+isApplet()); out.append("\nisBase64: "+isBase64()); out.append("\nisDebugMode: "+isDebugMode()); out.append("\nisShowMenuBar: "+isShowMenuBar()); out.append("\nisShowMenuIcons: "+isShowMenuIcons()); out.append("\nisShowToolbar: "+isShowToolbar()); out.append("\nisShowToolbar2: "+isShowToolbar2()); out.append("\nisShowViewSource: "+isShowViewSource()); return out.toString(); } /** * method to parse a space separated string into a vector. * @param aString the string to parse. * @return returns a vector containing the parsed substrings. */ public Vector parseToolbarItems(String aString) { Vector tools = new Vector(); String[] buttons = null; if (aString != null) { buttons = KafenioPanel.tokenize(aString); for (int i=0; i < buttons.length; i++) { tools.add(buttons[i].toLowerCase()); } } if (tools.size() > 0) return tools; return null; } /** * parses the given string into a vector with sorted key-order. * @param menuString menu keys as string * @return returns a vector containing the menu keys. */ private Vector parseMenuItems(String menuString) { Vector menuItemList = null; if (isShowMenuBar()) { menuItemList = new Vector(); String[] menuItemsArray = null; if (menuString != null) { menuItemsArray = KafenioPanel.tokenize(menuString.toLowerCase()); for (int i=0; i < menuItemsArray.length; i++) { if (KafenioMenuBar.getOrderedMenuKeys().contains(menuItemsArray[i])) { menuItemList.add(menuItemsArray[i]); } } } } return menuItemList; } /** * @param bgColorString string that represents the color in RGB (i.e.: #FFFFFF for white.) * @return returns a Color object containing the background color. if the background-parameter was not set, * the system default (Color.gray) is returned. */ public Color parseBgColor(String bgColorString) { try { return Color.decode(bgColorString); } catch (Exception e) { log.error("bgcolor-parameter not specified. setting background color to system default."); return null; } } /** * @see de.xeinfach.kafenio.interfaces.KafenioPanelConfigurationInterface#setProperty(java.lang.String, java.lang.String) */ public void setProperty(String name, String value) { properties.setProperty(name, value); } /** * @see de.xeinfach.kafenio.interfaces.KafenioPanelConfigurationInterface#getProperty(java.lang.String) */ public String getProperty(String name) { if(properties.getProperty(name) != null) { return properties.getProperty(name); } else { return ""; } } /** * @return Returns true if unicode support for exported text is turned on. default is false. */ public boolean isUnicode() { return unicode; } /** * @param unicode if set to true, exported document text is in unicode format (no html-entities). default is false. */ public void setUnicode(boolean unicode) { this.unicode = unicode; } }

The table below shows all metrics for KafenioPanelConfiguration.java.

MetricValueDescription
BLOCKS93.00Number of blocks
BLOCK_COMMENT 0.00Number of block comment lines
COMMENTS283.00Comment lines
COMMENT_DENSITY 1.06Comment density
COMPARISONS50.00Number of comparison operators
CYCLOMATIC94.00Cyclomatic complexity
DECL_COMMENTS75.00Comments in declarations
DOC_COMMENT283.00Number of javadoc comment lines
ELOC267.00Effective lines of code
EXEC_COMMENTS 0.00Comments in executable code
EXITS46.00Procedure exits
FUNCTIONS74.00Number of function declarations
HALSTEAD_DIFFICULTY49.60Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY118.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 0.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 0.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 0.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 1.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 1.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 0.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 0.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 1.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 0.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 1.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 1.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 3.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 0.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 0.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 1.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 0.00JAVA0144 Line exceeds maximum M characters
JAVA0145820.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 1.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 0.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 4.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 4.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 2.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 0.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 1.00JAVA0288 Inconsistent null check
LINES722.00Number of lines in the source file
LINE_COMMENT 0.00Number of line comments
LOC355.00Lines of code
LOGICAL_LINES170.00Number of statements
LOOPS 2.00Number of loops
NEST_DEPTH 5.00Maximum nesting depth
OPERANDS615.00Number of operands
OPERATORS1276.00Number of operators
PARAMS40.00Number of formal parameter declarations
PROGRAM_LENGTH1891.00Halstead program length
PROGRAM_VOCAB288.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS78.00Number of return points from functions
SIZE19338.00Size of the file in bytes
UNIQUE_OPERANDS248.00Number of unique operands
UNIQUE_OPERATORS40.00Number of unique operators
WHITESPACE84.00Number of whitespace lines