rubycritic 2.9.2 → 2.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop_todo.yml +6 -0
  4. data/.todo.reek +111 -108
  5. data/CHANGELOG.md +5 -0
  6. data/README.md +1 -1
  7. data/Rakefile +1 -1
  8. data/bin/rubycritic +1 -1
  9. data/features/command_line_interface/minimum_score.feature +1 -1
  10. data/features/command_line_interface/options.feature +2 -2
  11. data/features/rake_task.feature +5 -5
  12. data/features/step_definitions/rubycritic_steps.rb +4 -4
  13. data/features/support/env.rb +2 -2
  14. data/lib/rubycritic/analysers/attributes.rb +1 -1
  15. data/lib/rubycritic/analysers/churn.rb +1 -1
  16. data/lib/rubycritic/analysers/complexity.rb +1 -1
  17. data/lib/rubycritic/analysers/helpers/ast_node.rb +1 -1
  18. data/lib/rubycritic/analysers/helpers/flay.rb +1 -1
  19. data/lib/rubycritic/analysers/helpers/flog.rb +1 -1
  20. data/lib/rubycritic/analysers/helpers/methods_counter.rb +1 -1
  21. data/lib/rubycritic/analysers/helpers/modules_locator.rb +1 -1
  22. data/lib/rubycritic/analysers/helpers/parser.rb +1 -1
  23. data/lib/rubycritic/analysers/helpers/reek.rb +1 -1
  24. data/lib/rubycritic/analysers/smells/flay.rb +1 -1
  25. data/lib/rubycritic/analysers/smells/flog.rb +1 -1
  26. data/lib/rubycritic/analysers/smells/reek.rb +1 -1
  27. data/lib/rubycritic/analysers_runner.rb +1 -1
  28. data/lib/rubycritic/browser.rb +1 -1
  29. data/lib/rubycritic/cli/application.rb +2 -2
  30. data/lib/rubycritic/cli/options.rb +1 -1
  31. data/lib/rubycritic/colorize.rb +1 -1
  32. data/lib/rubycritic/command_factory.rb +1 -1
  33. data/lib/rubycritic/commands/base.rb +2 -2
  34. data/lib/rubycritic/commands/ci.rb +1 -1
  35. data/lib/rubycritic/commands/default.rb +1 -1
  36. data/lib/rubycritic/commands/help.rb +1 -1
  37. data/lib/rubycritic/commands/status_reporter.rb +1 -1
  38. data/lib/rubycritic/commands/version.rb +1 -1
  39. data/lib/rubycritic/configuration.rb +5 -1
  40. data/lib/rubycritic/core/analysed_module.rb +2 -2
  41. data/lib/rubycritic/core/analysed_modules_collection.rb +1 -1
  42. data/lib/rubycritic/core/location.rb +1 -1
  43. data/lib/rubycritic/core/rating.rb +1 -1
  44. data/lib/rubycritic/core/smell.rb +1 -1
  45. data/lib/rubycritic/generators/console_report.rb +1 -1
  46. data/lib/rubycritic/generators/html/assets/javascripts/jquery-2.1.0.js +1 -1
  47. data/lib/rubycritic/generators/html/base.rb +1 -1
  48. data/lib/rubycritic/generators/html/code_file.rb +1 -1
  49. data/lib/rubycritic/generators/html/code_index.rb +1 -1
  50. data/lib/rubycritic/generators/html/line.rb +1 -1
  51. data/lib/rubycritic/generators/html/overview.rb +1 -1
  52. data/lib/rubycritic/generators/html/smells_index.rb +1 -1
  53. data/lib/rubycritic/generators/html/turbulence.rb +1 -1
  54. data/lib/rubycritic/generators/html/view_helpers.rb +1 -1
  55. data/lib/rubycritic/generators/html_report.rb +2 -2
  56. data/lib/rubycritic/generators/json/simple.rb +13 -2
  57. data/lib/rubycritic/generators/json_report.rb +5 -2
  58. data/lib/rubycritic/generators/text/list.rb +1 -1
  59. data/lib/rubycritic/rake_task.rb +2 -2
  60. data/lib/rubycritic/reporter.rb +1 -1
  61. data/lib/rubycritic/revision_comparator.rb +1 -1
  62. data/lib/rubycritic/serializer.rb +1 -1
  63. data/lib/rubycritic/smells_status_setter.rb +1 -1
  64. data/lib/rubycritic/source_control_systems/base.rb +1 -1
  65. data/lib/rubycritic/source_control_systems/double.rb +1 -1
  66. data/lib/rubycritic/source_control_systems/git.rb +1 -1
  67. data/lib/rubycritic/source_control_systems/mercurial.rb +1 -1
  68. data/lib/rubycritic/source_locator.rb +1 -1
  69. data/lib/rubycritic/version.rb +2 -2
  70. data/lib/rubycritic.rb +1 -1
  71. data/rubycritic.gemspec +2 -1
  72. data/test/lib/rubycritic/analysers/churn_test.rb +3 -3
  73. data/test/lib/rubycritic/analysers/complexity_test.rb +2 -2
  74. data/test/lib/rubycritic/analysers/helpers/methods_counter_test.rb +4 -4
  75. data/test/lib/rubycritic/analysers/helpers/modules_locator_test.rb +9 -9
  76. data/test/lib/rubycritic/analysers/smells/flay_test.rb +4 -4
  77. data/test/lib/rubycritic/analysers/smells/flog_test.rb +2 -2
  78. data/test/lib/rubycritic/analysers/smells/reek_test.rb +2 -2
  79. data/test/lib/rubycritic/browser_test.rb +2 -2
  80. data/test/lib/rubycritic/commands/status_reporter_test.rb +7 -7
  81. data/test/lib/rubycritic/configuration_test.rb +9 -9
  82. data/test/lib/rubycritic/core/analysed_module_test.rb +9 -9
  83. data/test/lib/rubycritic/core/analysed_modules_collection_test.rb +3 -3
  84. data/test/lib/rubycritic/core/location_test.rb +7 -7
  85. data/test/lib/rubycritic/core/smell_test.rb +15 -15
  86. data/test/lib/rubycritic/core/smells_array_test.rb +12 -12
  87. data/test/lib/rubycritic/generators/console_report_test.rb +5 -5
  88. data/test/lib/rubycritic/generators/json_report_test.rb +36 -0
  89. data/test/lib/rubycritic/generators/turbulence_test.rb +2 -2
  90. data/test/lib/rubycritic/generators/view_helpers_test.rb +2 -2
  91. data/test/lib/rubycritic/revision_comparator_test.rb +10 -10
  92. data/test/lib/rubycritic/smells_status_setter_test.rb +4 -4
  93. data/test/lib/rubycritic/source_control_systems/base_test.rb +7 -7
  94. data/test/lib/rubycritic/source_control_systems/double_test.rb +1 -1
  95. data/test/lib/rubycritic/source_control_systems/git_test.rb +1 -1
  96. data/test/lib/rubycritic/source_control_systems/mercurial_test.rb +1 -1
  97. data/test/lib/rubycritic/source_locator_test.rb +12 -12
  98. data/test/lib/rubycritic/version_test.rb +2 -2
  99. metadata +18 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22e5c323d28fee5bc92ef613ca7435aae70d50a0
