Skip to content

Instantly share code, notes, and snippets.

@etagwerker
Created October 14, 2020 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etagwerker/322764ee557fa245f71554c4358d2d41 to your computer and use it in GitHub Desktop.
Save etagwerker/322764ee557fa245f71554c4358d2d41 to your computer and use it in GitHub Desktop.
rails_stats and bundle-stats for discourse

rails_stats

bundle exec rails stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Mailers              |   998 |   810 |       9 |      51 |   5 |    13 |
| Models               | 42186 | 30911 |     241 |    2093 |   8 |    12 |
| Serializers          |  7871 |  5985 |     179 |    1127 |   6 |     3 |
| Jobs                 |  6793 |  5127 |     166 |     356 |   2 |    12 |
| Controllers          | 28757 | 23504 |      99 |     927 |   9 |    23 |
| Helpers              |  1865 |  1497 |       0 |     146 |   0 |     8 |
| Services             |  6302 |  4990 |      46 |     403 |   8 |    10 |
| Javascripts          | 161602 | 120008 |       0 |    1769 |   0 |    65 |
| Pre Initializers     |   486 |   347 |       0 |       7 |   0 |    47 |
| Mixins               |  1598 |  1273 |       0 |      12 |   0 |   104 |
| Raw Views            |   196 |   163 |       0 |       1 |   0 |   161 |
| Adapters             |   313 |   265 |       0 |      10 |   0 |    24 |
| Components           | 16319 | 13360 |       0 |      85 |   0 |   155 |
| Libs                 | 11542 |  8414 |       0 |     410 |   0 |    18 |
| Routes               |  4473 |  3739 |       0 |      47 |   0 |    77 |
| Widgets              |  9552 |  7692 |       0 |      59 |   0 |   128 |
| Initializers         |  1650 |  1369 |       0 |      32 |   0 |    40 |
| Libraries            | 48047 | 36742 |     438 |    3623 |   8 |     8 |
| Configuration        |  3632 |  2559 |       6 |      22 |   3 |   114 |
| Integration Tests    |  2022 |  1575 |       1 |       7 |   7 |   223 |
| Request Tests        | 36435 | 28991 |       0 |      43 |   0 |   672 |
| Other Tests          |  5038 |  3878 |       1 |      26 |  26 |   147 |
| Lib Tests            |  6708 |  5325 |       0 |      61 |   0 |    85 |
| Job Tests            |  7316 |  5560 |       3 |      24 |   8 |   229 |
| Component Tests      | 42365 | 32865 |      33 |     137 |   4 |   237 |
| Model Tests          | 32962 | 25406 |       6 |     108 |  18 |   233 |
| Controller Tests     |   824 |   615 |       0 |       0 |   0 |     0 |
| Mailer Tests         |  1350 |  1058 |       0 |       1 |   0 |  1056 |
| Spec Support         |  2983 |  2247 |      23 |     129 |   5 |    15 |
| Serializer Tests     |  2841 |  2229 |       0 |       8 |   0 |   276 |
| Helper Tests         |   721 |   560 |       0 |       1 |   0 |   558 |
| Service Tests        |  9269 |  7161 |       0 |      28 |   0 |   253 |
| Initializer Tests    |    25 |    16 |       0 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                | 505041 | 386241 |    1251 |   11753 |   9 |    30 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 268755     Test LOC: 117486     Code to Test Ratio: 1:0.4

Bundler Stats

