Skip to content

Conversation

etagwerker
Copy link
Member

@etagwerker etagwerker commented Dec 19, 2024

  • Add an entry to CHANGELOG.md that links to this PR under the "main (unreleased)" heading.

Description:

This PR adds Files # to the table and JSON output

This is what it looks like in the console:

➜  dummy git:(feature/count-files) ✗ bundle exec rake stats
+-----------------------|------------|----------------+
|                  Name | Total Deps | 1st Level Deps |
+-----------------------|------------|----------------+
|                 rails | 47         | 14             |
|            sass-rails | 29         | 1              |
|           web-console | 25         | 4              |
|             webpacker | 24         | 3              |
|              jbuilder | 16         | 2              |
| spring-watcher-listen | 5          | 2              |
|           rails_stats | 4          | 2              |
|                listen | 3          | 2              |
|              bootsnap | 1          | 1              |
|                  puma | 1          | 1              |
|                byebug | 0          | 0              |
|                spring | 0          | 0              |
|           tzinfo-data | 0          | 0              |
+-----------------------|------------|----------------+

      Declared Gems   13
         Total Gems   68
  Unpinned Versions   7
        Github Refs   0

+----------------------+---------+---------+---------+---------+---------+-----+-------+
| Name                 | Files   | Lines   |     LOC | Classes | Methods | M/C | LOC/M |
+----------------------+---------+---------+---------+---------+---------+-----+-------+
| Channels             |       2 |       8 |       8 |       2 |       0 |   0 |     0 |
| Configuration        |      19 |     417 |     111 |       1 |       0 |   0 |     0 |
| Controllers          |       1 |       7 |       6 |       1 |       1 |   1 |     4 |
| Helpers              |       1 |       3 |       3 |       0 |       0 |   0 |     0 |
| Javascripts          |       3 |      27 |       7 |       0 |       0 |   0 |     0 |
| Jobs                 |       1 |       7 |       2 |       1 |       0 |   0 |     0 |
| Libraries            |       1 |       1 |       1 |       0 |       0 |   0 |     0 |
| Mailers              |       1 |       4 |       4 |       1 |       0 |   0 |     0 |
| Model Tests          |       2 |       5 |       4 |       2 |       0 |   0 |     0 |
| Models               |       1 |       3 |       3 |       1 |       0 |   0 |     0 |
| Spec Support         |       1 |       1 |       1 |       0 |       0 |   0 |     0 |
| Test Support         |       1 |       1 |       1 |       0 |       0 |   0 |     0 |
+----------------------+---------+---------+---------+---------+---------+-----+-------+
| Code                 |      30 |     477 |     145 |       7 |       1 |   0 |   143 |
| Tests                |       4 |       7 |       6 |       2 |       0 |   0 |     0 |
| Total                |      34 |     484 |     151 |       9 |       1 |   0 |   149 |
+----------------------+---------+---------+---------+---------+---------+-----+-------+
  Code LOC: 145     Test LOC: 6     Code to Test Ratio: 1:0.0  Files: 34

This is what it looks like with the JSON formatter:

[{"name":"Mailers","files":"1","lines":"4","loc":"4","classes":"1","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Models","files":"1","lines":"3","loc":"3","classes":"1","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Javascripts","files":"3","lines":"27","loc":"7","classes":"0","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Jobs","files":"1","lines":"7","loc":"2","classes":"1","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Controllers","files":"1","lines":"7","loc":"6","classes":"1","methods":"1","m_over_c":"1","loc_over_m":"4"},{"name":"Helpers","files":"1","lines":"3","loc":"3","classes":"0","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Channels","files":"2","lines":"8","loc":"8","classes":"2","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Libraries","files":"1","lines":"1","loc":"1","classes":"0","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Configuration","files":"19","lines":"417","loc":"111","classes":"1","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Model Tests","files":"2","lines":"5","loc":"4","classes":"2","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Spec Support","files":"1","lines":"1","loc":"1","classes":"0","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Test Support","files":"1","lines":"1","loc":"1","classes":"0","methods":"0","m_over_c":"0","loc_over_m":"0"},{"name":"Total","files":"34","lines":"484","loc":"151","classes":"9","methods":"1","m_over_c":"0","loc_over_m":"149","code_to_test_ratio":"0.0","total":true}]

✅ I will abide by the code of conduct.

@etagwerker etagwerker merged commit e236c90 into main Dec 19, 2024
0 of 4 checks passed
@etagwerker etagwerker deleted the feature/count-files branch December 19, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant