🕷 software projects

by ryan davis



sitemap

debride

Analyze code for potentially uncalled / dead methods.

Analyze code for potentially uncalled / dead methods.

  • Static analysis of code. Can be easily hooked up to a CI.
  • As with all static analysis tools of dynamic languages, can’t be 100%.
  • Whitelisting known good methods by name or regexp.
  • Use –rails for Rails-specific domain knowledge.
  • Use debride_rails_whitelist to generate an emperical whitelist from logs.
  % debride lib

  These methods MIGHT not be called:

  MyClass
    good_method                         lib/some/file.rb:16
    bad_method                          lib/some/file.rb:20
  ...

But you know that good_method is called (perhaps because it is public API), then you can whitelist it:

  % echo good_method > whitelist.txt
  % debride --whitelist whitelist.txt lib

  These methods MIGHT not be called:

  MyClass
    bad_method                          lib/some/file.rb:20
  ...

You can also use regexps in your whitelist by delimiting them with //’s.

Get The Code

If you just want to use debride, you can install it via RubyGems:
gem install debride
Fork me on GitHub If you want to hack on debride, clone it from GitHub:
git clone git://github.com/seattlerb/debride

Latest Activity