Jdepend uses Eclipse plug-ins to improve code Quality

Source: Internet
Author: User

Install Eclipse plug-in

Installing the Eclipse plug-in is no longer easy, but only a few steps are required. Before getting started, you 'd better prepare the URL of the plug-in download site. Table 1 lists the plug-ins used in this article:

Table 1. Code improvement plug-ins and corresponding download site URLs

Tools Purpose Eclipse plug-in URL
Checkstyle Encoding standard analysis Http://eclipse-cs.sourceforge.net/update/
Coverlipse Test code coverage Http://coverlipse.sf.net/update
CPD Copy/paste Test Http://pmd.sourceforge.net/eclipse/
Jdepend Package dependency analysis Http://andrei.gmxhome.de/eclipse/
Metrics Complexity monitoring Http://metrics.sourceforge.net/update

 

 

 

Use jdepend for dependency check

Jdepend is an open-source tool that can be obtained free of charge. It provides object-oriented measurements for the package dependency to indicate the elasticity of the code library. In other words, jdepend can effectively measure the robustness (vice versa) of an architecture ).

In addition to the Eclipse plug-in, jdepend also provides an ant task, Maven plug-in, and a Java application to obtain these metric values. They have different transfer mechanisms for the same information, but the special and advantages of the Eclipse plug-in are that it can be closer to the source code (that is, during encoding).

Figure 10 shows how to use the eclipse jdepend plug-in: Right-click the source folder and choose run jdepend analysis. Be sure to select a source folder with source code; otherwise, you will not be able to see this menu item.

Figure 10. Analyze code using jdepend Analysis

Figure 11 shows the report generated when jdepend analysis is run. The package is displayed on the left and the dependency metric value for each package is displayed on the right.

Figure 11. Package dependencies in the Eclipse project

As you can see, the jdepend plug-in provides a large amount of information that helps you continuously observe changes in architecture maintainability-the biggest benefit of this is that you can see the data during coding.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.