4
- data.tar.gz: 3836b3346a5b98e90c99d6ac1da9f2faaaeabbff
3
+ metadata.gz: 4d45634d69cea138832dc86f6c5e57a56e1c7a1a
4
+ data.tar.gz: 3786e8e320a4d6dc1a3f50eec50be3e520861f59
5
5
  SHA512:
6
- metadata.gz: 8e349b4ba246bc9c2d40544eeba7908d1cdc71b8af6f7c0a5b54f929f4a085acfcde10d15047e53a956310b44e4739a95b3dd7d52d566c843e3d60b80a389b2b
7
- data.tar.gz: b1e9c59fd761ac53096663b9a0deea0433f0d2158618595e1d88c8fa038116f68b0f31e11625ef8157a596883c156d9abe1f270202c0faad0deb12b0000972b3
6
+ metadata.gz: da6f74791c9c71255c3e1150d38a8afd9fe6cc46715c5de86ff9609311818b5dc6d2aeaa38baa21fe32ee1b5615e3353ec376810844dec8a790153e7aa5804da
7
+ data.tar.gz: c532a3b2a06a996ac31fe11253168cf050f752bba5975339403867894387afba3749a1a61c429bb0b501b85940764a36e09605ef10a1c0a3cafa208cf773e854
data/.gitignore CHANGED
@@ -14,6 +14,7 @@ rdoc
14
14
  spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
+ test/samples/report.json
17
18
  tmp
18
19
  .idea/
19
20
  .ruby-gemset
data/.rubocop_todo.yml CHANGED
@@ -34,3 +34,9 @@ Style/ClassVars:
34
34
  # SupportedStyles: use_perl_names, use_english_names
