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:
@@ -91,6 +91,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
- [Attribute Getter without the Recursion](rails/attribute-getter-without-the-recursion.md)
|
||||
- [Attribute Was](rails/attribute-was.md)
|
||||
- [Capybara Page Status Code](rails/capybara-page-status-code.md)
|
||||
- [Code Statistics For An Application](rails/code-statistics-for-an-application.md)
|
||||
- [Conditional Class Selectors in Haml](rails/conditional-class-selectors-in-haml.md)
|
||||
- [Creating Records of Has_One Associations](rails/creating-records-of-has-one-associations.md)
|
||||
- [Ignore Poltergeist JavaScript Errors](rails/ignore-poltergeist-javascript-errors.md)
|
||||
|
||||
27
rails/code-statistics-for-an-application.md
Normal file
27
rails/code-statistics-for-an-application.md
Normal 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
|
||||
```
|
||||
Reference in New Issue
Block a user