Rails Apps Size Tests
https://stephanhagemann.com/posts/2022-02-17-rails-apps-size-tests https://fed.brid.gy/

Want to generate some quick stats for the size of your Rails app (and likely some of its problems)?

These are the queries I used to generate graphs for some big open-source Rails app for my 2014 RailsConf talk Refactoring towards Component-based Rails Architecture.

How many lines of Ruby do you have in your app?

find . -iname "*.rb" -type f -exec cat {} \; | wc -l

What are your biggest files?

find . -iname "*.rb" -type f -exec wc -l {} \; | sort -rn

Which classes have the most has_many relationships?

ack " has_many " -c | awk -F ":" '{print $2,$1}' | grep -v "0" | sort -rn

ruby (13) rails (11)

1
1

These are webmentions via the IndieWeb and webmention.io. Mention this post from your site:


Except where otherwise noted, content on stephanhagemann.com is licensed under CC BY 4.0 by Stephan Hagemann