Flay is terribly useful, but has terribly usability …
If the repo was not such a mess I’d make PRs to fix it, but tests are not even runnable and PRs to make the Readme readabe got rejected … so I’m not going to bother … a small excerpt from Samson
More config options can be found on it’s homepage
Just wanted to share this useful rake task which found a bunch of duplication and already prevented me from adding new duplication twice 🙂
desc "Analyze for code duplication (large, identical syntax trees) with fuzzy matching." task :flay do require 'flay' # do not require in production files = Dir["{config,lib,app/**/*.{rb,erb}"] files -= [ # Things you want to ignore ] flay = Flay.run([*files, '--mass', '25']) # mass threshold is shown mass / occurrences abort "Code duplication found" if flay.report.any? end