phpmetrics/PhpMetrics

Beautiful and understandable static analysis tool for PHP

PHP

2,617

646 commits

updated Aug 21, 2026

See the code

README

PhpMetrics

Packagist Downloads License Latest Stable Version

Standard report

PhpMetrics

PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report.

Documentation | Twitter | Contributing



Quick start

Follow the quick start guide to get started.

# install the package as a dev dependency
composer require phpmetrics/phpmetrics --dev

# run PHPMetrics to analyze a folder and generate a report
php ./vendor/bin/phpmetrics --report-html=myreport <folder-to-analyze>

Then open the generated ./myreport/index.html file in your browser.

You can use a configuration file to customize the report, add options, configure rules for Continuous Integration, etc.

Metrics

You'll find detailed list of metrics in documentation, or running php ./vendor/bin/phpmetrics --metrics

Author

License

See the LICENSE file.

Contributing

See the CONTRIBUTING file.

Support the project

PHPMetrics is built and maintained on free time. If it saved you some of yours:

  • ⭐ Star the repository. It costs nothing and it is how most developers discover the tool.
  • ❤️ Become a sponsor. Sponsorship directly funds maintenance time and the addition of new features and metrics.
ci
metrics
php
quality
static-analyzer

phpmetrics/PhpMetrics

Beautiful and understandable static analysis tool for PHP

PHP

2,617

646 commits

updated Aug 21, 2026

See the code

README

PhpMetrics

Packagist Downloads License Latest Stable Version

Standard report

PhpMetrics

PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report.

Documentation | Twitter | Contributing



Quick start

Follow the quick start guide to get started.

# install the package as a dev dependency
composer require phpmetrics/phpmetrics --dev

# run PHPMetrics to analyze a folder and generate a report
php ./vendor/bin/phpmetrics --report-html=myreport <folder-to-analyze>

Then open the generated ./myreport/index.html file in your browser.

You can use a configuration file to customize the report, add options, configure rules for Continuous Integration, etc.

Metrics

You'll find detailed list of metrics in documentation, or running php ./vendor/bin/phpmetrics --metrics

Author

License

See the LICENSE file.

Contributing

See the CONTRIBUTING file.

Support the project

PHPMetrics is built and maintained on free time. If it saved you some of yours:

  • ⭐ Star the repository. It costs nothing and it is how most developers discover the tool.
  • ❤️ Become a sponsor. Sponsorship directly funds maintenance time and the addition of new features and metrics.
ci
metrics
php
quality
static-analyzer

Project health

Overall

4.4/10

Maintained

10/10

Code review

2/10
OpenSSF Scorecard

Significant stargazers

Ben Younes

436 followers · starred Sep 2026

Juliette

1,368 followers · starred Sep 2014

Peter Kokot

1,199 followers · starred Apr 2015

Anders Jenbo

399 followers · starred Oct 2017