A simple source code scanner and analysis utility that can help you with your work by detecting inefficient and duplicate sections.
- PMD
- Version : 5.8.1 / 6.0.0 Snapshot
- License :BSD License
- OS :Windows All
- Publisher :David Dixon-Peugh
Download Now(Snapshot)
PMD Description
PMD is a Java-based application that aims to assist programmers in correcting their code. Its main purpose is to identify common errors that can affect the efficiency of the execution.
Supported languages and detects errors in code
Its compatibility range includes popular languages, such as Java, JavaScript, XML and XSL. The source code analyzer is capable of detecting frequent flaws, such as dead code (unnecessary objects, unused variables, methods and parameters, redundant IF statements), empty catch, switch or final blocks and other possible bugs, undefined if-while statements and so on.
The application optimizes the code by finding FOR loops that can be transformed in WHILE commands to reduce the syntax complexity and execution time, identifying disposable strings and classes with conditional complexity.
Create rules for correction
The “PMD Rule Designer” is the main component included in the package, designed to help you create custom rules for code correction and error detection, and use them alongside the set of built-in ones that the application comes with. It allows you to input the code you want to process and use the XPath query language or Java classes in order to write new criterion.
Optimize code and ignore literals and annotations
In addition to this, there is another application that can be used for optimizing your code. The PMD Duplicate Code Detector has a name that clearly reveals its purpose.
Relying on the Rabin-Karp string search algorithm, it is intended for exposing duplicate chunks of code in a source directory and export them to your computer in various formats. Optionally, you can set it to include subfolders in the analysis process, as well as ignore literals, identifiers and annotations.
Conclusion
Programmers know that efficiency and accuracy are some of the most important aspects when it comes to coding. Manually correcting the code can be a tedious task, not to mention that some errors might slip away. PMD does not actually find true syntax errors that prevent your code from working properly, but it is a handy tool for spotting inefficient code.