35
35
  Style/SpecialGlobalVars:
36
36
  Enabled: false
37
+
38
+ # Offense count: 1
39
+ Style/MethodMissing:
40
+ Exclude:
41
+ - 'lib/rubycritic/configuration.rb'
42
+
data/.todo.reek CHANGED
@@ -1,138 +1,141 @@
1
1
  ---
2
2
  IrresponsibleModule:
3
3
  exclude:
4
- - Rubycritic::Analyser::Attributes
5
- - Rubycritic::Analyser::Churn
6
- - Rubycritic::Analyser::Complexity
4
+ - RubyCritic::Analyser::Attributes
5
+ - RubyCritic::Analyser::Churn
6
+ - RubyCritic::Analyser::Complexity
7
7
  - Parser::AST::Node
8
- - Rubycritic::AST::EmptyNode
9
- - Rubycritic::Flay
10
- - Rubycritic::Flog
11
- - Rubycritic::MethodsCounter
12
- - Rubycritic::ModulesLocator
13
- - Rubycritic::Parser
14
- - Rubycritic::Reek
15
- - Rubycritic::Analyser::FlaySmells
16
- - Rubycritic::Analyser::FlogSmells
17
- - Rubycritic::Analyser::ReekSmells
18
- - Rubycritic::AnalysersRunner
19
- - Rubycritic::Browser
20
- - Rubycritic::Cli::Application
21
- - Rubycritic::Cli::Options
22
- - Rubycritic::Colorize
23
- - Rubycritic::CommandFactory
24
- - Rubycritic::Command::Base
25
- - Rubycritic::Command::Ci
26
- - Rubycritic::Command::Default
27
- - Rubycritic::Command::Help
28
- - Rubycritic::Command::StatusReporter
29
- - Rubycritic::Command::Version
30
- - Rubycritic::Config
31
- - Rubycritic::Configuration
32
- - Rubycritic::AnalysedModule
33
- - Rubycritic::AnalysedModulesCollection
34
- - Rubycritic::Location
35
- - Rubycritic::Rating
36
- - Rubycritic::Smell
37
- - Rubycritic::Generator::ConsoleReport
38
- - Rubycritic::Generator::Html::Base
39
- - Rubycritic::Generator::Html::CodeFile
40
- - Rubycritic::Generator::Html::CodeIndex
41
- - Rubycritic::Generator::Html::Line
42
- - Rubycritic::Generator::Html::Overview
43
- - Rubycritic::Generator::Html::SmellsIndex
44
- - Rubycritic::Turbulence
45
- - Rubycritic::ViewHelpers
46
- - Rubycritic::Generator::HtmlReport
47
- - Rubycritic::Generator::Json::Simple
48
- - Rubycritic::Generator::JsonReport
49
- - Rubycritic::Generator::Text::List
50
- - Rubycritic::Reporter
51
- - Rubycritic::RevisionComparator
52
- - Rubycritic::Serializer
53
- - Rubycritic::SmellsStatusSetter
54
- - Rubycritic::SourceControlSystem::Base
55
- - Rubycritic::SourceControlSystem::Double
56
- - Rubycritic::SourceControlSystem::Git
57
- - Rubycritic::SourceControlSystem::Mercurial
58
- - Rubycritic::SourceLocator
59
- - Rubycritic
8
+ - RubyCritic::AST::EmptyNode
9
+ - RubyCritic::Flay
10
+ - RubyCritic::Flog
11
+ - RubyCritic::MethodsCounter
12
+ - RubyCritic::ModulesLocator
13
+ - RubyCritic::Parser
14
+ - RubyCritic::Reek
15
+ - RubyCritic::Analyser::FlaySmells
16
+ - RubyCritic::Analyser::FlogSmells
17
+ - RubyCritic::Analyser::ReekSmells
18
+ - RubyCritic::AnalysersRunner
19
+ - RubyCritic::Browser
20
+ - RubyCritic::Cli::Application
21
+ - RubyCritic::Cli::Options
22
+ - RubyCritic::Colorize
23
+ - RubyCritic::CommandFactory
24
+ - RubyCritic::Command::Base
25
+ - RubyCritic::Command::Ci
26
+ - RubyCritic::Command::Default
27
+ - RubyCritic::Command::Help
28
+ - RubyCritic::Command::StatusReporter
29
+ - RubyCritic::Command::Version
30
+ - RubyCritic::Config
31
+ - RubyCritic::Configuration
32
+ - RubyCritic::AnalysedModule
33
+ - RubyCritic::AnalysedModulesCollection
34
+ - RubyCritic::Location
35
+ - RubyCritic::Rating
36
+ - RubyCritic::Smell
37
+ - RubyCritic::Generator::ConsoleReport
38
+ - RubyCritic::Generator::Html::Base
39
+ - RubyCritic::Generator::Html::CodeFile
40
+ - RubyCritic::Generator::Html::CodeIndex
41
+ - RubyCritic::Generator::Html::Line
42
+ - RubyCritic::Generator::Html::Overview
43
+ - RubyCritic::Generator::Html::SmellsIndex
44
+ - RubyCritic::Turbulence
45
+ - RubyCritic::ViewHelpers
46
+ - RubyCritic::Generator::HtmlReport
47
+ - RubyCritic::Generator::Json::Simple
48
+ - RubyCritic::Generator::JsonReport
49
+ - RubyCritic::Generator::Text::List
50
+ - RubyCritic::Reporter
51
+ - RubyCritic::RevisionComparator
52
+ - RubyCritic::Serializer
53
+ - RubyCritic::SmellsStatusSetter
54
+ - RubyCritic::SourceControlSystem::Base
55
+ - RubyCritic::SourceControlSystem::Double
56
+ - RubyCritic::SourceControlSystem::Git
57
+ - RubyCritic::SourceControlSystem::Mercurial
58
+ - RubyCritic::SourceLocator
59
+ - RubyCritic
60
60
  Attribute:
