/PhpMetrics

Static analysis tool for PHP

Primary LanguagePHPMIT LicenseMIT

PhpMetrics

Gives metrics about PHP project and classes.

Standard report

License Build Status Latest Stable Version Dependency Status

Installation

As a phar archive:

You can install the .phar package by command line running the following commands:

wget https://github.com/phpmetrics/PhpMetrics/raw/master/build/phpmetrics.phar
chmod +x phpmetrics.phar
mv phpmetrics.phar /usr/local/bin/phpmetrics

As a composer dependency:

composer global require 'phpmetrics/phpmetrics'

Please note that the ~/.composer/vendor/bin directory must be in your $PATH. For example in your ~/.bash_profile (or ~/.bashrc), add :

export PATH=~/.composer/vendor/bin:$PATH

Usage

Do not hesitate to visit the official documentation.

The command command phpmetrics --report-html=./log <folder or filename> will generate HTML report in the ./log directory.

## Compatibility

PhpMetrics can parse PHP code from PHP 5.3 to PHP 7.x.

IDE integration

Contribute

In order to run unit tests, please install the dev dependencies:

curl -sS https://getcomposer.org/installer | php
php composer.phar install

Then, in order to run the test suite:

./vendor/bin/phpunit

Finally, build the phar:

make build

Author

License

See the LICENSE file.