TOGETHER 6.3 for Eclipse 3.0 This plugin is very useful. I took some time to read the DOCS of the Audits function, and there was no translation, made some simple Chinese annotations. Paste your sharing with you. Some of these terms have some guiding roles. Arrays and References array and reference Accessing NULL REFERENCE (ANR) Access empty reference Array Index is out of ing (aior) Array subscript Benefits Array Length Is Negative (ALN) Array length is negative array length is too large (alTl) array length Too big Maybe Accessing Null Reference (MANR) Maybe Access Air Reference Maybe Array Index Is Out of Range (MAIOR) A number of subscripts may exceed the range Maybe Array Length Is Negative (MALN) Array length may be negative
BRANCHES AND LOOPS Branch and Cyclic Case Label IS Unselectable (CASE branch "Case branch cannot be executed in Infinite Loop (IL) detection of infinite loop Infinite Recursion (IR) detects unlimited recursive label is not used (lnu) unused labels Loop Body Is Executed Exactly OnCE (LBEEO) The loop body is actually only performed a loop body is never executed (lbne) cycle actually does not execute Statement IS Unreachable (SU) can never be executed.
Situation Accessing static Members Coding Style code style switch Statement Should Include the Default Case (SSSIDC) switch statements should include a default of by the Descendant Class Name (ASMDCN) should not be static member subclasses access the parent class (belonging to which class the direct use Which class) Accessing Static Member Through Object (ASMO) should not access static members (directly using class) Assignment to formal parameter (possibly wrong, consider using temporary variables) Complex Assignment (CA ) Complex assignment Complex Initialization Or Update Clause In for loop (CIUCFL) Decoction in the loop Declare List and set variables with the Type Of Their Interface (DLSV) Try to define variables using list and set interfaces. Instead, the specific type long file (lf) try to avoid files too long (Sun Agreement Do not exceed 2000 rows) Multiple Statements On One Line (msol) Avoid writing multiple statements Negation Operator in if statement (nois) Try not to use in the IF statement Non-operated (Switching IF ELSE) Non-Final Static Attribute (NFSA) Try to set static properties to FinalNuMerical Literal In Code (NLC) Do not use numbers directly, replace Operator? Should Not Be Used (OSNBU) Try not to use? Operator PARENTHESIZE CONDITIONAL EXPRESSION IN OPERATOR?: (PCO) In operation, use parentheses to place the conditional expression to place the constant on the same side of the comparison in the same side of the comparison. Place Decarathen At the beginni NG Of Block (PDBB) Place the statement in the beginning of the statement block The provision Incremental in for Statement (PIFS) will provide increment in the for statement (otherwise do not use for statement) Referencing Implementation package (RIP) Reference (should Try to use the interface package) RESTRICTED CLASS DECLATION (RCD) closed class declaration (resulting in external unacceptable) String Literal (SL) string hardcodes (Try to use resource files) Temporary Variable is buy for several purposes (TVUSP) temporary variables In a variety of purposes (as long as possible) Use this expenditly to access class memory (UTE) Using THIS to understand that the use of the class member Use Abbreviated Assignment Operator (UAAO) uses the downloaded assignment operation (such as A = I instead of A = a i)
Critical Errors Key Error Command Query Separation Query Method (Non-change Status) No Separate (To Expressive) Hiding Inherited Attribute Subclass redefines the properties of the parent class (using the same gerite) HIDING Inherited The Static Method subclasses redefine the static method of the parent class (using the same method name) Inaccessible Matching Constructionors or methods is not easy to match the constructor or method (the type of parameter is close to the difference) Index Out of Bounds subscript crossed Invalid Method Call Order Invalid method Call order (determined by configuration file fsa.xml) Invalid Type Cast or Check Invalid Type Force Transfer or Check Multiple Visible Declarations With The Same Name The property name and method name of the visible (easy to misunderstand) Overriding non-Abstract Method with Abstract Method Classify the non-abstract method of the parent class to abstract way Overriding Private Method overwrites the private method of the parent class Overriding the Subclass subclass without proper overriding the parent class method, and becomes a new method for the new method, RESOT NOT Found in Boundle's resources are not found in the resource package
Declaration style declaration style Abstract Class Declaration (ACD) Checking abstract class declarations (not included in abstract methods or constructing) Always Override Object.hashcode () When you override object.equals () To override Equals (), you should also override the Hascode () Avoid Using Universal Exception Specifiers (AUES) to avoid using the full-capacity, you should use the specific exception Class Should Be Interface (CSI) class can be used as an interface Conflict With System. class (CWCS) Nomenclature and class name conflict constant private attribute should be Final (CPASBF) private constant attribute should be defined as finalConstant variable should be Final (CVSBF) constant variable should be defined as finalDeclare clone () throws CloneNotSupportedException for Cloneable class (DCFC ) Declaring Clone () method When you () method To declare the variable Decine Constant in Interface (DCI) defined in the interface (not in the class) hiding name (hn) hiding name (hn) may be misused in the interface. Member Variable IncorRect Main () Method Declaration (IMMD) "Incorrect Main () method declares (generally public static void main (String [])" "Inner Class Does Not Use Outer Class (INUO) embedded category is not used Class (At this time, it is recommended to declare the embedded class for static) Instant Class Should Be final (ICSBF) This suggest that all classes that can be instantiated should be declared as Final (lost flexibility) MEMBER CAN Be Made Priv ATE (MCP) members can be declared as privateenon-static methods (mnui) non-static methods without using instance variables (then declare the method as static) Order of Declaration of Class MEMBERS (ODCM) The order (generally: class (static) variable, instance variable, constructor, other methods, and pressing the order of public-> protect-> package-> private) Place Operations with Same Name Together (POSNT) will be the same name Operation together Place Public Class First (PPCF) Put the public class in the front SERIALIZABLE CLASS DECLATION (SCD) The declaration of the serialized class is correct (when the serialization class does not include Non-Static and Non-Transient Domain When the inherited parent class is a non-serialized and has no parameterless constructor-free constructor, it gives a warning that the declaration of the Utility Class Declaration (UCD) tool class should set the constructor to PrivateSign by Contract Contract Design by Design By Contract CONDITION VIOLATION (DBCV) Whether it violates contract design
Design Flaws Design The Data Class (DC) Data class (lacking behavior and seriously relying on other classes) Data Clump (DCL) data clusters (data and operations can be split into different class classes) Feature Envy (Fe) function envious (A type of way actually interested in another class of data, meaning that this method may make the wrong place) Field Is Used As Temporary Variable (FUTV) domain is used as a temporary variable using god class (gc) God class (Almost omnipotent class) God method (GM) God Method (Similar God) GOD Package (GP) God package (including excessive features package, borne to reuse) ISP Violation (ISPV) violation of interface separation principles (Try not to define too many features in an interface) The LONG Message Chain (LMC) commission method constitutes too long message chain (A method of class A to call C method, and the A method of Class B is called Class C A method, so) Member IS Used by Only One SubClass (MUOS) The member of the parent class is only used by individual subclasses (there is no versatility, it should be put into subclass) Misplaced Class (MC) may be in the gap Wrong to this package of class REFUSED BEQUEST (RB) reject the legacy (refusing to use the parent class data or method, this may be a class relationship is not designed) SHOTGUN SURGERY (SS) bomb modification (refer to a modification of a certain) It will be very large, and it is difficult to find out the impact-around impact, it is not easy to reconstruct the different subclasses returned in all subclasses. It is only the constant value returned. Subclasses Have the Same MEMBER (SSM) Each subclass has the same member (should be placed in the parent class) SUSPICIOS SWITCH STATEMENT USAGE (SSU) always doubts the use of the Switch statement (Switch is often a process-oriented product, should try to take the object-oriented method to remove Switch Statements) Use interface instead of specific implementation using the interface (follow the interface-based programming principle) Use Singleton Pattern (USP) use single instance mode (for those who only static variables) Class, should consider using single instance mode, and only expose a static method to get an instance, other methods are non-static) Wide Subsystem Interface (WSI) too many subsystem interfaces (lack of appearance, you should use the appearance mode integration) Documentation Document Bad Tag In Javadoc Comments (BTJC) There is a bad label in Javadoc Comment Providual File Comment (SUN Convention) Provide Javadoc Comment (PJDC) provides Javadoc comments (Sun Conventions)
Duplicated Code Duplicate Code Duplicated Code (DC) Repeat Code Duplicated Code In Conditional Branches (DCCB) There is a duplicate code Duplicated Code in Constructors (DCC) in the conditional branch in the constructor.
Expressions Expression Argument Value Is Invalid (AVI) Parameter Value Invalid Comparison ALWAYS Produces The Same Result (CSR) Compare Always return the same value (extra comparison) DATA IS LOST IN RESULT OF TYPE CONVERSION (DL) Type conversion caused data loss (Big integer conversion to small integers) Disjoint Bit Masks (DBM) non-intersecting bit masks (comparison of bit operation expressions) Division By Zero (DBZ) Division By Zero (DBZ) EXPRESSION VALUE IS ALWAYS Zero (EVAZ) Expression Value Always zero Expression Value IS Constant (EVC) The value of expression is constant Expression Value Is Not Used (EVNU) Expression Value Unused Expression Value Is Floating-Point Infinity or Nan (FIN The value of the expression is an infinity floating point number or not a digital Integer Division in Floating-Point Context (IDFC) floating point content in the integer except (unexpected integer value rather than floating point values) Integer overflow or underflow (IOU) Integer overflow or underflow (Note Scope similar to int or long type) Maybe Data is Lost In Result Of Type Conversion (MDL) Type Conversion may cause data loss Maybe Shift count is out of ing (mscor) shift count Over-range Operation Has No Effect (One) does not cause an operation (extra operation) Shift count is out of ing (scor) shift count Benefits (OK) METRIC VIOLATIONS Violation statistics Metric Violation (MV) Metric function of TOGETHEREC Combination (very powerful function, statistics are very thin)
Naming style Name File Name (CNSMFN) Class name should match the file name Name of Exception Class (NEC) anomaly naming should be at the end of the EXCETION Naming Conventions (NC) naming convention (class or interface name , Domain, variable name start lowercase, constant should write all over cases, etc.) Package Name (PN) package name should start with domain name (COM, ORG, etc.) or country code (CN, RU, etc.) start USE CONVENTIONAL VARIABLE NAMES (UCVN) usage Variable name
Performance Performance Appending to String Within loop String to accumulate in the loop (instead of using StringBuffer) Avoid using 'new' keyword when Creating String Objects to hold String Literal avoid created using new String object (directly string) Complex Loop Expression avoid Using complex expressions Declaring Variables Inside loops to avoid declaring variables Duplicated Type Cast repetitions in the loop to force the inefficient conversion inefficient conversion (with Integer.Parseint (s) instead of Integer.Valueof (s) .intValue (), substituting Integer.toString (i) new Integer (i) .toString ()) multiple String Concatenations avoid the use of a plurality of splicing String (instead of using StringBuffer) Replace nested If-Else statements with Switch switch is replaced with a nested if-elseStore Returned Value in local variable avoids the return value in the local variable Too Many Switch Statement Cases Excessive Switch Condition Portability Portability Portability Portability Portability Portability Porta / n 'or' / R 'As Line Separator avoids use / n or / r hard Encoded into a resort ("line.separator") replaced by system.seParator) Avoid Using 'java.awt.peer. *' Package avoids using java.awt.perr. * Pack (only for AWT internal) AVOID USING User -defined native methods Avoid using user-defined Native Method Identifier Conflicts With Keyword uses identifiers with keyword conflicts (including package names, which may cause conflicts: const, delegate, enum, goto, internal, template, vi RTUAL) Implementation of System Interface Avoid implementing system-level interfaces (such as Java.SQL package) Non-portable call avoids non-portable calls (such as system.getnv (), use system.getproperty () replacement)
Possible Errors Possible Error Assignment In Conditional Expression Assignment To 'for' Loop Variable In For Variable Assignment Break Statement Is Missing Before Case Case Case No Break Statement (such as special, please add a note) CALLING Abstract Method from Constructor In Abstract Class calls an abstract method (no initialization at the time of initialization) comparining floating-point value compared to floating point values (less use ==) Comparison Of Short with CHAR Short and Char (compare SHORT & 0xFFFF) Constants With Equal Values have the same value of the ContraDictory Operation WITH Container Class to perform errors for containers (such as putting into Point, retesting Cast into line) ContraDictory Type Cast Or check wrong type Cast and checking Discordant Usage of Cast operator and check of Cast error Discordant usage Returned Value of qualificator method checks resulting from incorrect use of the type codes of 'instanceof' and Cast operators instanceof and Cast, inconsistent empty Catch Block empty Catch block enumeration constant is not Handled in Switch statement enumeration constants have not all been switch processing Explicit call to 'finalize ()' call finalize () as many Explicitly initialize All variables initialize all variables Heterogeneous Container Do not put different types of objects INCOMPATIBLE ENUMERATION TYES Usage in the same container does not consistently use the material inco RRECT 'Finalize ()' method () method (finalize () is only one form, and finally needs to call Super.Finalize ()) Incorrect Array Copy Error Copy (Check if system.Arraycopy () is used correctly) iTeration Variable is not used in loop Body iterative variable does not use Maybe IncorRect Enumeration definition in the loop may be an error enumeration definition (can analyze the value of duplicate or unfained sequences) Maybe Wrong Assumption About Operator Precedence may be wrong to assume Operator priority method is not overriden by missyping may not have a backup method Misplaced Argument position may make the wrong parameter location (can be found when the name of the parameter and the first parameters) Mixing Logical Operators Without ParentheSes may not be added parentheses There is also a logic error Non-Case Label in switch Statement less Casement in the Switch statement.
Caused a mist to the Labelnon-Constructor Method with the Same Name as Decilange enabling the same name with the constructor, the Object May Be Not Finalized object may not be released (not placed in the finally block) Operation Has Suspicious Side Effects action have side effects Place statement in block statements should be placed in the block may overflow Public and package attributes exposed attributes (using} {) possible Integer overflow Before conversion converted into long to Long int (bad package) Replace Inequality Comparison with Equality Comparison is trying to use equal, not, for example, smaller than Socket IO Problems Socket IOQ IO Question Static Attribute Body No content Static Attribute Used for Initialization Non-final Static Attributes Should not be used to initialize Suspicious Break / Continue may be wrong BREAK / ContinueSpicious for Statement may be wrong for Foruse 'l' instead of 'L' at the end of integer constants to use uppercase Luse 'Equals' instead of '==' as possible with Equals instead of lowercase luse 'equals' instead of '==' Empty Synchronized Statement Or Finally Block (ESF) Empty statement or FINALLY block. Equality Operations On Boolean Arguments (EOBA) Avoid equal comparisons on Boolean parameters (direct use or use! To determine) such as success == false replacement! Success "Exception Declared In Throws Clause Is Never Thrown (ent) throws declaration An exception never throws import list construction (ILC) repeated introduction (introduced and specifically introduced) MEMBER IS NOT Used (MNU) Unused member ObsoleTe Interface Modifier (Oim) Abandoned interface modifier (Abstract The modifier is not recommended to modify the interface) Return Value Is Not Used (RVNU) Return Value Nenes from Unnenecessary Member Modifier (UMM) Unnecessary Return Statement Parentheses (URSP) Excess retranscript parentheses Unnenecessary Type Cast (UC ) Excessive type Forced Conversion Unused Local Variable or Formal Parameter (ULVFP) Unused local variables or meticulum