61
61
  exclude:
62
- - Rubycritic::Analyser::Churn#source_control_system
63
- - Rubycritic::Configuration#deduplicate_symlinks
64
- - Rubycritic::Configuration#format
65
- - Rubycritic::Configuration#mode
66
- - Rubycritic::Configuration#no_browser
67
- - Rubycritic::Configuration#open_with
68
- - Rubycritic::Configuration#source_control_system
69
- - Rubycritic::Configuration#suppress_ratings
70
- - Rubycritic::RakeTask#name
71
- - Rubycritic::RakeTask#options
72
- - Rubycritic::RakeTask#paths
73
- - Rubycritic::RakeTask#verbose
62
+ - RubyCritic::Analyser::Churn#source_control_system
63
+ - RubyCritic::Configuration#deduplicate_symlinks
64
+ - RubyCritic::Configuration#format
65
+ - RubyCritic::Configuration#mode
66
+ - RubyCritic::Configuration#no_browser
67
+ - RubyCritic::Configuration#open_with
68
+ - RubyCritic::Configuration#source_control_system
69
+ - RubyCritic::Configuration#suppress_ratings
70
+ - RubyCritic::RakeTask#name
71
+ - RubyCritic::RakeTask#options
72
+ - RubyCritic::RakeTask#paths
73
+ - RubyCritic::RakeTask#verbose
74
74
  DuplicateMethodCall:
75
75
  exclude:
76
- - Rubycritic::Analyser::Churn#run
76
+ - RubyCritic::Analyser::Churn#run
77
77
  - Parser::AST::Node#module_name
78
78
  TooManyStatements:
79
79
  exclude:
80
- - Rubycritic::RakeTask#initialize
81
- - Rubycritic::Analyser::Complexity#run
80
+ - RubyCritic::RakeTask#initialize
81
+ - RubyCritic::Analyser::Complexity#run
82
82
  - Parser::AST::Node#get_module_names
83
- - Rubycritic::Analyser::FlaySmells#run
84
- - Rubycritic::Cli::Application#execute
85
- - Rubycritic::Cli::Options#parse
86
- - Rubycritic::CommandFactory#self.command_class
87
- - Rubycritic::Configuration#set
88
- - Rubycritic::Generator::Html::CodeFile#render
89
- - Rubycritic::Reporter#self.report_generator_class
90
- - Rubycritic::SourceLocator#deduplicate_symlinks
83
+ - RubyCritic::Analyser::FlaySmells#run
84
+ - RubyCritic::Cli::Application#execute
85
+ - RubyCritic::Cli::Options#parse
86
+ - RubyCritic::CommandFactory#self.command_class
87
+ - RubyCritic::Configuration#set
88
+ - RubyCritic::Generator::Html::CodeFile#render
89
+ - RubyCritic::Reporter#self.report_generator_class
90
+ - RubyCritic::SourceLocator#deduplicate_symlinks
91
91
  FeatureEnvy:
92
92
  exclude:
