An extensible multilanguage static code analyzer.
Andreas Dangel 4f766035a4
[java] Fix #5263 - UnnecessaryFullyQualifiedName FP with forward references (#5353)
Merge pull request #5353 from oowekyala:issue5263-ufqn-forward-ref
2024-11-22 09:48:25 +01:00
.ci Change branch master to main 2024-09-13 09:59:51 +02:00
.github Bump build-tools from 27-SNAPSHOT to 27 2024-09-26 17:01:00 +02:00
.mvn/wrapper Bump maven from 3.9.6 to 3.9.8 2024-06-28 12:58:29 +02:00
docs [doc] Update release notes (#5263, #5353) 2024-11-22 09:47:53 +01:00
pmd-ant [ant] Formatter: avoid reflective access to determine console encoding 2024-10-25 18:33:36 +02:00
pmd-apex [doc] Update release notes (#5303, #5302) 2024-11-17 15:30:59 +01:00
pmd-cli [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-coco [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-core Fix junit 5 warning 2024-11-18 11:43:51 +01:00
pmd-cpp [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-cs [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-dart [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-dist Bump org.apache.commons:commons-compress from 1.26.0 to 1.27.1 2024-11-11 03:35:46 +00:00
pmd-doc [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-fortran [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-gherkin Pass linters in generated code 2024-11-15 11:27:07 -03:00
pmd-go [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-groovy [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-html [html] Test for a closing tag when determining node positions 2024-11-14 17:07:37 +01:00
pmd-java [java] UnnecessaryFullyQualifiedName - improve test case 2024-11-22 09:46:35 +01:00
pmd-javascript [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-jsp [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-julia Add deprecated code for backwards compatibility 2024-11-15 16:01:45 -03:00
pmd-kotlin Suppress style warnings on generated file 2024-11-14 16:55:55 -03:00
pmd-lang-test [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-languages-deps [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-lua [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-matlab [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-modelica [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-objectivec [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-perl [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-php [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-plsql [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-python [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-ruby [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-scala-modules [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-swift [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-test [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-test-schema [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-tsql [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-ui Leave a readme behind 2019-03-03 12:04:55 +01:00
pmd-velocity [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-visualforce [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
pmd-xml Merge branch 'main' into pr-5296 2024-10-31 12:17:57 +01:00
.all-contributorsrc Merge branch 'main' into pr-5303 2024-11-17 15:25:24 +01:00
.gitattributes Add maven wrapper, use maven 3.5.0 2017-05-05 11:37:41 +02:00
.gitignore Add new apex rule ApexUnitTestClassShouldHaveRunAs 2022-10-11 16:47:16 +02:00
antlr4-wrapper.xml Rename parser before annotating to ensure files are found 2024-11-14 16:47:20 -03:00
BUILDING.md Update maven wrapper 2022-01-14 16:18:21 +01:00
code_of_conduct.md Add code of conduct 2020-04-17 16:13:34 +02:00
CONTRIBUTING.md Change branch master to main 2024-09-13 09:59:51 +02:00
Dangerfile Change branch master to main 2024-09-13 09:59:51 +02:00
do-release.sh Change branch master to main 2024-09-13 09:59:51 +02:00
Gemfile Change branch master to main 2024-09-13 09:59:51 +02:00
Gemfile.lock Bump rouge from 4.5.0 to 4.5.1 in the all-gems group across 1 directory 2024-11-18 03:46:56 +00:00
javacc-wrapper.xml Use plugin-classpath to simplify javacc-wrapper.xml 2024-10-13 12:28:16 +02:00
LICENSE Update license info 2019-09-07 16:09:33 +02:00
mvnw Bump maven from 3.9.6 to 3.9.8 2024-06-28 12:58:29 +02:00
mvnw.cmd Bump maven from 3.9.6 to 3.9.8 2024-06-28 12:58:29 +02:00
NOTICE Update license info 2019-09-07 16:09:33 +02:00
package-lock.json Update package-lock.json 2022-01-29 10:11:55 +01:00
package.json Add package.json for all-contributors 2021-08-20 16:45:55 +02:00
pom.xml Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 2024-11-18 04:05:13 +00:00
README.md Update README.md 2024-10-03 17:47:01 -03:00
SPONSORS.md Update SPONSORS.md 2024-03-18 19:18:56 +01:00

PMD - source code analyzer

PMD Logo

Join the chat Build Status Maven Central Reproducible Builds Coverage Status Codacy Badge Contributor Covenant Documentation (latest)

PMD is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with Java and Apex, but supports 16 other languages. It comes with 400+ built-in rules. It can be extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query.

Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. Scala is supported, but there are currently no Scala rules available.

Additionally, it includes CPD, the copy-paste-detector. CPD finds duplicated code in Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.

🚀 Installation and Usage

Download the latest binary zip from the releases and extract it somewhere.

Execute bin/pmd check or bin\pmd.bat check.

See also Getting Started

Demo:

This shows how PMD analyses openjdk:

Demo

There are plugins for Maven and Gradle as well as for various IDEs. See Tools / Integrations

How to get support?

🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Our latest source of PMD can be found on GitHub. Fork us!

The rule designer is developed over at pmd/pmd-designer. Please see its README for developer documentation.

💵 Financial Contributors

Become a financial contributor and help us sustain our community. Contribute

Contributors

This project follows the all-contributors specification. Contributions of any kind welcome!

See credits for the complete list.

📝 License

BSD Style