All Projects → bmitch → Churn Php

bmitch / Churn Php

Licence: mit
Discover files in need of refactoring.

Projects that are alternatives of or similar to Churn Php

Ex check
One task to efficiently run all code analysis & testing tools in an Elixir project. Born out of 💜 to Elixir and pragmatism.
Stars: ✭ 198 (-81.16%)
Mutual labels:  clean-code, continuous-integration
Fluenttc
🌊 👬 🏢 Integrate with TeamCity fluently
Stars: ✭ 42 (-96%)
Mutual labels:  continuous-integration
Bors Ng
👁 A merge bot for GitHub Pull Requests
Stars: ✭ 878 (-16.46%)
Mutual labels:  continuous-integration
Cimonitor
Displays CI statuses on a dashboard and triggers fun modules representing the status!
Stars: ✭ 34 (-96.76%)
Mutual labels:  continuous-integration
Git Push Deploy
Simple Automated CI/CD Pipeline for GitHub and GitLab Projects
Stars: ✭ 21 (-98%)
Mutual labels:  continuous-integration
Cyclone
Powerful workflow engine and end-to-end pipeline solutions implemented with native Kubernetes resources. https://cyclone.dev
Stars: ✭ 978 (-6.95%)
Mutual labels:  continuous-integration
Structured Acceptance Test
An open format definition for static analysis tools
Stars: ✭ 10 (-99.05%)
Mutual labels:  continuous-integration
Bad Commit Message Blocker
Inhibits commits with bad messages from getting merged
Stars: ✭ 48 (-95.43%)
Mutual labels:  continuous-integration
Sfdc Ci Toolkit
CI Scripts for Salesforce projects
Stars: ✭ 40 (-96.19%)
Mutual labels:  continuous-integration
Viper Templates
Swift Xcode templates for creating VIPER architecture stacks
Stars: ✭ 33 (-96.86%)
Mutual labels:  clean-code
Clearest Leetcode Cpp Solutions
Clearest LeetCode C++ Solutions. 本项目追求思路清晰,代码简洁。This project is intended to clarify the general problem solving ideas
Stars: ✭ 33 (-96.86%)
Mutual labels:  clean-code
Localstack
💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline!
Stars: ✭ 37,724 (+3489.34%)
Mutual labels:  continuous-integration
Docker Jenkins Android
Jenkins docker image for Android development
Stars: ✭ 35 (-96.67%)
Mutual labels:  continuous-integration
Split tests
Utility to split test files into parallel CI containers
Stars: ✭ 21 (-98%)
Mutual labels:  continuous-integration
Minion Ci
minimalist, decentralized, flexible Continuous Integration Server for hackers.
Stars: ✭ 44 (-95.81%)
Mutual labels:  continuous-integration
Screwdriver
An open source build platform designed for continuous delivery.
Stars: ✭ 870 (-17.22%)
Mutual labels:  continuous-integration
Iceci
IceCI is a continuous integration system designed for Kubernetes from the ground up.
Stars: ✭ 29 (-97.24%)
Mutual labels:  continuous-integration
Flutter pokedex
Pokedex app built with Flutter (with lots of animations) using Clean Architecture
Stars: ✭ 972 (-7.52%)
Mutual labels:  clean-code
Piplin
📤 An open source self-hosted continuous integration and deployment system - QQ群: 656868
Stars: ✭ 1,044 (-0.67%)
Mutual labels:  continuous-integration
Metaci
Lightweight, Salesforce specific CI app run on Heroku to build Github repositories configured for CumulusCI
Stars: ✭ 45 (-95.72%)
Mutual labels:  continuous-integration

churn-php

Helps discover good candidates for refactoring.

Build Status codecov Scrutinizer Code Quality Code Climate Packagist Packagist Packagist Donate

Table of Contents

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+

If you want to install churn-php in Symfony project, your Symfony components version must be 3.4 or higher.

How to Install?

Install via Composer:

composer require bmitch/churn-php --dev

You can also install churn-php with Phive:

phive install churn

How to Use?

vendor/bin/churn run <one or more paths to source code> ...
vendor/bin/churn run src
vendor/bin/churn run src tests

You can also use churn-php via Docker:

docker run --rm -ti -v $PWD:/app dockerizedphp/churn run src

How to Configure?

You may add an optional churn.yml file which can be used to configure churn-php. The location of the churn.yml file can be customized using these commands:

# Default: "churn.yml" 
vendor/bin/churn run --configuration=config-dir/ <path>
vendor/bin/churn run --configuration=my-config.yml <path>

A sample churn.yml file looks like:

# The maximum number of files to display in the results table.
# Default: 10
filesToShow: 10

# The minimum score a file need to display in the results table.
# Disabled if null.
# Default: 0.1
minScoreToShow: 0

# The command returns an 1 exit code if the highest score is greater than the threshold.
# Disabled if null.
# Default: null
maxScoreThreshold: 0.9

# The number of parallel jobs to use when processing files.
# Default: 10
parallelJobs: 10

# How far back in the VCS history to count the number of commits to a file
# Can be a human readable date like 'One week ago' or a date like '2017-07-12'
# Default: '10 Years ago'
commitsSince: One year ago

# Files to ignore when processing. The full path to the file relative to the root of your project is required.
# Also supports regular expressions.
# Default: All PHP files in the path provided to churn-php are processed.
filesToIgnore:
 - src/Commands/ChurnCommand.php
 - src/Results/ResultsParser.php
 - src/Foo/Ba*

# File extensions to use when processing.
# Default: php
fileExtensions:
 - php
 - inc

# This list is used only if there is no argument when running churn.
# Default: <empty>
directoriesToScan:
 - src
 - tests/

# List of user-defined hooks.
# They can be referenced by their full qualified class name if churn has access to the autoloader.
# Otherwise the file path can be used as well.
# See below the section about hooks for more details.
# Default: <empty>
hooks:
 - Namespace\MyHook
 - path/to/my-hook.php

# The version control system used for your project.
# Accepted values: fossil, git, mercurial, subversion, none
# Default: git
vcs: git

# The path of the cache file. It doesn't need to exist before running churn.
# Disabled if null.
# Default: null
cachePath: .churn.cache

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
  • text (default)

To use a different format use --format option. Example command for json:

vendor/bin/churn run --format json

Hooks

The hooks configuration allows you to customize churn.

A user-defined hook must implement at least one of the following interfaces:

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].