93
93
  - Parser::AST::Node#module_name
94
94
  - Parser::AST::Node#module_name
95
95
  - Parser::AST::Node#recursive_children
96
- - Rubycritic::Analyser::ReekSmells#add_smells_to
97
- - Rubycritic::Analyser::ReekSmells#create_smell
98
- - Rubycritic::ViewHelpers#smell_location_path
99
- - Rubycritic::Generator::HtmlReport#create_directories_and_files
100
- - Rubycritic::SourceLocator#deduplicate_symlinks
96
+ - RubyCritic::Analyser::ReekSmells#add_smells_to
97
+ - RubyCritic::Analyser::ReekSmells#create_smell
98
+ - RubyCritic::ViewHelpers#smell_location_path
99
+ - RubyCritic::Generator::HtmlReport#create_directories_and_files
100
+ - RubyCritic::SourceLocator#deduplicate_symlinks
101
101
  NestedIterators:
102
102
  exclude:
103
103
  - Parser::AST::Node#recursive_children
104
- - Rubycritic::Analyser::FlaySmells#run
105
- - Rubycritic::Cli::Options#parse
106
- - Rubycritic::Generator::HtmlReport#create_directories_and_files
104
+ - RubyCritic::Analyser::FlaySmells#run
105
+ - RubyCritic::Cli::Options#parse
106
+ - RubyCritic::Generator::HtmlReport#create_directories_and_files
107
107
  UtilityFunction:
108
108
  exclude:
109
- - Rubycritic::Analyser::FlaySmells#cost
110
- - Rubycritic::Analyser::FlaySmells#paths_to_analysed_modules
111
- - Rubycritic::Analyser::FlaySmells#smell_locations
112
- - Rubycritic::Analyser::FlogSmells#type
113
- - Rubycritic::Analyser::ReekSmells#smell_locations
114
- - Rubycritic::Cli::Application#print
115
- - Rubycritic::AnalysedModulesCollection#limited_cost_for
116
- - Rubycritic::Generator::Html::SmellsIndex#analysed_module_names
117
- - Rubycritic::Generator::HtmlReport#copy_assets_to_report_directory
118
- - Rubycritic::SourceControlSystem::Git#date_of_last_commit
119
- - Rubycritic::SourceControlSystem::Git#head_reference
120
- - Rubycritic::SourceControlSystem::Git#revisions_count
121
- - Rubycritic::SourceControlSystem::Git#stashes_count
122
- - Rubycritic::SourceControlSystem::Mercurial#date_of_last_commit
123
- - Rubycritic::SourceControlSystem::Mercurial#revisions_count
109
+ - RubyCritic::Analyser::FlaySmells#cost
110
+ - RubyCritic::Analyser::FlaySmells#paths_to_analysed_modules
111
+ - RubyCritic::Analyser::FlaySmells#smell_locations
112
+ - RubyCritic::Analyser::FlogSmells#type
113
+ - RubyCritic::Analyser::ReekSmells#smell_locations
114
+ - RubyCritic::Cli::Application#print
115
+ - RubyCritic::AnalysedModulesCollection#limited_cost_for
116
+ - RubyCritic::Generator::Html::SmellsIndex#analysed_module_names
117
+ - RubyCritic::Generator::HtmlReport#copy_assets_to_report_directory
118
+ - RubyCritic::SourceControlSystem::Git#date_of_last_commit
119
+ - RubyCritic::SourceControlSystem::Git#head_reference
120
+ - RubyCritic::SourceControlSystem::Git#revisions_count
121
+ - RubyCritic::SourceControlSystem::Git#stashes_count
122
+ - RubyCritic::SourceControlSystem::Mercurial#date_of_last_commit
123
+ - RubyCritic::SourceControlSystem::Mercurial#revisions_count
124
124
  TooManyInstanceVariables:
125
125
  exclude:
126
- - Rubycritic::Cli::Options
126
+ - RubyCritic::Cli::Options
127
127
  ControlParameter:
128
128
  exclude:
129
- - Rubycritic::CommandFactory#self.command_class
129
+ - RubyCritic::CommandFactory#self.command_class
130
130
  UncommunicativeParameterName:
131
131
  exclude:
132
- - Rubycritic::AnalysedModule#to_json
133
- - Rubycritic::Location#to_json
134
- - Rubycritic::Rating#to_json
135
- - Rubycritic::Smell#to_json
132
+ - RubyCritic::AnalysedModule#to_json
133
+ - RubyCritic::Location#to_json
134
+ - RubyCritic::Rating#to_json
135
+ - RubyCritic::Smell#to_json
136
136
  ClassVariable:
