pmd/README.md

174 lines
6.1 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Added line: 197
Added line: 3456
Added line: 996
Added line: 3641
# PMD - source code analyzer
Added line: 9948
![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/main/docs/images/logo/pmd-logo-300px.png)
Added line: 6023
Added line: 6752
Added line: 1666
[![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://github.com/pmd/pmd/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/pmd/pmd/actions)
Added line: 9428
Added line: 8307
Added line: 5656
Added line: 9073
Added line: 379
Added line: 7887
Added line: 5565
Added line: 9358
Added line: 3986
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd)
Added line: 7996
Added line: 5862
[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme)
[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg?branch=main)](https://coveralls.io/github/pmd/pmd?branch=main)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://app.codacy.com/organizations/gh/pmd/dashboard)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
Added line: 9600
Added line: 3596
Added line: 6847
Added line: 9652
[![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/)
Added line: 9163
Added line: 1822
**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.
Added line: 5219
Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce,
Added line: 4152
Added line: 5266
Added line: 1747
Added line: 8657
Added line: 1802
Added line: 6277
Added line: 411
Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL.
Added line: 707
Added line: 2944
Scala is supported, but there are currently no Scala rules available.
Added line: 7518
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
Added line: 826
Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.
Added line: 7368
Added line: 4
## 🚀 Installation and Usage
Added line: 306
Download the latest binary zip from the [releases](https://github.com/pmd/pmd/releases/latest)
Added line: 2410
Added line: 2360
Added line: 8378
Added line: 1631
Added line: 5829
Execute `bin/pmd check` or `bin\pmd.bat check`.
Added line: 4259
See also [Getting Started](https://docs.pmd-code.org/latest/pmd_userdocs_installation.html)
Added line: 6755
**Demo:**
This shows how PMD analyses [openjdk](https://github.com/openjdk/jdk):
![Demo](docs/images/userdocs/pmd-demo.gif)
There are plugins for Maven and Gradle as well as for various IDEs.
See [Tools / Integrations](https://docs.pmd-code.org/latest/pmd_userdocs_tools.html)
## How to get support?
Added line: 9673
Added line: 4858
Added line: 8880
* How do I? -- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/pmd)
Added line: 4996
* I got this error, why? -- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/pmd)
or on [discussions](https://github.com/pmd/pmd/discussions).
Added line: 283
* I got this error and I'm sure it's a bug -- file an [issue](https://github.com/pmd/pmd/issues).
Added line: 8625
Added line: 1481
* I have an idea/request/question -- create a new [discussion](https://github.com/pmd/pmd/discussions).
Added line: 4762
* I have a quick question -- ask in our [Gitter room](https://app.gitter.im/#/room/#pmd_pmd:gitter.im).
Added line: 390
Added line: 3080
Added line: 124
Added line: 3074
* Where's your documentation? -- <https://docs.pmd-code.org/latest/>
Added line: 7903
Added line: 3362
Added line: 3918
## 🤝 Contributing
Added line: 2452
Added line: 2952
Added line: 7325
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Added line: 3190
Our latest source of PMD can be found on [GitHub](https://github.com/pmd/pmd). Fork us!
Added line: 9208
Added line: 4065
* [How to build PMD](BUILDING.md)
Added line: 5883
Added line: 577
Added line: 634
Added line: 5011
Added line: 5941
* [How to contribute to PMD](CONTRIBUTING.md)
The rule designer is developed over at [pmd/pmd-designer](https://github.com/pmd/pmd-designer).
Added line: 4274
Please see [its README](https://github.com/pmd/pmd-designer#contributing) for
developer documentation.
Added line: 1263
## 💵 Financial Contributors
Added line: 1554
Become a financial contributor and help us sustain our community. [Contribute](https://opencollective.com/pmd/contribute)
Added line: 7776
## ✨ Contributors
Added line: 8951
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
Added line: 6606
Contributions of any kind welcome!
Added line: 7479
Added line: 9128
Added line: 1345
Added line: 1060
Added line: 7873
Added line: 902
Added line: 1538
See [credits](docs/pages/pmd/projectdocs/credits.md) for the complete list.
Added line: 1414
Added line: 5382
## 📝 License
Added line: 5436
Added line: 7077
[BSD Style](LICENSE)
Added line: 7917