Download the PHP package bmitch/churn-php without Composer
On this page you can find all versions of the php package bmitch/churn-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bmitch/churn-php
More information about bmitch/churn-php
Files in bmitch/churn-php
Package churn-php
Short Description Discover files in need of refactoring.
License MIT
Homepage https://github.com/bmitch/churn-php
Informations about the package churn-php
churn-php
Helps discover good candidates for refactoring.
Table of Contents
- What Is it?
- Compatibility
- How to Install?
- How to Use?
- How to Configure?
- Similar Packages
- Contact
- Contributing
- License
What is it?
churn-php
is a package that helps you identify php files in your project that could be good candidates for refactoring.
It examines each PHP file in the path it is provided and:
- Checks how many commits it has.
- Calculates the cyclomatic complexity.
- Creates a score based on these two values.
The results are displayed in a table:
A file that changes a lot and has a high complexity might be a better candidate for refactoring than a file that doesn't change a lot and has a low complexity.
churn-php
only assists the developer to identify files for refactoring.
It's best to use the results in addition to your own judgment to decide which files you may want to refactor.
Compatibility
- PHP 7.1+
- Composer 2.0+
How to Install?
Download the last release of churn.phar
or install it with Phive:
You can also install churn-php
via Composer:
How to Use?
How to Configure?
You may add an optional churn.yml
file which can be used to configure churn-php.
The location of this file can be customized using the --configuration
option:
A sample churn.yml
file looks like:
If a churn.yml
file is omitted or an individual setting is omitted the default values above will be used.
Output formats
You can configure churn
to output the result in different formats. The available formats are:
csv
json
markdown
text
(default)
To use a different format use --format
option. Example command for json
:
Hooks
The hooks configuration allows you to customize churn
.
A user-defined hook must implement at least one Hook interface:
Hook interface | Corresponding event interface |
---|---|
AfterAnalysisHook | AfterAnalysis |
AfterFileAnalysisHook | AfterFileAnalysis |
BeforeAnalysisHook | BeforeAnalysis |
Similar Packages
Contact
Questions, comments, feedback? @bmitch2112
Contributing
- Please run
composer test
on PHP 7.1 and ensure it passes. - If you don't have access to PHP 7.1 please make sure that CI build passes when you make pull request. If you are unable to get it to pass in the pull request please ping me and I can help.
- Please see CONTRIBUTING.md
License
The MIT License (MIT). Please see License File for more information.
All versions of churn-php with dependencies
ext-json Version *
ext-tokenizer Version *
composer-runtime-api Version ^2
symfony/console Version ^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0
symfony/filesystem Version ^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0
symfony/process Version ^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0
symfony/yaml Version ^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0
webmozart/assert Version ^1.2