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:

  1. Optimization
  2. OOPs
  3. Garbage Collection
  4. Code Convention
  5. EJB
  6. Security
  7. Unused Code
  8. Internationalization
  9. Metrics
  10. JSP Metrics
  11. Portability
  12. 64 bits
  13. Possible Errors
  14. Java Docs
  15. JSP
  16. JUnit
  17. Naming Convention
  18. Servlet Rules
  19. J2ME
  20. Struts
  21. Hibernate

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:

  1. Critical: This level of severity indicates that the violation of this rule affects the performance of the application to a great extent.

  2. High: This level of severity is a rung lower than critical, but affects the performance badly as well.

  3. 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.

  4. 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.

We use cookies for analytics, advertising and to improve our site. By continuing to use our site, you accept to our Privacy policy and allow us to store cookies.