> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/programmy/rails/code-statistics-for-an-application.md).

# 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/programmy/rails/code-statistics-for-an-application.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
