Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Output number of dependencies in Gemfile.lock #11

Closed
etagwerker opened this issue Oct 14, 2020 · 1 comment · Fixed by #21
Closed

Idea: Output number of dependencies in Gemfile.lock #11

etagwerker opened this issue Oct 14, 2020 · 1 comment · Fixed by #21

Comments

@etagwerker
Copy link
Member

Hi there,

I was wondering if you would be interested in a PR to output details about the dependencies that are associated with the Rails application you're analyzing.

It would be something like this:

$ rake stats

+----------------------|------------|----------------+
|                 Name | Total Deps | 1st Level Deps |
+----------------------|------------|----------------+
|  fastruby-styleguide | 58         | 6              |
|                rails | 42         | 14             |
|           sass-rails | 29         | 1              |
|          web-console | 25         | 4              |
|         dotenv-rails | 24         | 2              |
|    factory_bot_rails | 24         | 2              |
|        rubocop-rails | 18         | 3              |
| rails_best_practices | 13         | 7              |
|             standard | 11         | 2              |
|    rubocop-ombu_labs | 10         | 1              |
|             jbuilder | 7          | 1              |
|                 reek | 5          | 4              |
|               listen | 3          | 2              |
|           overcommit | 2          | 2              |
|            simplecov | 2          | 2              |
|            test-unit | 1          | 1              |
|          rails_stats | 1          | 1              |
|                 puma | 1          | 1              |
|             bootsnap | 1          | 1              |
|          tzinfo-data | 0          | 0              |
|                   pg | 0          | 0              |
|         high_voltage | 0          | 0              |
|               byebug | 0          | 0              |
+----------------------|------------|----------------+

      Declared Gems   23
         Total Gems   104
  Unpinned Versions   18
        Github Refs   2

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Models               |    34 |    28 |       2 |       3 |   1 |     7 |
| Jobs                 |     7 |     2 |       1 |       0 |   0 |     0 |
| Controllers          |    84 |    65 |       3 |       3 |   1 |    19 |
| Helpers              |    41 |    36 |       0 |       4 |   0 |     7 |
| Javascripts          |   532 |   512 |       0 |      82 |   0 |     4 |
| Configuration        |   397 |   106 |       1 |       0 |   0 |     0 |
| Integration Tests    |    21 |    18 |       1 |       1 |   1 |    16 |
| Test Support         |    10 |     6 |       1 |       0 |   0 |     0 |
| Controller Tests     |    88 |    71 |       1 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |  1214 |   844 |      10 |      93 |   9 |     7 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 749     Test LOC: 95     Code to Test Ratio: 1:0.1

I realize that you could do this with bundler-stats, but I thought it might come in handy to do everything in one place.

If you were to add this, you would have to add a new dependency to this gem: https://github.com/jmmastey/bundler-stats

What do you think?

Thanks!

Ernesto

@arielj
Copy link

arielj commented Oct 15, 2020

I think it adds value, I imagine users interested in the app stats may already be using bundler-stats and it's nice to have all data with only one command.

Maybe we can do the dependency optional if it's a concern? Like:

if Bundler::Stats
  # exec command, process and merge outputs
end

And some comment about it in the README.

But only if the required dependency is a concern to you, I think it's ok to have that as a required dependency to simplify the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants