Check your php project code with
and create metrics with
This script is a better alternative to configure ant on your jenkins. The python script is more flexible and can also be used on your local dev machine. You can define all settings in the
composer.json in your project, but you don't have to. The scripts also supports exclusion of multiple folders.
The scripts are tested with
Python 2.6 and
git clone firstname.lastname@example.org:mi-schi/php-code-checker.git
composer require mi-schi/php-code-checker
Use python to execute the script in the project folder:
checker.py all checker.py check checker.py metric
all argument executes the
metric argument. You can set the second argument as project path:
checker.py all /path/to/your/project checker.py all relative/path
If you want to execute tests with coverage, regardless your configuration, then use the
checker.py coverage argument.
You can update all internal dependencies with
The configuration is simple. Just look in the default_configuration.json for usage. Add an extra property to the
composer.json in your project and overwrite the default configuration if you want.
php-code-checker comes with its own dependencies for
phpcs and so on. If you want to use another
phpunit, you can define the
bin-dir property and add
phpunit in your composer requirements.
path/to/your/project/bin/phpunit then this binary will be used. Otherwise your tests were executed with the
phpunit version which comes with
There is a huge configuration to process all these reports on Jenkins. First you have to install the following plugins:
Then, create a new empty job called
default-job. Copy the default-jenkins-config.xml to
/var/lib/jenkins/jobs/default-job/config.xml on your Jenkins.
That's it! Append the configuration and copy
default-job from now on.