Identify cruft in a codebase with ease

Unused identifies unused code in Rails, Phoenix, and other types of applications, improving developer productivity

Dead code wastes time

Reading and interpreting code can be challenging, but reading and interpreting code that's never used is downright wasteful.

Rather than fill your working memory with dead code, identify it with Unused and remove it from your codebase outright.

Screenshot of unused output

How It Works

Unused in Action

Check out the pull requests below that showcase what Unused can find.

Behind the Scenes

Unused leverages work done by Universal Ctags by collecting the list of tokens and searching the codebase for each occurrence. With those results, it classifies occurrences into different buckets, determining if it's part of the test suite.

Once searching is complete, it analyzes usage patterns based on general guidelines and calculates a likelihood for whether it's able to be removed; in Rails for example, controllers (UsersController) and migrations (CreateUsers) occur once but probably shouldn't be removed.

Installing and Updating

You can install the formulae via Homebrew with brew tap:

brew tap unused-code/formulae

Next, run:

brew install unused

This will install unused and its corresponding dependencies.

To update, run:

brew update
brew upgrade unused