Churn Build Status Hex pm

Help discover a good refactoring candidates using cyclomatic complexity and frequency of editing files

Table of Contents

What is it?

churn is a package that helps you identify .ex 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

You can use some of existing flags to precise Churn results

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

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

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

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

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

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

Example
-C foo/bar.exs

How to install

The package can be installed by adding churn to your list of dependencies in mix.exs:

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

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

Similar Packages