137
137
  exclude:
138
- - Rubycritic::SourceControlSystem::Base
138
+ - RubyCritic::SourceControlSystem::Base
139
+ BooleanParameter:
140
+ exclude:
141
+ - RubyCritic::Config#self.respond_to_missing?
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 2.9.3 / 2016-08-17
2
+
3
+ * [FEATURE] Save json report to file (by NickTroy)
4
+ * [CHANGE] Rename Rubycritic to RubyCritic (by troessner)
5
+
1
6
  # 2.9.2 / 2016-07-01
2
7
 
3
8
  * [CHANGE] Upgrade rubocop to 0.41.1 (by nijikon)
data/README.md CHANGED
@@ -146,7 +146,7 @@ You can use RubyCritic as Rake command in its most simple form like this:
146
146
  ```ruby
147
147
  require "rubycritic/rake_task"
148
148
 
149
- Rubycritic::RakeTask.new
149
+ RubyCritic::RakeTask.new
150
150
  ```
151
151
 
152
152
  A more sophisticated Rake task that would make use of all available configuration options could look like this:
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ RuboCop::RakeTask.new
19
19
 
20
20
  Reek::Rake::Task.new
21
21
 
22
- Rubycritic::RakeTask.new do |task|
22
+ RubyCritic::RakeTask.new do |task|
23
23
  task.paths = FileList['lib/**/*.rb']
24
24
  end
25
25
 
data/bin/rubycritic CHANGED
@@ -6,4 +6,4 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
6
6
 
7
7
  require 'rubycritic/cli/application'
8
8
 
9
- exit Rubycritic::Cli::Application.new(ARGV).execute
9
+ exit RubyCritic::Cli::Application.new(ARGV).execute
@@ -1,6 +1,6 @@
1
1
  Feature: Break if overall score is bellow minimum
2
2
  In order to break the Continuous Integration builds based on a score threshold
3
- Rubycritic returns the exit status according with the score
3
+ RubyCritic returns the exit status according with the score
4
4
 
5
5
  Scenario: Status indicates a success when not using --minimum-score
6
6
  Given the smelly file 'smelly.rb' with a score of 93.75
@@ -1,5 +1,5 @@
1
- Feature: Rubycritic can be controlled using command-line options
2
- In order to change Rubycritic's default behaviour
1
+ Feature: RubyCritic can be controlled using command-line options
2
+ In order to change RubyCritic's default behaviour
3
3
  As a developer
4
4
  I want to supply options on the command line
5
5
 
@@ -1,4 +1,4 @@
1
- Feature: Rubycritic can be run via Rake task
1
+ Feature: RubyCritic can be run via Rake task
2
2
  In order to allow for a better CI usage
3
3
  As a developer
4
4
  I want to use RubyCritic as a Rake task
@@ -7,7 +7,7 @@ Feature: Rubycritic can be run via Rake task
7
7
  Given the smelly file 'smelly.rb'
8
8
  When I run rake rubycritic with:
9
9
  """
10
- Rubycritic::RakeTask.new do |t|
10
+ RubyCritic::RakeTask.new do |t|
11
11
  t.paths = FileList['smelly.*']
12
12
  t.options = '--no-browser -f console'
13
13
  end
@@ -22,7 +22,7 @@ Feature: Rubycritic can be run via Rake task
22
22
  Given the smelly file 'smelly.rb'
23
23
  When I run rake silky with:
24
24
  """
25
- Rubycritic::RakeTask.new('silky') do |t|
25
+ RubyCritic::RakeTask.new('silky') do |t|
26
26
  t.paths = FileList['smelly.*']
27
27
  t.verbose = true
28
28
  t.options = '--no-browser'
@@ -37,7 +37,7 @@ Feature: Rubycritic can be run via Rake task
37
37
  Given the smelly file 'smelly.rb'
38
38
  When I run rake rubycritic with:
39
39
  """
40
- Rubycritic::RakeTask.new do |t|
40
+ RubyCritic::RakeTask.new do |t|
41
41
  t.paths = FileList['smelly.*']
42
42
  t.verbose = true
43
43
  t.options = '--no-browser'
@@ -53,7 +53,7 @@ Feature: Rubycritic can be run via Rake task
53
53
  Given the smelly file 'smelly.rb'
54
54
  When I run rake rubycritic with:
55
55
  """
