GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jborgers/PMD-jPinpoint-rules: PMD rule set for responsible Java and Kotlin coding: performance, sustainability, multi-threading, data mixup and more.

BranchesTags
Open more actions menu

Latest commit

 

History

1,431 Commits
1,431 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.mvn/wrapper
.mvn/wrapper
 
 
docs
docs
 
 
rulesets-merger
rulesets-merger
 
 
rulesets
rulesets
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
_config.yml
_config.yml
 
 
merge
merge
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 
test
test
 
 
testkt
testkt
 
 

Repository files navigation

PMD-jPinpoint-rules

Static code checking rules for responsible Java and Kotlin programming built on PMD, sponsored by Rabobank.

These rules are on performance, sustainability, multi-threading, data mix-up, and more.

Quickstart

The quickest way to see these rules in action is to install the IntelliJ PMD plugin:

Settings > Plugins > Browse Repositories > Search 'PMD' > Select 'PMD' > Install > Close > OK > Restart

Next, add the Java and/or Kotlin rule sets:

Settings > Tools > PMD > RuleSets > + > Choose RuleSet > drop down > Choose 'jpinpoint-kotlin-rules' or 'jpinpoint-java-rules' > OK > OK

IntelliJ PMD dropdown

Then right-click on a source folder or file and choose:

Run PMD > Custom rules > jpinpoint-java-rules or jpinpoint-kotlin-rules

IntelliJ PMD run

The result is a list of violations of the rules, with a description and a link to documentation on the rule, the problem and the solution.

IntelliJ PMD results

Purpose

The aim of this project is to create, manage and share these rules, to code better software together: better software which is faster, uses less resources, has a smaller ecological footprint, is more stable, more confidential, with less effort and lower cost. More general, to promote responsibility by considering the concerns of the user, the environment, the engineer, the community and the company.

We have distilled these code checks from what we learned in several years of analyzing performance problems and failures found in code, tests and production situations. And the ruleset is growing every month.

We didn't find these checks in other places, like the standard PMD, FindBugs/Spotbugs, Checkstyle or Sonar rules. We are working with the PMD-team to move some of the jpinpoint rules in the standard rule set, as well as make PMD suitable for Kotlin.

Documentation

  • JavaCodePerformance
  • JavaDataAccessPerformance
  • JavaCodeQuality

Presentations and articles

  • How Bol uses the jPinpoint rules: How to prevent common performance defects with the jPinpoint PMD rules
  • Jeroen Borgers presented at J-Fall Virtual: Fixing your performance and concurrency bugs before they bite you
  • Jeroen Borgers presented at Amsterdam JUG about the why, what and how of these code checking rules: Performance problem prevention | slides

Ways to use the rules

Run the jPinpoint rules from the command-line using the PMD tool, from your favorite development environment with a PMD-plugin, or in SonarQube with the sonar-pmd-jpinpoint plugin next to the Sonar pmd plugin.

To use the ruleset you can install:

  • the PMD command line tool from PMD project at github and/or
  • the PMD-Plugin in your development environment.

PMD command line tool

After installing the PMD tool you can run pmd similar to the following

pmd check \
    -R PMD-jPinpoint-rules/rulesets/java/jpinpoint-rules.xml \
    -d $your-project-src \
    -f text

IntelliJ IDEA with PMD Plugin

  • You need version 2024-1+ of IntelliJ. The Community Edition is fine.

  • Install PMD Plugin:

    Settings > Plugins > Browse Repositories > Search 'PMD' > Select 'PMD' > Install > Close > OK > Restart
    
  • Next, configure (add) the ruleset from this repo by URL to always be up-to-date:

    Settings > Tools > PMD > RuleSets > + > Choose RuleSet > drop down > Choose 'jpinpoint-rules' 
    
  • Alternatively, download and add your local copy: rulesets/java/jpinpoint-rules.xml

    • remember to download regularly to get up-to-date
  • Options tab: optionally check 'Skip Test Sources' and optionally set your Java version

  • You can now perform the code checks using [right-click] on a folder or a file and choose:

    Run PMD > Custom rules > jpinpoint-rules
    
  • If you want a short description on a violation: hover over a violation title to get a popup with a description.

  • Documentation on a violation is shown on the right hand side after clicking a violation. More details of the problem and solution are shown with right-clicking 'Details'.

Eclipse with PMD Plugin

The Acanda PMD plugin seems to be the best one to use.

  • Import it into eclipse.
  • enable PMD through the properties of the project
  • add the ruleset from this project rulesets/java/jpinpoint-rules.xml

SonarQube with Plugins

In SonarQube, you need to install sonar-pmd plugin from the marketplace, and sonar-pmd-jpinpoint plugin for these jpinpoint rules.

Development and contribution

Development docs (building, tests, adding rules, merging rules) are in CONTRIBUTING.md

License

PMD-jPinpoint-rules is licensed under the Apache License, Version 2.0.

About

PMD rule set for responsible Java and Kotlin coding: performance, sustainability, multi-threading, data mixup and more.

Topics

concurrencydata-mixupjavakotlinmulti-threadingperformancepmdpmd-pluginquality-assurancerulesetstatic-code-analysissustainability

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

60 stars

Watchers

3 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.