bundle-stats stats
+---------------------------|------------|----------------+
|                      Name | Total Deps | 1st Level Deps |
+---------------------------|------------|----------------+
|     discourse-ember-rails | 32         | 6              |
|               sassc-rails | 28         | 5              |
|               rspec-rails | 28         | 7              |
|               rswag-specs | 26         | 3              |
|            rails_failover | 25         | 2              |
|           rails_multisite | 25         | 2              |
|                   lograge | 24         | 4              |
|              actionmailer | 23         | 5              |
|                  railties | 22         | 5              |
|           sprockets-rails | 20         | 3              |
|                actionpack | 18         | 6              |
|    actionview_precompiler | 16         | 1              |
|                actionview | 15         | 5              |
|         rubocop-discourse | 11         | 2              |
|         omniauth-facebook | 10         | 1              |
|                    onebox | 10         | 6              |
|           omniauth-github | 10         | 2              |
|    omniauth-google-oauth2 | 10         | 3              |
|                  annotate | 10         | 2              |
|        omniauth-instagram | 10         | 2              |
|           omniauth-oauth2 | 9          | 2              |
|                   seed-fu | 9          | 2              |
|  active_model_serializers | 8          | 1              |
|              activerecord | 8          | 2              |
|       rspec-html-matchers | 8          | 2              |
|                    bullet | 8          | 2              |
|          shoulda-matchers | 7          | 1              |
|               activemodel | 7          | 1              |
| ember-handlebars-template | 6          | 2              |
|                aws-sdk-s3 | 6          | 3              |
|             activesupport | 6          | 5              |
|     discourse_image_optim | 5          | 5              |
|          omniauth-twitter | 5          | 2              |
|                     rspec | 5          | 3              |
|               aws-sdk-sns | 5          | 2              |
|                pry-byebug | 4          | 2              |
|                   webmock | 4          | 3              |
|            mini_scheduler | 4          | 1              |
|          ruby-readability | 3          | 2              |
|                   rbtrace | 3          | 3              |
|             better_errors | 3          | 3              |
|                   sidekiq | 3          | 3              |
|                 pry-rails | 3          | 1              |
|                    listen | 3          | 2              |
|                   webpush | 2          | 2              |
|                   unicorn | 2          | 2              |
|                 sprockets | 2          | 2              |
|                  omniauth | 2          | 2              |
|                   rqrcode | 2          | 2              |
|                      cose | 2          | 2              |
|                css_parser | 2          | 1              |
|                    barber | 2          | 2              |
|                 simplecov | 2          | 2              |
|                     sassc | 2          | 2              |
|                      mail | 1          | 1              |
|                       unf | 1          | 1              |
|               addressable | 1          | 1              |
|                  bootsnap | 1          | 1              |
|           rack-protection | 1          | 1              |
|            parallel_tests | 1          | 1              |
|               message_bus | 1          | 1              |
|                  nokogiri | 1          | 1              |
|                mini_racer | 1          | 1              |
|           logstash-logger | 1          | 1              |
|                  uglifier | 1          | 1              |
|           redis-namespace | 1          | 1              |
|                      puma | 1          | 1              |
|               mini_suffix | 1          | 1              |
|         binding_of_caller | 1          | 1              |
|               rails_stats | 1          | 1              |
|        rack-mini-profiler | 1          | 1              |
|                flamegraph | 0          | 0              |
|                  mustache | 0          | 0              |
|                multi_json | 0          | 0              |
|       email_reply_trimmer | 0          | 0              |
|                     excon | 0          | 0              |
|                 gc_tracer | 0          | 0              |
|                 stackprof | 0          | 0              |
|                 fastimage | 0          | 0              |
|                   xorcist | 0          | 0              |
|                   fast_xs | 0          | 0              |
|           memory_profiler | 0          | 0              |
|           discourse-fonts | 0          | 0              |
|               cppjieba_rb | 0          | 0              |
|    discourse-ember-source | 0          | 0              |
|            logstash-event | 0          | 0              |
|      http_accept_language | 0          | 0              |
|                   logster | 0          | 0              |
|                     redis | 0          | 0              |
|                 mini_mime | 0          | 0              |
|                      rotp | 0          | 0              |
|                      json | 0          | 0              |
|                   rubyzip | 0          | 0              |
|                    sshkey | 0          | 0              |
|                  rchardet | 0          | 0              |
|                  lz4-ruby | 0          | 0              |
|                    byebug | 0          | 0              |
|                rb-fsevent | 0          | 0              |
|               fabrication | 0          | 0              |
|                 certified | 0          | 0              |
|                mock_redis | 0          | 0              |
|                 test-prof | 0          | 0              |
|                  minitest | 0          | 0              |
|                   fakeweb | 0          | 0              |
|                 ruby-prof | 0          | 0              |
|                     rtlit | 0          | 0              |
|                      cbor | 0          | 0              |
|                      rack | 0          | 0              |
|                  highline | 0          | 0              |
|                    execjs | 0          | 0              |
|                  colored2 | 0          | 0              |
|                     rinku | 0          | 0              |
|                     diffy | 0          | 0              |
|                      thor | 0          | 0              |
|                      rake | 0          | 0              |
|                        r2 | 0          | 0              |
|                 yaml-lint | 0          | 0              |
|                 maxminddb | 0          | 0              |
|                  mini_sql | 0          | 0              |
|                        pg | 0          | 0              |
|                        oj | 0          | 0              |
|                fast_blank | 0          | 0              |
|                 lru_redux | 0          | 0              |
|              htmlentities | 0          | 0              |
|                     mocha | 0          | 0              |
+---------------------------|------------|----------------+

      Declared Gems   125
         Total Gems   208
  Unpinned Versions   112
        Github Refs   0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment