npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codacy/tools-pmd-7

v0.2.0

Published

PMD 7 adapter — CLI-mode multi-language static analyzer

Readme

@codacy/tools-pmd-7

Table of Contents


Overview

Multi-language static analysis tool using the PMD CLI. Uses the CLI execution strategy -- spawns the PMD shell script via spawnTool() and parses its JSON output.

| Property | Value | |----------|-------| | Tool ID | PMD7 | | Codacy UUID | ed7e8287-707d-485a-a0cb-e211004432c2 | | Strategy | CLI | | Languages | Java, Javascript, Kotlin, Swift, PLSQL, XML, Apex, Velocity, VisualForce, JSP | | Binary | pmd (shell script from PMD distribution zip) | | File patterns | **/*.java, **/*.js, **/*.jsx, **/*.kt, **/*.kts, **/*.swift, **/*.sql, **/*.pls, **/*.plb, **/*.pkb, **/*.pks, **/*.xml, **/*.pom, **/*.wsdl, **/*.xsl, **/*.cls, **/*.trigger, **/*.vm, **/*.page, **/*.component, **/*.jsp |

Updating patterns

# Re-fetch pattern metadata from the Codacy API
pnpm prefetch

# Commit the result
git add src/patterns.json

Pattern IDs follow the format PMD7_category_{lang}_{categoryDir}_{RuleName}, e.g. PMD7_category_java_errorprone_EmptyCatchBlock.

Updating the PMD version

  1. Update PMD_VERSION in src/adapter.ts
  2. Update PMD_DOWNLOAD_URL and PMD_EXTRACTED_DIR constants accordingly
  3. Run pnpm prefetch to check for new/removed rules
  4. Run pnpm test to verify compatibility
  5. If the major version changes, create a new adapter package (pmd-8/)

Development

pnpm build    # Build with tsup
pnpm test     # Run tests (requires Java + PMD in PATH or installed)

To install PMD locally for testing, download from https://github.com/pmd/pmd/releases and add bin/ to your PATH. Java 8+ is required.

Notes for maintainers

  • PMD requires Java 8+ as a runtime. The adapter uses ensureJre() from @codacy/tooling to download Adoptium Temurin JDK 17 if no suitable Java is found on the system.
  • The PMD distribution is downloaded as a zip from GitHub releases and extracted to toolInstallDir/pmd-bin-{version}/.
  • The JAVA_HOME environment variable is set when invoking PMD if using a non-system Java binary.
  • PMD's JSON output format provides beginline/begincolumn/endline/endcolumn, all 1-based. No offset conversion needed.
  • PMD priority (1-5, 1=highest) maps to numeric confidence: 1-2 -> 3 (high), 3 -> 2 (medium), 4-5 -> 1 (low).
  • Pattern ID to rule reference mapping: PMD7_category_java_errorprone_EmptyCatchBlock -> category/java/errorprone.xml/EmptyCatchBlock.
  • Config file detection supports ruleset.xml and apex-ruleset.xml in the repository root.
  • When patterns are specified, a generated ruleset XML is written to the generated config dir and passed via -R.
  • When no patterns or local config is specified, PMD runs with the built-in rulesets/java/quickstart.xml.
  • The --no-fail-on-violation flag ensures PMD exits 0 even when violations are found.
  • The --file-list option is used to pass target files via a temp file rather than command-line arguments, avoiding argument length limits.
  • Processing errors (unparseable files) are mapped to AnalysisError with level "warning".
  • Configuration errors (invalid rules) are mapped to AnalysisError with level "warning".