# phpmd/phpmd

PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

Repository: https://github.com/phpmd/phpmd
Canonical: https://ross.abutalabs.com/products/phpmd
Homepage: https://phpmd.org
Language: PHP
License: BSD-3-Clause
License Family: permissive
Topics: mess-detector, php, pmd, static-analysis, static-analyzer, clean-code, hacktoberfest
Last push: 2026-08-23T08:00:38+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 8, longevity 100
- inputs: {"age_days": 5695, "days_push": 10, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2446, forks 357 (observed 2026-08-28T04:06:52.666188+00:00)

## What it is
PHPMD is a static analysis tool for PHP source code, a PHP equivalent of the Java PMD tool built on top of PHP Depend's metrics. It scans codebases for potential bugs, suboptimal code, overcomplicated expressions, and unused code using configurable rulesets.

## Use cases
- detect code smells in my php project
- find unused methods and parameters in php code
- enforce clean code rules in ci pipeline
- analyze php code complexity and cyclomatic complexity
- static analysis for php similar to pmd
- generate xml reports of php code violations
- find possible bugs in legacy php codebase

## When to choose
- you maintain a PHP codebase and want automated detection of messy or buggy code
- you need configurable rulesets for code quality gates in CI
- you want a PMD-style mess detector for PHP

## When to avoid
- you need full syntax/style linting rather than semantic mess detection (use PHP_CodeSniffer)
- your project is not written in PHP
- you need runtime error detection or dynamic analysis

## Facets
- artifact type: cli-tool
- maturity: stable
- function: linter, developer-tools, code-review
- domain: developer-tools, testing, programming-languages
- platform: cli, php, cross-platform
- tags: mess-detector, static-analyzer, clean-code, code-smells, pmd, php-depend, quality-assurance, command-line

## Member repositories
- phpmd/phpmd (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:52.666188+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:30:33.024889+00:00, confidence not recorded.
  - readme: https://github.com/phpmd/phpmd (fetched 2026-08-28T04:06:52.666188+00:00, sha c25f87ac756e)
  - homepage: https://phpmd.org (fetched 2026-08-29T10:11:49.940237+00:00, sha dd6fd1238178)
  - site_page: https://phpmd.org/about.html (fetched 2026-08-29T10:11:49.943762+00:00, sha dd6fd1238178)
  - site_page: https://phpmd.org/documentation/index.html (fetched 2026-08-29T10:11:49.946347+00:00, sha 26504ff8a807)
- Data as of 2026-08-30T08:39:29.467469+00:00.
