Skip to content

Commit f6f63c8

Browse files
authored
Mimic Rubycritic Folder Structure (#112)
* Mimic Rubycritic folder structure - [x] Move command_factory file - [x] Move commands folder * Update rubocop_todo file * Update .reek file
1 parent 84e04ce commit f6f63c8

29 files changed

+323
-338
lines changed

Diff for: .reek.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ detectors:
2424
- Skunk::Cli::Options::Argv#parse
2525
UtilityFunction:
2626
exclude:
27-
- Skunk::Cli::Command::Compare#analyse_modified_files
28-
- Skunk::Cli::Command::Compare#build_details_path
29-
- Skunk::Cli::Command::Shareable#sharing?
27+
- capture_output_streams
28+
- Skunk::Command::Compare#analyse_modified_files
29+
- Skunk::Command::Compare#build_details_path
30+
- Skunk::Command::Shareable#sharing?

Diff for: .rubocop_todo.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2021-08-31 01:33:08 UTC using RuboCop version 1.9.1.
3+
# on 2023-07-22 00:31:00 UTC using RuboCop version 1.54.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 2
10-
# Configuration parameters: Include.
9+
# Offense count: 1
10+
# Configuration parameters: Severity, Include.
1111
# Include: **/*.gemspec
1212
Gemspec/RequiredRubyVersion:
1313
Exclude:
14-
- 'gemfiles/skunk.gemspec'
1514
- 'skunk.gemspec'
1615

1716
# Offense count: 1
18-
# Cop supports --auto-correct.
17+
# This cop supports safe autocorrection (--autocorrect).
1918
Layout/ClosingHeredocIndentation:
2019
Exclude:
21-
- 'lib/skunk/cli/commands/status_reporter.rb'
20+
- 'lib/skunk/commands/status_reporter.rb'
2221

2322
# Offense count: 1
24-
# Cop supports --auto-correct.
23+
# This cop supports safe autocorrection (--autocorrect).
2524
Layout/HeredocIndentation:
2625
Exclude:
27-
- 'lib/skunk/cli/commands/status_reporter.rb'
26+
- 'lib/skunk/commands/status_reporter.rb'
2827

2928
# Offense count: 2
29+
# Configuration parameters: AllowedParentClasses.
3030
Lint/MissingSuper:
3131
Exclude:
3232
- 'lib/skunk/cli/application.rb'
33-
- 'lib/skunk/cli/commands/base.rb'
33+
- 'lib/skunk/commands/base.rb'
3434

3535
# Offense count: 1
36-
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
36+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
3737
Metrics/AbcSize:
3838
Max: 18
3939

4040
# Offense count: 7
41-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
42-
# IgnoredMethods: refine
41+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
42+
# AllowedMethods: refine
4343
Metrics/BlockLength:
4444
Max: 76
4545

4646
# Offense count: 2
47-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
47+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
4848
Metrics/MethodLength:
4949
Max: 13
5050

5151
# Offense count: 1
52-
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
52+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
5353
# SupportedStyles: snake_case, normalcase, non_integer
54-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
54+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
5555
Naming/VariableNumber:
5656
Exclude:
57-
- 'lib/skunk/cli/commands/status_sharer.rb'
57+
- 'lib/skunk/commands/status_sharer.rb'

Diff for: README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ The result is a list of smelly files and the SkunkScore of the project/files:
8383
| file | skunk_score | churn_times_cost | churn | cost | coverage |
8484
+-----------------------------------------------------+----------------+------------------+--------------+--------------+--------------+
8585
| samples/rubycritic/analysed_module.rb | 258.88 | 12.94 | 5 | 2.59 | 0.0 |
86-
| lib/skunk/cli/commands/compare.rb | 85.41 | 32.32 | 14 | 2.31 | 63.64 |
86+
| lib/skunk/commands/compare.rb | 85.41 | 32.32 | 14 | 2.31 | 63.64 |
8787
| lib/skunk/rubycritic/analysed_modules_collection.rb | 31.76 | 3.18 | 5 | 0.64 | 50.0 |
88-
| lib/skunk/cli/commands/status_reporter.rb | 11.33 | 68.0 | 18 | 3.78 | 97.5 |
89-
| lib/skunk/cli/command_factory.rb | 8.3 | 1.95 | 4 | 0.49 | 83.33 |
90-
| lib/skunk/cli/commands/status_sharer.rb | 8.17 | 10.9 | 4 | 2.72 | 97.67 |
88+
| lib/skunk/commands/status_reporter.rb | 11.33 | 68.0 | 18 | 3.78 | 97.5 |
89+
| lib/skunk/command_factory.rb | 8.3 | 1.95 | 4 | 0.49 | 83.33 |
90+
| lib/skunk/commands/status_sharer.rb | 8.17 | 10.9 | 4 | 2.72 | 97.67 |
9191
| lib/skunk/cli/application.rb | 7.06 | 21.19 | 18 | 1.18 | 94.12 |
9292
| lib/skunk/cli/options/argv.rb | 4.08 | 7.35 | 9 | 0.82 | 95.24 |
93-
| lib/skunk/cli/commands/compare_score.rb | 3.77 | 2.51 | 4 | 0.63 | 94.74 |
93+
| lib/skunk/commands/compare_score.rb | 3.77 | 2.51 | 4 | 0.63 | 94.74 |
9494
| lib/skunk/rubycritic/analysed_module.rb | 3.37 | 33.74 | 10 | 3.37 | 100.0 |
95-
| lib/skunk/cli/commands/version.rb | 2.64 | 0.7 | 8 | 0.09 | 70.0 |
96-
| lib/skunk/cli/commands/output.rb | 1.86 | 0.09 | 1 | 0.09 | 80.0 |
95+
| lib/skunk/commands/version.rb | 2.64 | 0.7 | 8 | 0.09 | 70.0 |
96+
| lib/skunk/commands/output.rb | 1.86 | 0.09 | 1 | 0.09 | 80.0 |
9797
| lib/skunk/cli/options.rb | 0.68 | 5.44 | 8 | 0.68 | 100.0 |
98-
| lib/skunk/cli/commands/default.rb | 0.4 | 3.23 | 8 | 0.4 | 100.0 |
99-
| lib/skunk/cli/commands/shareable.rb | 0.2 | 0.4 | 2 | 0.2 | 100.0 |
100-
| lib/skunk/cli/commands/help.rb | 0.2 | 1.2 | 6 | 0.2 | 100.0 |
101-
| lib/skunk/cli/commands/base.rb | 0.1 | 0.49 | 5 | 0.1 | 100.0 |
98+
| lib/skunk/commands/default.rb | 0.4 | 3.23 | 8 | 0.4 | 100.0 |
99+
| lib/skunk/commands/shareable.rb | 0.2 | 0.4 | 2 | 0.2 | 100.0 |
100+
| lib/skunk/commands/help.rb | 0.2 | 1.2 | 6 | 0.2 | 100.0 |
101+
| lib/skunk/commands/base.rb | 0.1 | 0.49 | 5 | 0.1 | 100.0 |
102102
| lib/skunk.rb | 0.0 | 0.0 | 6 | 0.0 | 100.0 |
103103
| lib/skunk/version.rb | 0.0 | 0.0 | 12 | 0.0 | 0.0 |
104104
+-----------------------------------------------------+----------------+------------------+--------------+--------------+--------------+
@@ -158,7 +158,7 @@ If you want to share the results of your Skunk report with the Ruby community, r
158158
SkunkScore Total: 126.99
159159
Modules Analysed: 17
160160
SkunkScore Average: 7.47
161-
Worst SkunkScore: 41.92 (lib/skunk/cli/commands/status_sharer.rb)
161+
Worst SkunkScore: 41.92 (lib/skunk/commands/status_sharer.rb)
162162
163163
Generated with Skunk v0.5.0
164164
Shared at: https://skunk.fastruby.io/
@@ -174,7 +174,7 @@ If you prefer to post results to your server, set your own `SHARE_URL`:
174174
SkunkScore Total: 126.99
175175
Modules Analysed: 17
176176
SkunkScore Average: 7.47
177-
Worst SkunkScore: 41.92 (lib/skunk/cli/commands/status_sharer.rb)
177+
Worst SkunkScore: 41.92 (lib/skunk/commands/status_sharer.rb)
178178
179179
Generated with Skunk v0.5.0
180180
Shared at: https://path.to.your.skunk-fyi-server.example.com

Diff for: lib/skunk/cli/application.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
require "skunk"
77
require "skunk/rubycritic/analysed_module"
88
require "skunk/cli/options"
9-
require "skunk/cli/command_factory"
10-
require "skunk/cli/commands/status_sharer"
9+
require "skunk/command_factory"
10+
require "skunk/commands/status_sharer"
1111

1212
module Skunk
1313
module Cli
@@ -26,7 +26,7 @@ def execute
2626

2727
# :reek:NilCheck
2828
@parsed_options = @options.parse.to_h
29-
command = Skunk::Cli::CommandFactory.create(@parsed_options)
29+
command = Skunk::CommandFactory.create(@parsed_options)
3030
reporter = command.execute
3131

3232
print(reporter.status_message)

Diff for: lib/skunk/cli/command_factory.rb

-27
This file was deleted.

Diff for: lib/skunk/cli/commands/base.rb

-22
This file was deleted.

Diff for: lib/skunk/cli/commands/compare.rb

-66
This file was deleted.

Diff for: lib/skunk/cli/commands/compare_score.rb

-41
This file was deleted.

Diff for: lib/skunk/cli/commands/default.rb

-49
This file was deleted.

Diff for: lib/skunk/cli/commands/help.rb

-27
This file was deleted.

0 commit comments

Comments
 (0)