PMD
An extensible multilanguage static code analyzer. (by pmd)
Checkstyle
Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program. (by checkstyle)
Our great sponsors
- Sonar - Write Clean Java Code. Always.
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
- InfluxDB - Access the most powerful time series database as a service
PMD | Checkstyle | |
---|---|---|
19 | 15 | |
4,317 | 7,741 | |
1.3% | 0.6% | |
9.9 | 9.8 | |
1 day ago | 1 day ago | |
Java | Java | |
GNU General Public License v3.0 or later | GNU Lesser General Public License v3.0 only |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PMD
Posts with mentions or reviews of PMD.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-02-04.
-
Custom Gradle Plugin for Unified Static Code Analysis
PMD and Checkstyle are static analysis tools that check your code on each project build. Gradle allows to apply them easily.
-
Spring Boot – Black Box Testing
The generated classes should be put into .gitignore. Otherwise, if you have Checkstyle, PMD, or SonarQube in your project, then generated classes can violate some rules. Besides, if you don't put them into .gitignore, then each pull request might become huge due to the fact that even a slightest fix can lead to lots of changes in the generated classes.
-
After Java tutorials, now what???
- PMD Static Code Analysis tool: https://pmd.github.io/
-
Ask HN: What is a modern Java environment?
PMD, Spotbugs, Nullaway: Java linting/static analysis (https://pmd.github.io, https://spotbugs.github.io, https://github.com/uber/NullAway)
-
Code smell plugin
PMD, and checkstyle as well.
-
Writing Clean and Consistent Code with Static Analysis using PMD and Apex
Nearly every programming language has a static analyzer of its own. For example, golang has gofmt, which is baked into the standard tooling, while Ruby has Rubocop, a community-led project. Even compiled languages like C have their own static analyzer through astyle. However, it can be difficult (and tedious) to run several analyzers across polyglot projects. Fortunately, that’s where a project like PMD can be of assistance. PMD is a static analyzer that allows you to define a standard set of rules that can be applied over multiple languages.
Open up the config/ruleset.xml file, and you’ll find an XML document that lists several rules. These rules map to the issues which PMD will report on. Believe it or not, there are hundreds of Apex rules, and you can find the full set at the PMD repo. You have complete control over which rules to enable. Typically, you’d determine which ones are important by agreeing with your teammates on the ones that matter most. After all, their code will be statically analyzed, too!
-
Is there a tool to track CVEs for the software that we use?
While at it you could also point them to static code analyzers such as error_prone, spotbugs and pmd (use all 3 at once - they complement each other in detecting different issues).
-
How to setup CI/CD for org-based development?
For PMD specifically, we use the PMD command line tool (Github) and wire it together with some bash scripting. Most pipelines will allow you to write bash as needed. The SFDX scanner command didn't exist when we implemented this, you might be able to use that instead.
-
Is it possible to measure spaghettiness of code?
This is the definition of cohesion and there are many great tools to calculate cohesion metrics (depending on the programming language e.g Java). Cohesion metrics belong to a bigger set of metrics called OOP metrics (or ck metrics). Check out the following links: https://github.com/mauricioaniche/ck https://github.com/cqfn/jpeek https://github.com/rodhilton/jasome https://github.com/pmd/pmd
Checkstyle
Posts with mentions or reviews of Checkstyle.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-08-25.
- 5 easy paths to become a recognized Java expert. Really. For free.
-
How does Apache ShardingSphere standardize and format code? We use Spotless
1. Conflicts between Spotless and Checkstyle Checkstyle is a tool for checking Java source code for compliance with code standards or a set of validation rules (best practices).
-
Seriously who cares about the warnings
Never had anything like that though for four years my life revolved around getting PMD, checkstyle and Sonar rules to pass so my pull request would merge.
-
Code smell plugin
PMD, and checkstyle as well.
-
How can I help my partner write better code?
I’m a little out of date with Java, but I believe Checkstyle is currently popular: https://github.com/checkstyle/checkstyle
-
Why You Need Static Code Analysis
Another example can be applied to code quality itself. Most static analyzers are configurable. If you tried to set Checkstyle Google configuration to the mature project, you would probably get hundreds or even thousands of errors. You can start with just one rule. Ar first glance, it seems not so important. But after the moment when the configuration reaches the repository, you can be sure that no one else can violate this rule in the future.
-
I have made a list of 55 plus open source software list for doing various tasks
Checkstyle: a tool that helps programmers write Java code that adheres to a coding standard: https://github.com/checkstyle/checkstyle
-
Java formatter
So I was there once, sharing my solution. For my current project I use the java formatter jar, but on my previous work I was using checkstyle, you can get it from here: Checkstyle. Then pass your checkstyle xml format config.
-
I want to set some standards and practices around the development process at my company. Just looking for any tips. Has anyone done this before? Is there any reference material you might suggest?
On the coding standards side, use linters like https://github.com/checkstyle/checkstyle and https://github.com/eslint/eslint so you have an automated way to detect some errors and enforce style standards.
-
Design an Effective Build Stage for Continuous Integration
sem-version java 11 wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.41/checkstyle-8.41-all.jar java -jar checkstyle-8.41-all.jar -c /sun_checks.xml MyFile.java
What are some alternatives?
When comparing PMD and Checkstyle you can also consider the following projects:
Spotbugs - SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
SonarQube - Continuous Inspection
spotless - Keep your code spotless
Error Prone - Catch common Java mistakes as compile-time errors
infer - A static analyzer for Java, C, C++, and Objective-C
SonarJava - :coffee: SonarSource Static Analyzer for Java Code Quality and Security
FindBugs - The new home of the FindBugs project