56
- Rubycritic::RakeTask.new do |t|
56
+ RubyCritic::RakeTask.new do |t|
57
57
  t.paths = FileList['smelly.*']
58
58
  t.verbose = true
59
59
  t.options = '--no-browser -f console --minimum-score 95'
@@ -3,11 +3,11 @@ When(/^I run rubycritic (.*)$/) do |args|
3
3
  end
4
4
 
5
5
  Then(/^the exit status indicates an error$/) do
6
- expect(last_command_started).to have_exit_status(Rubycritic::Command::StatusReporter::SCORE_BELOW_MINIMUM)
6
+ expect(last_command_started).to have_exit_status(RubyCritic::Command::StatusReporter::SCORE_BELOW_MINIMUM)
7
7
  end
8
8
 
9
9
  Then(/^the exit status indicates a success$/) do
10
- expect(last_command_started).to have_exit_status(Rubycritic::Command::StatusReporter::SUCCESS)
10
+ expect(last_command_started).to have_exit_status(RubyCritic::Command::StatusReporter::SUCCESS)
11
11
  end
12
12
 
13
13
  Then(/^it reports:$/) do |report|
@@ -19,7 +19,7 @@ Then(/^there is no output on stdout$/) do
19
19
  end
20
20
 
21
21
  Then(/^it reports the current version$/) do
22
- expect(last_command_started).to have_output("RubyCritic #{Rubycritic::VERSION}\n")
22
+ expect(last_command_started).to have_output("RubyCritic #{RubyCritic::VERSION}\n")
23
23
  end
24
24
 
