Subscribe to How-To Geek

Get stats on your Ruby on Rails code

Run this command from a command prompt inside your project directory:

rake stats

You should see output that looks similar to this, although the lines of code will probably be different, since this is just a test project. =)

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Helpers              |    18 |    17 |       0 |       1 |   0 |    15 |
| Controllers          |   190 |   162 |       5 |      23 |   4 |     5 |
| Components           |     0 |     0 |       0 |       0 |   0 |     0 |
|   Functional tests   |   169 |   125 |       8 |      23 |   2 |     3 |
| Models               |   156 |   129 |       6 |      18 |   3 |     5 |
|   Unit tests         |   110 |    85 |       5 |      12 |   2 |     5 |
| Libraries            |     0 |     0 |       0 |       0 |   0 |     0 |
|   Integration tests  |    44 |    35 |       1 |       2 |   2 |    15 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |   687 |   553 |      25 |      79 |   3 |     5 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 308     Test LOC: 245     Code to Test Ratio: 1:0.8
| More
This article was originally written on 09/11/06 Tagged with: Ruby on Rails

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
mDNSResponder.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.