This article introduces some java source code optimization and analysis tools to help us optimize code and check potential problems in the source code.
Http://java.dzone.com/articles/java-tools-source-code
1. pMD
URL: http://pmd.sourceforge.net/
PMD can scan Java source code to find potential problems similar to the following:
Possible bugs-return NULL values in try/catch/finally/switch statements; dead code-unused local variables, parameters, and private methods; unsatisfactory code-use string/stringbuffer; too complex expressions-there is no need to use the if statement or while loop to replace the for loop; repeat the code-copy/paste the code to cause bugs.
It integrates jdeveloper, Eclipse, jedit, JBuilder, bluej, codeguide, netbeans/Sun Java Studio Enterprise/creator, intellij idea, textpad, Maven, ant, gel, jcreator, and Emacs.
2. findbugs
Web: http://findbugs.sourceforge.net
Findbugs is a program that uses static methods to find Java code vulnerabilities.
3. Clover
Web: http://www.cenqua.com/clover/
This plugin allows you to measure and detect coverage without leaving the IDE environment. By using Apache ant and Maven, this plug-in can seamlessly integrate other projects. It can be easily integrated into traditional build systems through the command line interface and API system.
Features of this plug-in:
Supports fast, accurate, and configurable methods and statements; supports a wide range of report formats: HTML, PDF, XML, and swing GUI; precisely controls source code-level filtering; charts supporting code coverage and other metrics are fully compatible with JUnit 3.x & 4.X, testng, jtiger, and other testing frameworks.
4. Macer
Web: http://innig.net/macker/
Macer is a tool used by Java developers to check architecture rules. You can customize a rule file suitable for a specific project architecture, or write a general rule description for your code.
5. Emma
URL: http://emma.sourceforge.net/
Emma supports override types: Methods and classes. The output report format is text, HTML, and XML. Some projects can be highlighted in the output report. Emma does not need to access source code. You can reduce debugging information in the input class.
6. xradar
URL: http://xradar.sourceforge.net/
Xradar is an open tool for generating scalable reports for code. Currently, all Java-based systems are supported. The batch processing framework can be used to generate reports of HTML/SVG systems. Xradar can estimate the code size, complexity, code repeatability, and dependency.
7. hammurapi
Web: http://www.hammurapi.com
Hammurapi is an automatic detection tool that executes Java program code. The provided instance contains 282 hammurapi Code rules and more than 120 Java classes. This so-called detection tool can detect whether the Code violates the encoding standards at three levels.
8. Relief
URL: http://www.workingfrog.org/
Relif is a design tool that provides a brand new look for Java projects. We can make full use of our capabilities to process real instances and simplify the process by checking the size, shape, and relationship.
9. Hudson
URL: http://hudson-ci.org/
Hudson is a continuous integration tool written in Java and run in servlet containers, such as Apache Tomcat or glassfish application server. It supports SCM tools, including CVs, subversion, git, and clearcase. It can execute Apache ant, Apache Maven-based projects, arbitrary shell scripts, and Windows batch processing commands.
10. cobertura
URL: http://cobertura.sourceforge.net/
Cobertura is a free jcoverage-based Java tool used to calculate the percentage of access to tested code. It can be used to determine the test coverage of the missing part of the Java program.
11. sonarsource
URL: http://www.sonarsource.org/
Sonar is an open platform for managing code quality. Therefore, it covers seven aspects of code quality: architecture and design, repetition, unit testing, complexity, potential errors, coding rules, and comments.
Http://java.dzone.com/articles/java-tools-source-code.