25
25
  Then(/^it reports the error ['"](.*)['"]$/) do |string|
@@ -27,5 +27,5 @@ Then(/^it reports the error ['"](.*)['"]$/) do |string|
27
27
  end
28
28
 
29
29
  Then(/^it succeeds$/) do
30
- expect(last_command_started).to have_exit_status(Rubycritic::Command::StatusReporter::SUCCESS)
30
+ expect(last_command_started).to have_exit_status(RubyCritic::Command::StatusReporter::SUCCESS)
31
31
  end
@@ -7,7 +7,7 @@ require 'minitest/spec'
7
7
  #
8
8
  # Provides runner methods used in the cucumber steps.
9
9
  #
10
- class RubycriticWorld
10
+ class RubyCriticWorld
11
11
  extend MiniTest::Assertions
12
12
  attr_accessor :assertions
13
13
 
@@ -31,7 +31,7 @@ class RubycriticWorld
31
31
  end
32
32
 
33
33
  World do
34
- RubycriticWorld.new
34
+ RubyCriticWorld.new
35
35
  end
36
36
 
37
37
  Before do
@@ -2,7 +2,7 @@ require 'rubycritic/analysers/helpers/methods_counter'
2
2
  require 'rubycritic/analysers/helpers/modules_locator'
3
3
  require 'rubycritic/colorize'
4
4
 
5
- module Rubycritic
5
+ module RubyCritic
6
6
  module Analyser
7
7
  class Attributes
8
8
  include Colorize
@@ -1,6 +1,6 @@
1
1
  require 'rubycritic/colorize'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  module Analyser
5
5
  class Churn
6
6
  include Colorize
@@ -1,7 +1,7 @@
1
1
  require 'rubycritic/analysers/helpers/flog'
2
2
  require 'rubycritic/colorize'
3
3
 
4
- module Rubycritic
4
+ module RubyCritic
5
5
  module Analyser
6
6
  class Complexity
7
7
  include Colorize
@@ -52,7 +52,7 @@ module Parser
52
52
  end
53
53
  end
54
54
 
55
- module Rubycritic
55
+ module RubyCritic
56
56
  module AST
57
57
  class EmptyNode
58
58
  def count_nodes_of_type(*)
@@ -1,6 +1,6 @@
1
1
  require 'flay'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class Flay < ::Flay
5
5
  def initialize(paths)
6
6
  super()
@@ -1,6 +1,6 @@
1
1
  require 'flog'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class Flog < ::Flog
5
5
  DEFAULT_OPTIONS = {
6
6
  all: true,
@@ -1,6 +1,6 @@
1
1
  require 'rubycritic/analysers/helpers/parser'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class MethodsCounter
5
5
  def initialize(analysed_module)
6
6
  @analysed_module = analysed_module
@@ -1,6 +1,6 @@
1
1
  require 'rubycritic/analysers/helpers/parser'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class ModulesLocator
5
5
  def initialize(analysed_module)
6
6
  @analysed_module = analysed_module
@@ -1,7 +1,7 @@
1
1
  require 'parser/current'
2
2
  require 'rubycritic/analysers/helpers/ast_node'
3
3
 
4
- module Rubycritic
4
+ module RubyCritic
5
5
  module Parser
6
6
  def self.parse(content)
7
7
  ::Parser::CurrentRuby.parse(content) || AST::EmptyNode.new
@@ -1,6 +1,6 @@
1
1
  require 'reek'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class Reek < ::Reek::Examiner
5
5
  end
6
6
  end
@@ -2,7 +2,7 @@ require 'rubycritic/analysers/helpers/flay'
2
2
  require 'rubycritic/core/smell'
3
3
  require 'rubycritic/colorize'
4
4
 
5
- module Rubycritic
5
+ module RubyCritic
6
6
  module Analyser
7
7
  class FlaySmells
8
8
  include Colorize
@@ -2,7 +2,7 @@ require 'rubycritic/analysers/helpers/flog'
2
2
  require 'rubycritic/core/smell'
3
3
  require 'rubycritic/colorize'
4
4
 
5
- module Rubycritic
5
+ module RubyCritic
6
6
  module Analyser
7
7
  class FlogSmells
8
8
  include Colorize
@@ -2,7 +2,7 @@ require 'rubycritic/analysers/helpers/reek'
2
2
  require 'rubycritic/core/smell'
3
3
  require 'rubycritic/colorize'
4
4
 
5
- module Rubycritic
5
+ module RubyCritic
6
6
  module Analyser
7
7
  class ReekSmells
8
8
  include Colorize
@@ -6,7 +6,7 @@ require 'rubycritic/analysers/complexity'
6
6
  require 'rubycritic/analysers/churn'
7
7
  require 'rubycritic/analysers/attributes'
8
8
 
9
- module Rubycritic
9
+ module RubyCritic
10
10
  class AnalysersRunner
11
11
  ANALYSERS = [
12
12
  Analyser::FlaySmells,
@@ -1,6 +1,6 @@
1
1
  require 'launchy'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class Browser
5
5
  attr_reader :report_path
6
6
 
@@ -2,7 +2,7 @@ require 'rubycritic'
2
2
  require 'rubycritic/cli/options'
3
3
  require 'rubycritic/command_factory'
4
4
 
5
- module Rubycritic
5
+ module RubyCritic
6
6
  module Cli
7
7
  class Application
8
8
  STATUS_SUCCESS = 0
@@ -15,7 +15,7 @@ module Rubycritic
15
15
  def execute
16
16
  parsed_options = @options.parse
17
17
 
18
- reporter = Rubycritic::CommandFactory.create(parsed_options.to_h).execute
18
+ reporter = RubyCritic::CommandFactory.create(parsed_options.to_h).execute
19
19
  print(reporter.status_message)
20
20
  reporter.status
21
21
  rescue OptionParser::InvalidOption => error
@@ -1,7 +1,7 @@
1
1
  require 'optparse'
2
2
  require 'rubycritic/browser'
3
3
 
4
- module Rubycritic
4
+ module RubyCritic
5
5
  module Cli
6
6
  class Options
7
7
  def initialize(argv)
@@ -1,4 +1,4 @@
1
- module Rubycritic
1
+ module RubyCritic
2
2
  module Colorize
3
3
  def colorize(text, color_code)
4
4
  "\e[#{color_code}m#{text}\e[0m"
@@ -1,6 +1,6 @@
1
1
  require 'rubycritic/configuration'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  class CommandFactory
5
5
  def self.create(options = {})
6
6
  Config.set(options)
@@ -1,11 +1,11 @@
1
1
  require 'rubycritic/commands/status_reporter'
2
2
 
3
- module Rubycritic
3
+ module RubyCritic
4
4
  module Command
5
5
  class Base
6
6
  def initialize(options)
7
7
  @options = options
8
- @status_reporter = Rubycritic::Command::StatusReporter.new(@options)
8
+ @status_reporter = RubyCritic::Command::StatusReporter.new(@options)
9
9
  end
10
10
 
11
11
  def execute
@@ -3,7 +3,7 @@ require 'rubycritic/analysers_runner'
3
3
  require 'rubycritic/reporter'
4
4
  require 'rubycritic/commands/default'
5
5
 
6
- module Rubycritic
6
+ module RubyCritic
7
7
  module Command
8
8
  class Ci < Default
9
9
  def critique