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