# phpmetrics/PhpMetrics

Beautiful and understandable static analysis tool for PHP

Repository: https://github.com/phpmetrics/PhpMetrics
Canonical: https://ross.abutalabs.com/products/phpmetrics
Homepage: https://phpmetrics.github.io/website/
Language: PHP
License: MIT
License Family: permissive
Topics: static-analyzer, quality, php, metrics, ci
Last push: 2026-08-21T18:05:51+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 72, longevity 100
- inputs: {"age_days": 4646, "days_push": 12, "days_rel": 24, "gap_med": 152, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2614, forks 261 (observed 2026-08-28T04:07:04.513201+00:00)

## What it is
PhpMetrics is a static analysis tool for PHP that computes quality metrics about projects and classes. It generates a beautiful, readable HTML report and can be integrated into continuous integration pipelines.

## Use cases
- measure code quality metrics of a PHP project
- generate an HTML report of PHP class complexity
- enforce quality rules in CI for PHP code
- find maintainability issues in a PHP codebase
- analyze coupling and cohesion of PHP classes

## When to choose
- you maintain a PHP codebase and want quantitative quality metrics
- you want visual HTML reports of code health
- you need static analysis gates in your CI pipeline

## When to avoid
- your project is not written in PHP
- you need full static type checking rather than metrics (use PHPStan or Psalm)

## Facets
- artifact type: cli-tool
- maturity: active
- function: static-site-generator, developer-tools, monitoring
- domain: developer-tools, testing, performance
- platform: php, cli, cross-platform
- tags: static-analysis, code-quality, code-metrics, html-report, php

## Member repositories
- phpmetrics/PhpMetrics (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:04.513201+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:20:34.670297+00:00, confidence not recorded.
  - readme: https://github.com/phpmetrics/PhpMetrics (fetched 2026-08-28T04:07:04.513201+00:00, sha 4cc018b0a35c)
  - homepage: https://phpmetrics.github.io/website/ (fetched 2026-08-29T10:03:24.546759+00:00, sha 413fd7f519ed)
- Data as of 2026-08-30T08:39:29.467469+00:00.
