1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Code Statistics For An Application as a rails til.

This commit is contained in:
jbranchaud
2015-08-09 15:55:23 -05:00
parent 25da52ed2c
commit 949b49e94f
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Code Statistics For An Application
Rails applications and engines provide `stats`, a rake task for reporting
high level code statistics. Running it on a small project of mine generated
the following report:
```
$ rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 179 | 143 | 4 | 20 | 5 | 5 |
| Helpers | 18 | 16 | 0 | 2 | 0 | 6 |
| Models | 30 | 22 | 3 | 2 | 0 | 9 |
| Mailers | 0 | 0 | 0 | 0 | 0 | 0 |
| Javascripts | 53 | 35 | 0 | 6 | 0 | 3 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Controller specs | 22 | 16 | 0 | 0 | 0 | 0 |
| Decorator specs | 30 | 22 | 0 | 0 | 0 | 0 |
| Feature specs | 739 | 382 | 0 | 74 | 0 | 3 |
| Model specs | 70 | 55 | 0 | 0 | 0 | 0 |
| Cucumber features | 412 | 293 | 0 | 0 | 0 | 0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | 1553 | 984 | 7 | 104 | 14 | 7 |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: 216 Test LOC: 768 Code to Test Ratio: 1:3.6
```