Skip to content

Commit

Permalink
Mimic Rubycritic Folder Structure (#112)
Browse files Browse the repository at this point in the history
* Mimic Rubycritic folder structure

- [x] Move command_factory file
- [x] Move commands folder

* Update rubocop_todo file

* Update .reek file
  • Loading branch information
JuanVqz authored Jul 23, 2023
1 parent 84e04ce commit f6f63c8
Show file tree
Hide file tree
Showing 29 changed files with 323 additions and 338 deletions.
7 changes: 4 additions & 3 deletions .reek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ detectors:
- Skunk::Cli::Options::Argv#parse
UtilityFunction:
exclude:
- Skunk::Cli::Command::Compare#analyse_modified_files
- Skunk::Cli::Command::Compare#build_details_path
- Skunk::Cli::Command::Shareable#sharing?
- capture_output_streams
- Skunk::Command::Compare#analyse_modified_files
- Skunk::Command::Compare#build_details_path
- Skunk::Command::Shareable#sharing?
32 changes: 16 additions & 16 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-08-31 01:33:08 UTC using RuboCop version 1.9.1.
# on 2023-07-22 00:31:00 UTC using RuboCop version 1.54.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Configuration parameters: Include.
# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'gemfiles/skunk.gemspec'
- 'skunk.gemspec'

# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Layout/ClosingHeredocIndentation:
Exclude:
- 'lib/skunk/cli/commands/status_reporter.rb'
- 'lib/skunk/commands/status_reporter.rb'

# Offense count: 1
# Cop supports --auto-correct.
# This cop supports safe autocorrection (--autocorrect).
Layout/HeredocIndentation:
Exclude:
- 'lib/skunk/cli/commands/status_reporter.rb'
- 'lib/skunk/commands/status_reporter.rb'

# Offense count: 2
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Exclude:
- 'lib/skunk/cli/application.rb'
- 'lib/skunk/cli/commands/base.rb'
- 'lib/skunk/commands/base.rb'

# Offense count: 1
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 18

# Offense count: 7
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 76

# Offense count: 2
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 13

# Offense count: 1
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
Naming/VariableNumber:
Exclude:
- 'lib/skunk/cli/commands/status_sharer.rb'
- 'lib/skunk/commands/status_sharer.rb'
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ The result is a list of smelly files and the SkunkScore of the project/files:
| file | skunk_score | churn_times_cost | churn | cost | coverage |
+-----------------------------------------------------+----------------+------------------+--------------+--------------+--------------+
| samples/rubycritic/analysed_module.rb | 258.88 | 12.94 | 5 | 2.59 | 0.0 |
| lib/skunk/cli/commands/compare.rb | 85.41 | 32.32 | 14 | 2.31 | 63.64 |
| lib/skunk/commands/compare.rb | 85.41 | 32.32 | 14 | 2.31 | 63.64 |
| lib/skunk/rubycritic/analysed_modules_collection.rb | 31.76 | 3.18 | 5 | 0.64 | 50.0 |
| lib/skunk/cli/commands/status_reporter.rb | 11.33 | 68.0 | 18 | 3.78 | 97.5 |
| lib/skunk/cli/command_factory.rb | 8.3 | 1.95 | 4 | 0.49 | 83.33 |
| lib/skunk/cli/commands/status_sharer.rb | 8.17 | 10.9 | 4 | 2.72 | 97.67 |
| lib/skunk/commands/status_reporter.rb | 11.33 | 68.0 | 18 | 3.78 | 97.5 |
| lib/skunk/command_factory.rb | 8.3 | 1.95 | 4 | 0.49 | 83.33 |
| lib/skunk/commands/status_sharer.rb | 8.17 | 10.9 | 4 | 2.72 | 97.67 |
| lib/skunk/cli/application.rb | 7.06 | 21.19 | 18 | 1.18 | 94.12 |
| lib/skunk/cli/options/argv.rb | 4.08 | 7.35 | 9 | 0.82 | 95.24 |
| lib/skunk/cli/commands/compare_score.rb | 3.77 | 2.51 | 4 | 0.63 | 94.74 |
| lib/skunk/commands/compare_score.rb | 3.77 | 2.51 | 4 | 0.63 | 94.74 |
| lib/skunk/rubycritic/analysed_module.rb | 3.37 | 33.74 | 10 | 3.37 | 100.0 |
| lib/skunk/cli/commands/version.rb | 2.64 | 0.7 | 8 | 0.09 | 70.0 |
| lib/skunk/cli/commands/output.rb | 1.86 | 0.09 | 1 | 0.09 | 80.0 |
| lib/skunk/commands/version.rb | 2.64 | 0.7 | 8 | 0.09 | 70.0 |
| lib/skunk/commands/output.rb | 1.86 | 0.09 | 1 | 0.09 | 80.0 |
| lib/skunk/cli/options.rb | 0.68 | 5.44 | 8 | 0.68 | 100.0 |
| lib/skunk/cli/commands/default.rb | 0.4 | 3.23 | 8 | 0.4 | 100.0 |
| lib/skunk/cli/commands/shareable.rb | 0.2 | 0.4 | 2 | 0.2 | 100.0 |
| lib/skunk/cli/commands/help.rb | 0.2 | 1.2 | 6 | 0.2 | 100.0 |
| lib/skunk/cli/commands/base.rb | 0.1 | 0.49 | 5 | 0.1 | 100.0 |
| lib/skunk/commands/default.rb | 0.4 | 3.23 | 8 | 0.4 | 100.0 |
| lib/skunk/commands/shareable.rb | 0.2 | 0.4 | 2 | 0.2 | 100.0 |
| lib/skunk/commands/help.rb | 0.2 | 1.2 | 6 | 0.2 | 100.0 |
| lib/skunk/commands/base.rb | 0.1 | 0.49 | 5 | 0.1 | 100.0 |
| lib/skunk.rb | 0.0 | 0.0 | 6 | 0.0 | 100.0 |
| lib/skunk/version.rb | 0.0 | 0.0 | 12 | 0.0 | 0.0 |
+-----------------------------------------------------+----------------+------------------+--------------+--------------+--------------+
Expand Down Expand Up @@ -158,7 +158,7 @@ If you want to share the results of your Skunk report with the Ruby community, r
SkunkScore Total: 126.99
Modules Analysed: 17
SkunkScore Average: 7.47
Worst SkunkScore: 41.92 (lib/skunk/cli/commands/status_sharer.rb)
Worst SkunkScore: 41.92 (lib/skunk/commands/status_sharer.rb)
Generated with Skunk v0.5.0
Shared at: https://skunk.fastruby.io/
Expand All @@ -174,7 +174,7 @@ If you prefer to post results to your server, set your own `SHARE_URL`:
SkunkScore Total: 126.99
Modules Analysed: 17
SkunkScore Average: 7.47
Worst SkunkScore: 41.92 (lib/skunk/cli/commands/status_sharer.rb)
Worst SkunkScore: 41.92 (lib/skunk/commands/status_sharer.rb)
Generated with Skunk v0.5.0
Shared at: https://path.to.your.skunk-fyi-server.example.com
Expand Down
6 changes: 3 additions & 3 deletions lib/skunk/cli/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
require "skunk"
require "skunk/rubycritic/analysed_module"
require "skunk/cli/options"
require "skunk/cli/command_factory"
require "skunk/cli/commands/status_sharer"
require "skunk/command_factory"
require "skunk/commands/status_sharer"

module Skunk
module Cli
Expand All @@ -26,7 +26,7 @@ def execute

# :reek:NilCheck
@parsed_options = @options.parse.to_h
command = Skunk::Cli::CommandFactory.create(@parsed_options)
command = Skunk::CommandFactory.create(@parsed_options)
reporter = command.execute

print(reporter.status_message)
Expand Down
27 changes: 0 additions & 27 deletions lib/skunk/cli/command_factory.rb

This file was deleted.

22 changes: 0 additions & 22 deletions lib/skunk/cli/commands/base.rb

This file was deleted.

66 changes: 0 additions & 66 deletions lib/skunk/cli/commands/compare.rb

This file was deleted.

41 changes: 0 additions & 41 deletions lib/skunk/cli/commands/compare_score.rb

This file was deleted.

49 changes: 0 additions & 49 deletions lib/skunk/cli/commands/default.rb

This file was deleted.

27 changes: 0 additions & 27 deletions lib/skunk/cli/commands/help.rb

This file was deleted.

Loading

0 comments on commit f6f63c8

Please sign in to comment.