OldeCodeFinder finds old code. This means files which are largely older than a specific date.
It can also find files which were mostly written by a particular person. So if Fred left the company 3 years ago, files which consist mostly of lines which were written by him may be worth revisiting.
Add this line to your application's Gemfile
in the 'development' group:
gem 'olde_code_finder'
See if more than 80% of app/models/foo.rb
was written by Benjamin Franklin:
bundle exec rake olde_code_finder:find_by_author['app/models/foo.rb','Benjamin Franklin','80']
Or you can use a glob:
bundle exec rake olde_code_finder:find_by_author['app/models/*.rb','Benjamin Franklin','80']
Or you can specify a lower percentage threshold:
bundle exec rake olde_code_finder:find_by_author['app/models/*.rb','Benjamin Franklin','60']
The author name is a regex, so this will find 'Benjamin Franklin' as well as 'Ben Franklin':
bundle exec rake olde_code_finder:find_by_author['app/models/*.rb','Frank','80']
Or you can run a different task and find code older than a certain date instead:
bundle exec rake olde_code_finder:find_by_date['app/models/*.rb','4 years','80']
The output will be a list of files that meet the criteria:
foo> $ bundle exec rake olde_code_finder:find_by_author['app/models/*.rb','Benjamin Franklin','80']
More than 80% of app/models/foobar.rb was written by Benjamin Franklin (85%)
It uses git blame
to see who last touched each line of a file and when.
- Fork it ( http://github.com//olde_code_finder/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Tom Copeland: Author
- Joe Rafaniello: Added percentage display