All Projects → patrykwozinski → churn

patrykwozinski / churn

Licence: MIT license
Find refactoring candidates in your Elixir project easily with Churn 🧹

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to churn

seamer
refactoring tool that aims at making it easy to create characterization tests
Stars: ✭ 16 (-81.61%)
Mutual labels:  refactoring, refactoring-tools
liquigraph
Migrations for Neo4j
Stars: ✭ 122 (+40.23%)
Mutual labels:  refactoring, refactoring-tools
Piranha
A tool for refactoring code related to feature flag APIs
Stars: ✭ 1,840 (+2014.94%)
Mutual labels:  refactoring, refactoring-tools
Code Smells And Feels
Talk on code smells and feels and how to change that via refactoring
Stars: ✭ 178 (+104.6%)
Mutual labels:  refactoring
Clang Expand
🐉 A clang tool for happy refactoring without source-code gymnastics
Stars: ✭ 182 (+109.2%)
Mutual labels:  refactoring
Quiz App
A repository reflecting the progress made on the "How to Build iOS Apps with Swift, TDD & Clean Architecture" YouTube series, by Caio & Mike.
Stars: ✭ 230 (+164.37%)
Mutual labels:  refactoring
refren
A language agnostic, code-style aware, refactoring/renaming tool.
Stars: ✭ 19 (-78.16%)
Mutual labels:  refactoring
Autorefactor
Eclipse plugin to automatically refactor Java code bases
Stars: ✭ 168 (+93.1%)
Mutual labels:  refactoring
rubocop-auto-correct
Auto-correct ruby source code by using rubocop in Atom.
Stars: ✭ 29 (-66.67%)
Mutual labels:  refactoring
Learning Oop In Php
A collection of resources to learn object-oriented programming and related concepts for PHP developers.
Stars: ✭ 2,359 (+2611.49%)
Mutual labels:  refactoring
Abracadabra
Automated refactorings for VS Code (JS & TS) ✨ It's magic ✨
Stars: ✭ 204 (+134.48%)
Mutual labels:  refactoring
Tagalong.vim
Change an HTML(ish) opening tag and take the closing one along as well
Stars: ✭ 184 (+111.49%)
Mutual labels:  refactoring
Best Of Python Dev
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.
Stars: ✭ 243 (+179.31%)
Mutual labels:  refactoring
Refactoringminer
Stars: ✭ 177 (+103.45%)
Mutual labels:  refactoring
redux-usage-report
A Redux Devtools monitor to audit your app's usage of the store
Stars: ✭ 41 (-52.87%)
Mutual labels:  refactoring
Pre Commit Hooks
Some out-of-the-box hooks for pre-commit
Stars: ✭ 2,605 (+2894.25%)
Mutual labels:  refactoring
atom-refactoring
Atom package that provides refactoring capabilities for your PHP source code.
Stars: ✭ 16 (-81.61%)
Mutual labels:  refactoring
All Repos
Clone all your repositories and apply sweeping changes.
Stars: ✭ 197 (+126.44%)
Mutual labels:  refactoring
Js Refactor
JS Refactoring tool for Visual Studio Code
Stars: ✭ 195 (+124.14%)
Mutual labels:  refactoring
Refactor Nrepl
nREPL middleware to support refactorings in an editor agnostic way
Stars: ✭ 213 (+144.83%)
Mutual labels:  refactoring

Churn

Build Status Module Version Hex Docs Total Download License Last Updated

Discover refactoring candidates by identifying the most frequently-edited files with the highest cyclomatic complexity

Table of Contents

What is it?

churn is a package that helps you identify .ex and .exs files in your project that could be good candidates for refactoring. It examines each Elixir 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:

How to use

After installing, run mix churn.

You can use these options to customize how Churn runs:

--min-score-to-show (-s shortcut)

Example:
mix churn -s 2
--commit-since (-t shortcut)

Example:
mix churn -t "2 months ago"
--directories-to-scan (-d shortcut)

Example:
-d lib,test
--file-extensions [-e shortcut]

Example
mix churn -e "ex,exs"
--files-to-ignore [-i shortcut]

Example
mix churn -i "lib/churn/hello_world.ex"
--config [-c shortcut]

Example
mix churn -c foo/bar.exs

How to install

The package can be installed by adding churn to your list of dependencies in mix.exs as follows. You also need to copy .churn.exs into your project.

Update your mix.exs:

def deps do
  [
    {:churn, "~> 0.1", only: :dev}
  ]
end

Copy and configure the .churn.exs file:

%{
  #
  # Minimum score to show in the output table.
  #
  min_score_to_show: 0,

  #
  # Specify when to look for commits. (This string is passed to `git rev-list
  # --since [value]`, so any human-readable string it understands is
  # acceptable.)
  #
  commit_since: "1 year ago",

  #
  # Describes output type for the Churn results
  #
  output_type: :console,

  #
  # Where to find files to analyse and look for refactoring candidates.
  #
  directories_to_scan: ["lib", "apps/*/lib"],

  #
  # Which extensions should be used for seeking files to analyse.
  #
  file_extensions: ["ex", "exs"],

  #
  # Determines files should we ignore and protect from analysis.
  #
  files_to_ignore: []
}

Understanding Churn Scores

Churn will always identify top-scoring files. Also, all scores produced by Churn are relative to the project.

For example, in a newly-generated Mix project, with a simple HelloWorld module, that file will be scored 1.0 and be listed as the sole refactoring candidate. In any real project, the same module would have a very low score.

On the other hand, in a project where every module is complex and frequently-modified, some modules may receive low scores which would receive high scores if they were part of a different project.

When you see the results Churn produces, consider them the most likely refactoring candidates for this project. Whether they actually need refactoring is up to you.

Docs: https://hexdocs.pm/churn.

Similar Packages

Copyright and License

Copyright (c) 2021 Patryk Woziński

This work is free. You can redistribute it and/or modify it under the terms of the MIT License. See the LICENSE.md file for more details.

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].