Computer programs are developed to provide information which is utilized by the computer to perform various tasks which includes solving some technical problems to make life easier for people. The programmer identifies a problem and develops an algorithm with the potential to yield a solution. The source code is subsequently written and the program design gets documented.
Computer programs are expected to accurately collect, analyze and manage data on a system. The source code of these programs may contain bugs or errors that could hinder its smooth operation. PMD provides a means of identifying these errors and debugging your code to ensure that it is running optimally.
How Can PMD Help You
PMD is a handy tool that is ideal for all programmers regardless of their various skill levels. It facilitates debugging and code analysis to enable you to eliminate all flaws that may prevent the program from running seamlessly.
Some of these complexities can be accidental and not essential which could affect the way the code works. PMD enables its user to set custom rules that can be implemented when analyzing source code to detect every related error in the code. You can also write XPath rules for querying the Abstract Syntax Tree (AST), define custom rule properties and test it using a positive and negative test case to ensure that it is viable.
PMD can also identify duplicate code and eliminate them. You can also create support for a new programming language. All you need to do is to implement a new parser for the language, create node classes, token manager, and version handler. The custom rule for the language would also have to be created and tested.
PMD can be integrated into several IDEs like Netbeans and Eclipse with the help of a plugin which has the required rulesets in it. Code analysis can be automated with the help of third-party tools like Codacy.
PMD Key Features Include:
- Automation of code analysis;
- Easy integration into several IDEs;
- Supports custom rule creation for new languages;
- Supports XPath rules for querying the Abstract Syntax Tree (AST);
- Locate duplicate codes;
- Suppress warnings.
Efficient time management and accuracy is key to developing cost-effective programs. Mistakes are inevitable and debugging source code manually can be exhausting because you would have to browse through several lines of code to find errors. PMD enables you to write efficient code to save time and resources.
What's new in 6.19.0 version?
New and noteworthy:
Updated PMD Designer:
- This PMD release ships a new version of the pmd-designer. For the changes, see PMD Designer Changelog.
- Java Metrics
- The new metric “Class Fan Out Complexity” has been added. See Java Metrics Documentation for details.
- The Java rules InvalidLogMessageFormat and MoreThanOneLogger (java-errorprone) now both support Log4j2. Note that the rule “InvalidSlf4jMessageFormat” has been renamed to “InvalidLogMessageFormat” to reflect the fact, that it now supports more than slf4j.
- The Java rule LawOfDemeter (java-design) ignores now also Builders, that are not assigned to a local variable, but just directly used within a method call chain. The method, that creates the builder needs to end with “Builder”, e.g. newBuilder() or initBuilder() works. This change fixes a couple of false positives.
- The Java rule DataflowAnomalyAnalysis (java-errorprone) doesn’t check for UR anomalies (undefined and then referenced) anymore. These checks were all false-positives, since actual UR occurrences would lead to compile errors.
- The java rule DoNotUseThreads (java-multithreading) has been changed to not report usages of java.lang.Runnable anymore. Just using Runnable does not automatically create a new thread. While the check for Runnable has been removed, the rule now additionally checks for usages of Executors and ExecutorService. Both create new threads, which are not managed by a J2EE server.
- The Java rule InvalidSlf4jMessageFormat has been renamed to InvalidLogMessageFormat since it supports now both slf4j and log4j2 message formats.
- #1978: [core] PMD fails on excluding unknown rules
- #2014: [core] Making add(SourceCode sourceCode) public for alternative file systems
- #2020: [core] Wrong deprecation warnings for unused XPath attributes
- #2036: [core] Wrong include/exclude patterns are silently ignored
- #2048: [core] Enable type resolution by default for XPath rules
- #2067: [core] Build issue on Windows
- #2068: [core] Rule loader should use the same resources loader for the ruleset
- #2071: [ci] Add travis build on windows
- #2072: [test][core] Not enough info in “test setup error” when numbers of lines do not match
- #2082: [core] Incorrect logging of deprecated/renamed rules
- #2042: [java] PMD crashes with ClassFormatError: Absent Code attribute…
- #1531: [java] UnusedPrivateMethod false-positive with method result
- #2025: [java] UnusedImports when @see / @link pattern includes a FQCN
- #2017: [java] UnnecessaryFullyQualifiedName triggered for inner class
- #1912: [java] Metrics not computed correctly with annotations
- #336: [java] InvalidSlf4jMessageFormat applies to log4j2
- #1636: [java] Stop checking UR anomalies for DataflowAnomalyAnalysis
- #1627: [java] DoNotUseThreads should not warn on Runnable
- #2058: [doc] CLI reference for -norulesetcompatibility shows a boolean default value
- All the package net.sourceforge.pmd.dcd and its subpackages. See DCD.
- RuleSet#getExcludePatterns. Use the new method getFileExclusions instead.
- RuleSet#getIncludePatterns. Use the new method getFileInclusions instead.
- RuleBuilder#RuleBuilder. Use the new constructor with the correct ResourceLoader instead.
- RuleFactory#RuleFactory. Use the new constructor with the correct ResourceLoader instead.
- CanSuppressWarnings and its implementations
- CanSuppressWarnings and its implementations
- All the package net.sourceforge.pmd.util and its subpackages, except net.sourceforge.pmd.util.datasource and net.sourceforge.pmd.util.database.
Last Updated: 2019-11-04
File size: 58.03 MB
Operating system: Windows 10, Windows 8/8.1, Windows 7, Windows Vista, Windows XP
MD5 Checksum: 375dd4a3d5aa53e7a509496ac4175384