• Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    Elixir
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Find unused functions in your project

Mix Unused

Module Version Hex Docs Total Download License Last Updated CodeCov

Mix compiler tracer for detecting unused public functions.

Installation

def deps do
  [
    {:mix_unused, "~> 0.3.0"}
  ]
end

The docs can be found at https://hexdocs.pm/mix_unused.

Usage

After installation you need to add :unused as a compiler to the list of Mix compilers:

defmodule MySystem.MixProject do
  use Mix.Project

  def project do
    [
      compilers: [:unused] ++ Mix.compilers(),
      # In case of Phoenix projects you need to add it to the list
      # compilers: [:unused, :phoenix, :gettext] ++ Mix.compilers()
      # ...
      #
      # If you want to only run it in the dev environment you could do
      # it by using `compilers: compilers(Mix.env()) ++ Mix.compilers()`
      # instead and then returning the right compilers per environment.
    ]
  end

  # ...
end

Then you just need to run mix compile or mix compile --force as usual and unused hints will be added to the end of the output.

Warning

This isn't perfect solution and this will not find dynamic calls in form of:

apply(mod, func, args)

So this mean that, for example, if you have custom child_spec/1 definition then mix unused can return such function as unused even when you are using that indirectly in your supervisor.

Configuration

You can define used functions by adding mfa in unused: [ignored: [⋯]] in your project configuration:

def project do
  [
    # ⋯
    unused: [
      ignore: [
        {MyApp.Foo, :child_spec, 1}
      ]
    ],
    # ⋯
  ]
end

Copyright and License

Copyright © 2021 by Łukasz Niemier

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

More Repositories

1

vanilla-ujs

UJS without jQuery dependency
JavaScript
194
star
2

erlang-systemd

systemd utilities for Erlang applications
Erlang
174
star
3

dolores

Local development reverse proxy
Rust
57
star
4

phoenix_bakery

Better compression for your Phoenix assets
Elixir
54
star
5

ecto_function

Simple macro for generating SQL's functions macro wrappers
Elixir
49
star
6

nix-elixir

Nix
47
star
7

sad.vim

Quick search and replace for Vim
Vim Script
46
star
8

dotfiles

List of my awesome dotfiles :)
Vim Script
45
star
9

agnoster

Agnoster for Fish 🐠
Shell
43
star
10

defconst

Helper macros for defining constant values in modules
Elixir
41
star
11

ernie

Efficient binary encoding for your data (based on Erlang's External Terms Format)
Rust
36
star
12

gen_icmp

ICMP protocol implementation for Erlang without NIFs
Erlang
34
star
13

xdg-rlz

Configure non-conforming applications to use XDG Base Directory specification
Shell
33
star
14

ssh_signature

Erlang
32
star
15

asyncdo.vim

Dumb simple async task runner for Vim
Vim Script
28
star
16

pg-utils

Collection of small utilities for maintaining PSQL databases
Shell
25
star
17

magritte

Ceci n'est une pipe
Elixir
24
star
18

lumberjack

Web based log viewer for Erlang and Elixir applications
Elixir
23
star
19

watermelon

BDD testing library for Elixir
Elixir
19
star
20

vim-backscratch

Small scratches for Vim, feels nice
Vim Script
19
star
21

commoner

Elixir
19
star
22

plug_telemetry_server_timing

Plug for providing Telemetry metrics within browser DevTools
Elixir
18
star
23

sass-960gs

It's a standalone 960.gs SCSS framework that provide fixed and float grid.
Ruby
16
star
24

plug_systemd_example

Example Elixir application that integrates with systemd features
Elixir
16
star
25

mix_machine

Machine output for Mix tasks
Elixir
16
star
26

ucl-rs

Rust bindings to libucl
Rust
15
star
27

logger_colorful

Simple Erlang's logger's formatters wrapper that adds colours to the messages
Erlang
14
star
28

redmine_contacts

This plugin a free clone of Highrise CRM which you can manage customers and contacts, track tasks and store files. Based on Kirill Bezrukov's Contacts plugin.
Ruby
13
star
29

ecto_olap

Data analytics helpers for Ecto and PostgreSQL
Elixir
12
star
30

consulate

Erlang port mapper module that uses Consul instead of EPMD
Erlang
12
star
31

plug_early_hints

Elixir
12
star
32

stream_state

Stateful generative testing for Elixir implemented on top of StreamData
Elixir
11
star
33

biontech

Makefile
9
star
34

enough

Overload protected servers calls
Erlang
7
star
35

fmt

Elixir
7
star
36

ex_unit_embedded

Define ExUnit tests alongside your private functions to test them.
Elixir
7
star
37

advent-of-code

6
star
38

logger_datadog

Elixir Logger backend for sending logs directly to DataDog
Elixir
5
star
39

low_voltage

HTML
5
star
40

plug_clacks

Remember the fallen
Elixir
5
star
41

soma

Rust
5
star
42

range_set

range_set
Elixir
4
star
43

usnip.vim

Minimal snippets manager for (Neo)Vim
Vim Script
4
star
44

credo_code_climate

Plugin for Credo to produce CodeClimate-compatible JSON output
Elixir
4
star
45

phoenix_brotli_compressor

Elixir
4
star
46

pivotaltracker.vim

Completion source for PivotalTracker stories in Vim 8 and NeoVim
Vim Script
4
star
47

asyncomplete-pivotaltracker.vim

Vim Script
3
star
48

vim-encpipe

Vim Script
3
star
49

mix_elvis

Run Elvis linter via Mix
Elixir
3
star
50

nomadex

Nomad's API client library in Elixir
Elixir
3
star
51

bare-erlang

Implementation of BARE encoding in Erlang (mirror)
Erlang
3
star
52

logpick

Erlang
2
star
53

labeouf

PoC do-like notation for Rust
Rust
2
star
54

minisign

Erlang
2
star
55

e9p

Erlang
2
star
56

advent-of-code-2017

My Advent of Code 2017 solutions
Awk
1
star
57

make-example

Makefile
1
star
58

argonaut

Elixir
1
star
59

niemier.pl

1
star
60

puppet-gitdeploy

Puppet
1
star
61

elixir-bench

Elixir
1
star
62

ironic

Elixir
1
star
63

git-riff

Super simple git hooks launcher
Shell
1
star
64

poc-fs-bug

Elixir
1
star
65

example_error

Elixir
1
star
66

hauleth

HTML
1
star
67

logger_telemetry

Erlang
1
star