Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.63 KB

README.md

File metadata and controls

61 lines (43 loc) · 1.63 KB

MethodDuplicator

Capture d’écran du 2022-10-28 09-39-45

Usage

This allows you to see the methods that are never called but are declared.

Installation

requirement :

  • Rails > 6.1
  • Ruby

Add this line to your application's Gemfile:

gem 'method_duplicator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install method_duplicator

Tasks

There is only one task at the moment that lists all the methods that are in the app/ folder and the number of times they are called.

$ rails method_duplicator:methods

Todo

  • writing automatic tests (install RSpec)
  • Filter the methods to have only the one with 0 declarations
  • Make sure that in the file where the method is declared it can be called without the dot but not in the others
  • Allow to pass parameters (path for example)
  • customize colors for a better visibility
  • optimization of the algo and the performance
  • Export to CSV in tmp/
  • Find another way (ctags, intellisense etc) to get the declarations without doing a complete parsing of the app

👨‍💻 Contributing

To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.

  • Fork / Clone and select the main branch.
  • Create a new branch in your fork.
  • Make your changes.
  • Commit your changes, and push them.
  • Submit a Pull Request here!

📋 License

The gem is available as open source under the terms of the MIT License.