Evaluating Rails Projects
samuelmullen.com
samuelmullen.com
Ahem, anyone else run that and get scores like these?
$ flog app/controllers/ 7658.1: flog total 17.4: flog/method average
174.4: BidsController#show app/controllers/bids_controller.rb:17
126.0: CompanyDocumentsController#update_verifications app/controllers/company_documents_controller.rb:85rake stats # Report code statistics (KLOCs, etc) from the application
Probably going to follow up on the article with a PDF download to summarize all the todos and allow notes to be taken.
::STATS_DIRECTORIES << ["Admin", "app/admin"]
::STATS_DIRECTORIES << ["Cells", "app/cells"]
...I believe Rails hit v1.0 in December of 2005, but by that point it was already a thriving ecosystem.
It will recursively check a directory for gemfiles and then compare your installed version against the latest version.
It uses bundle outdated under the hood.
I also like to pry open the ApplicationController pretty quickly. You'll usually find all sorts of interesting logic and tight coupling in there.
In the example app you used, the models actually look pretty light on lines of code. I'm willing to bet the Views were full of conditionals, which is another thing I keep an eye out for.
A search tool like ack or grep are also incredibly useful to follow a trail of any interesting scent you might pick up.
I'm a Rails newbie so please excuse my ignorance... What is the connection between models being light on code and views being full of conditionals? What I assume you mean is that your models should also have view logic so that your templates aren't full of if-then statements. But isn't that what decorators are for?
Of course, there could also be model logic in the controllers and helpers as well.
I try to practice good OOP and stay with Sandi Metz' rules: http://robots.thoughtbot.com/sandi-metz-rules-for-developers