Java Coding Rules
AppPerfect Java Code Test implements logic to enforce certain Java coding rules on a given set of Java source code. The list of rules can be viewed and managed by clicking the Rules Manager sub-menu in the Project menu. In this chapter we will look at the rules in more detail, but first let's understand the classifications for the rules.
The rules are primarily grouped based on categories. Following categories are available in AppPerfect Code Test under which the rules have been grouped:
- Garbage Collection
- Code Convention
- Unused Code
- JSP Metrics
- 64 bits
- Possible Errors
- Java Docs
- Naming Convention
- Servlet Rules
The rules are further classified on the basis of Severity. Severity is decided by the impact the rule has on the performance of the application. There are 4 levels of severity:
Critical: This level of severity indicates that the violation of this rule affects the performance of the application to a great extent.
High: This level of severity is a rung lower than critical, but affects the performance badly as well.
Medium: This level is not severe, but it will adversely affect the application's performance. And since every bit counts in getting the most out of the application, it's not wise to ignore even Medium severity violations.
Low: This level covers small issues like Empty finally blocks, Empty try blocks. The performance of the application will not be highly affected, but you are warned all the same.
The rules are identified as belonging to these levels of severity based on the knowledge and experience of various industry experts on the subject. You will find appropriate references along with most of the rules to research them further on your own.
Also, please note that the severity of a rule also depends on its category. So, for instance a rule under Category Optimization may be marked 'Critical' for optimization, but for the application's overall performance, it may have a 'medium' or 'low' severity impact.
Lastly, you can re-arrange the rules as per your requirement as AppPerfect Code Analyzer offers you the highest level of flexibility and customization-options.