reek 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +44 -4
- data/License.txt +20 -0
- data/README.rdoc +83 -0
- data/Rakefile +0 -1
- data/bin/reek +3 -11
- data/config/defaults.reek +20 -1
- data/features/masking_smells.feature +111 -0
- data/features/options.feature +49 -0
- data/features/reports.feature +90 -0
- data/features/samples.feature +284 -0
- data/features/stdin.feature +43 -0
- data/features/step_definitions/reek_steps.rb +35 -0
- data/features/support/env.rb +38 -0
- data/lib/reek.rb +1 -1
- data/lib/reek/adapters/application.rb +47 -0
- data/lib/reek/adapters/config_file.rb +31 -0
- data/lib/reek/adapters/core_extras.rb +72 -0
- data/lib/reek/{object_source.rb → adapters/object_source.rb} +15 -19
- data/lib/reek/{rake_task.rb → adapters/rake_task.rb} +2 -2
- data/lib/reek/adapters/report.rb +91 -0
- data/lib/reek/adapters/source.rb +53 -0
- data/lib/reek/{spec.rb → adapters/spec.rb} +45 -60
- data/lib/reek/block_context.rb +1 -1
- data/lib/reek/class_context.rb +26 -6
- data/lib/reek/code_context.rb +8 -0
- data/lib/reek/code_parser.rb +82 -39
- data/lib/reek/command_line.rb +85 -0
- data/lib/reek/configuration.rb +51 -0
- data/lib/reek/detector_stack.rb +39 -0
- data/lib/reek/exceptions.reek +8 -1
- data/lib/reek/method_context.rb +53 -11
- data/lib/reek/module_context.rb +1 -2
- data/lib/reek/name.rb +8 -2
- data/lib/reek/sexp_formatter.rb +2 -0
- data/lib/reek/smell_warning.rb +26 -8
- data/lib/reek/smells/control_couple.rb +8 -4
- data/lib/reek/smells/data_clump.rb +88 -0
- data/lib/reek/smells/duplication.rb +11 -9
- data/lib/reek/smells/feature_envy.rb +3 -4
- data/lib/reek/smells/large_class.rb +17 -17
- data/lib/reek/smells/long_method.rb +10 -8
- data/lib/reek/smells/long_parameter_list.rb +16 -10
- data/lib/reek/smells/long_yield_list.rb +1 -1
- data/lib/reek/smells/nested_iterators.rb +3 -3
- data/lib/reek/smells/simulated_polymorphism.rb +58 -0
- data/lib/reek/smells/smell_detector.rb +94 -27
- data/lib/reek/smells/uncommunicative_name.rb +23 -23
- data/lib/reek/smells/utility_function.rb +27 -11
- data/lib/reek/sniffer.rb +183 -0
- data/reek.gemspec +5 -5
- data/spec/quality/reek_source_spec.rb +15 -0
- data/spec/reek/adapters/report_spec.rb +49 -0
- data/spec/reek/adapters/should_reek_of_spec.rb +108 -0
- data/spec/reek/adapters/should_reek_only_of_spec.rb +87 -0
- data/spec/reek/adapters/should_reek_spec.rb +92 -0
- data/spec/reek/block_context_spec.rb +7 -1
- data/spec/reek/class_context_spec.rb +39 -16
- data/spec/reek/code_context_spec.rb +7 -7
- data/spec/reek/code_parser_spec.rb +6 -1
- data/spec/reek/config_spec.rb +3 -3
- data/spec/reek/configuration_spec.rb +12 -0
- data/spec/reek/method_context_spec.rb +2 -2
- data/spec/reek/name_spec.rb +24 -0
- data/spec/reek/object_source_spec.rb +23 -0
- data/spec/reek/singleton_method_context_spec.rb +2 -2
- data/spec/reek/smell_warning_spec.rb +53 -0
- data/spec/reek/smells/data_clump_spec.rb +87 -0
- data/spec/reek/smells/duplication_spec.rb +13 -17
- data/spec/reek/smells/feature_envy_spec.rb +23 -28
- data/spec/reek/smells/large_class_spec.rb +109 -34
- data/spec/reek/smells/long_method_spec.rb +140 -3
- data/spec/reek/smells/long_parameter_list_spec.rb +1 -2
- data/spec/reek/smells/simulated_polymorphism_spec.rb +50 -0
- data/spec/reek/smells/smell_detector_spec.rb +53 -0
- data/spec/reek/smells/uncommunicative_name_spec.rb +20 -7
- data/spec/reek/smells/utility_function_spec.rb +76 -67
- data/spec/reek/sniffer_spec.rb +10 -0
- data/spec/samples/all_but_one_masked/clean_one.rb +6 -0
- data/spec/samples/all_but_one_masked/dirty.rb +7 -0
- data/spec/samples/all_but_one_masked/masked.reek +5 -0
- data/spec/samples/clean_due_to_masking/clean_one.rb +6 -0
- data/spec/samples/clean_due_to_masking/clean_three.rb +6 -0
- data/spec/samples/clean_due_to_masking/clean_two.rb +6 -0
- data/spec/samples/clean_due_to_masking/dirty_one.rb +7 -0
- data/spec/samples/clean_due_to_masking/dirty_two.rb +7 -0
- data/spec/samples/clean_due_to_masking/masked.reek +7 -0
- data/spec/samples/corrupt_config_file/corrupt.reek +1 -0
- data/spec/samples/corrupt_config_file/dirty.rb +7 -0
- data/spec/samples/empty_config_file/dirty.rb +7 -0
- data/spec/samples/empty_config_file/empty.reek +0 -0
- data/spec/samples/exceptions.reek +4 -0
- data/spec/{slow/samples → samples}/inline.rb +0 -0
- data/spec/samples/masked/dirty.rb +7 -0
- data/spec/samples/masked/masked.reek +3 -0
- data/spec/samples/mixed_results/clean_one.rb +6 -0
- data/spec/samples/mixed_results/clean_three.rb +6 -0
- data/spec/samples/mixed_results/clean_two.rb +6 -0
- data/spec/samples/mixed_results/dirty_one.rb +7 -0
- data/spec/samples/mixed_results/dirty_two.rb +7 -0
- data/spec/samples/not_quite_masked/dirty.rb +8 -0
- data/spec/samples/not_quite_masked/masked.reek +5 -0
- data/spec/{slow/samples → samples}/optparse.rb +0 -0
- data/spec/samples/overrides/masked/dirty.rb +7 -0
- data/spec/samples/overrides/masked/lower.reek +5 -0
- data/spec/samples/overrides/upper.reek +5 -0
- data/spec/{slow/samples → samples}/redcloth.rb +0 -0
- data/spec/samples/three_clean_files/clean_one.rb +6 -0
- data/spec/samples/three_clean_files/clean_three.rb +6 -0
- data/spec/samples/three_clean_files/clean_two.rb +6 -0
- data/spec/samples/two_smelly_files/dirty_one.rb +7 -0
- data/spec/samples/two_smelly_files/dirty_two.rb +7 -0
- data/spec/spec.opts +1 -1
- data/spec/spec_helper.rb +4 -4
- data/tasks/reek.rake +8 -5
- data/tasks/test.rake +51 -0
- metadata +75 -25
- data/README.txt +0 -6
- data/lib/reek/options.rb +0 -92
- data/lib/reek/report.rb +0 -81
- data/lib/reek/smells/smells.rb +0 -81
- data/lib/reek/source.rb +0 -127
- data/spec/reek/options_spec.rb +0 -13
- data/spec/reek/report_spec.rb +0 -48
- data/spec/reek/smells/smell_spec.rb +0 -24
- data/spec/slow/inline_spec.rb +0 -43
- data/spec/slow/optparse_spec.rb +0 -108
- data/spec/slow/redcloth_spec.rb +0 -101
- data/spec/slow/reek_source_spec.rb +0 -20
- data/spec/slow/script_spec.rb +0 -55
- data/spec/slow/source_list_spec.rb +0 -40
- data/tasks/rspec.rake +0 -21
@@ -0,0 +1 @@
|
|
1
|
+
This is not a config file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec.opts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--
|
1
|
+
--color
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
$:.unshift File.dirname(__FILE__) + '/../lib'
|
2
2
|
|
3
3
|
begin
|
4
|
-
require 'spec'
|
4
|
+
require 'spec/expectations'
|
5
5
|
rescue LoadError
|
6
6
|
require 'rubygems'
|
7
7
|
gem 'rspec'
|
8
|
-
require 'spec'
|
8
|
+
require 'spec/expectations'
|
9
9
|
end
|
10
10
|
|
11
|
-
require 'reek/spec'
|
11
|
+
require 'reek/adapters/spec'
|
12
12
|
|
13
|
-
SAMPLES_DIR = 'spec/
|
13
|
+
SAMPLES_DIR = 'spec/samples' unless Object.const_defined?('SAMPLES_DIR')
|
data/tasks/reek.rake
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'reek/adapters/rake_task'
|
2
3
|
|
3
|
-
Reek::RakeTask.new do |t|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
Reek::RakeTask.new do |t|
|
5
|
+
t.fail_on_error = true
|
6
|
+
t.verbose = false
|
7
|
+
t.reek_opts = '--quiet --show-all'
|
8
|
+
end
|
9
|
+
rescue Gem::LoadError
|
7
10
|
end
|
data/tasks/test.rake
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'cucumber'
|
3
|
+
require 'cucumber/rake/task'
|
4
|
+
require 'spec'
|
5
|
+
require 'spec/rake/spectask'
|
6
|
+
|
7
|
+
namespace 'test' do
|
8
|
+
UNIT_TESTS = FileList['spec/reek/**/*_spec.rb']
|
9
|
+
QUALITY_TESTS = FileList['spec/quality/**/*_spec.rb']
|
10
|
+
|
11
|
+
Spec::Rake::SpecTask.new('spec') do |t|
|
12
|
+
t.spec_files = UNIT_TESTS
|
13
|
+
t.spec_opts = ['--color']
|
14
|
+
t.ruby_opts = ['-Ilib']
|
15
|
+
t.rcov = false
|
16
|
+
end
|
17
|
+
|
18
|
+
Spec::Rake::SpecTask.new('quality') do |t|
|
19
|
+
t.spec_files = QUALITY_TESTS
|
20
|
+
t.spec_opts = ['--color']
|
21
|
+
t.ruby_opts = ['-Ilib']
|
22
|
+
t.rcov = false
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'Runs all unit tests under RCov'
|
26
|
+
Spec::Rake::SpecTask.new('rcov') do |t|
|
27
|
+
t.spec_files = UNIT_TESTS + QUALITY_TESTS
|
28
|
+
t.rcov = true
|
29
|
+
t.rcov_dir = 'build/coverage'
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'Checks all supported versions of Ruby'
|
33
|
+
task :multiruby do
|
34
|
+
sh "multiruby -S rake spec"
|
35
|
+
end
|
36
|
+
|
37
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
38
|
+
t.cucumber_opts = "features --format progress --color"
|
39
|
+
end
|
40
|
+
|
41
|
+
desc 'Runs all unit tests, acceptance tests and quality checks'
|
42
|
+
task 'all' => ['test:spec', 'test:features', 'test:quality', 'test:multiruby']
|
43
|
+
end
|
44
|
+
|
45
|
+
task 'clobber_rcov' => 'test:clobber_rcov'
|
46
|
+
|
47
|
+
desc 'synonym for test:spec'
|
48
|
+
task 'spec' => 'test:spec'
|
49
|
+
|
50
|
+
desc 'synonym for test:all'
|
51
|
+
task 'test' => 'test:all'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Rutherford
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-20 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -51,32 +51,49 @@ extensions: []
|
|
51
51
|
|
52
52
|
extra_rdoc_files:
|
53
53
|
- History.txt
|
54
|
-
-
|
54
|
+
- License.txt
|
55
|
+
- README.rdoc
|
55
56
|
files:
|
56
57
|
- History.txt
|
57
|
-
-
|
58
|
+
- License.txt
|
59
|
+
- README.rdoc
|
58
60
|
- Rakefile
|
59
61
|
- bin/reek
|
60
62
|
- config/defaults.reek
|
63
|
+
- features/masking_smells.feature
|
64
|
+
- features/options.feature
|
65
|
+
- features/reports.feature
|
66
|
+
- features/samples.feature
|
67
|
+
- features/stdin.feature
|
68
|
+
- features/step_definitions/reek_steps.rb
|
69
|
+
- features/support/env.rb
|
61
70
|
- lib/reek.rb
|
71
|
+
- lib/reek/adapters/application.rb
|
72
|
+
- lib/reek/adapters/config_file.rb
|
73
|
+
- lib/reek/adapters/core_extras.rb
|
74
|
+
- lib/reek/adapters/object_source.rb
|
75
|
+
- lib/reek/adapters/rake_task.rb
|
76
|
+
- lib/reek/adapters/report.rb
|
77
|
+
- lib/reek/adapters/source.rb
|
78
|
+
- lib/reek/adapters/spec.rb
|
62
79
|
- lib/reek/block_context.rb
|
63
80
|
- lib/reek/class_context.rb
|
64
81
|
- lib/reek/code_context.rb
|
65
82
|
- lib/reek/code_parser.rb
|
83
|
+
- lib/reek/command_line.rb
|
84
|
+
- lib/reek/configuration.rb
|
85
|
+
- lib/reek/detector_stack.rb
|
66
86
|
- lib/reek/exceptions.reek
|
67
87
|
- lib/reek/if_context.rb
|
68
88
|
- lib/reek/method_context.rb
|
69
89
|
- lib/reek/module_context.rb
|
70
90
|
- lib/reek/name.rb
|
71
91
|
- lib/reek/object_refs.rb
|
72
|
-
- lib/reek/object_source.rb
|
73
|
-
- lib/reek/options.rb
|
74
|
-
- lib/reek/rake_task.rb
|
75
|
-
- lib/reek/report.rb
|
76
92
|
- lib/reek/sexp_formatter.rb
|
77
93
|
- lib/reek/singleton_method_context.rb
|
78
94
|
- lib/reek/smell_warning.rb
|
79
95
|
- lib/reek/smells/control_couple.rb
|
96
|
+
- lib/reek/smells/data_clump.rb
|
80
97
|
- lib/reek/smells/duplication.rb
|
81
98
|
- lib/reek/smells/feature_envy.rb
|
82
99
|
- lib/reek/smells/large_class.rb
|
@@ -84,51 +101,84 @@ files:
|
|
84
101
|
- lib/reek/smells/long_parameter_list.rb
|
85
102
|
- lib/reek/smells/long_yield_list.rb
|
86
103
|
- lib/reek/smells/nested_iterators.rb
|
104
|
+
- lib/reek/smells/simulated_polymorphism.rb
|
87
105
|
- lib/reek/smells/smell_detector.rb
|
88
|
-
- lib/reek/smells/smells.rb
|
89
106
|
- lib/reek/smells/uncommunicative_name.rb
|
90
107
|
- lib/reek/smells/utility_function.rb
|
91
|
-
- lib/reek/
|
92
|
-
- lib/reek/spec.rb
|
108
|
+
- lib/reek/sniffer.rb
|
93
109
|
- lib/reek/stop_context.rb
|
94
110
|
- lib/reek/yield_call_context.rb
|
95
111
|
- reek.gemspec
|
112
|
+
- spec/quality/reek_source_spec.rb
|
113
|
+
- spec/reek/adapters/report_spec.rb
|
114
|
+
- spec/reek/adapters/should_reek_of_spec.rb
|
115
|
+
- spec/reek/adapters/should_reek_only_of_spec.rb
|
116
|
+
- spec/reek/adapters/should_reek_spec.rb
|
96
117
|
- spec/reek/block_context_spec.rb
|
97
118
|
- spec/reek/class_context_spec.rb
|
98
119
|
- spec/reek/code_context_spec.rb
|
99
120
|
- spec/reek/code_parser_spec.rb
|
100
121
|
- spec/reek/config_spec.rb
|
122
|
+
- spec/reek/configuration_spec.rb
|
101
123
|
- spec/reek/if_context_spec.rb
|
102
124
|
- spec/reek/method_context_spec.rb
|
103
125
|
- spec/reek/module_context_spec.rb
|
104
126
|
- spec/reek/name_spec.rb
|
105
127
|
- spec/reek/object_refs_spec.rb
|
106
|
-
- spec/reek/
|
107
|
-
- spec/reek/report_spec.rb
|
128
|
+
- spec/reek/object_source_spec.rb
|
108
129
|
- spec/reek/singleton_method_context_spec.rb
|
130
|
+
- spec/reek/smell_warning_spec.rb
|
109
131
|
- spec/reek/smells/control_couple_spec.rb
|
132
|
+
- spec/reek/smells/data_clump_spec.rb
|
110
133
|
- spec/reek/smells/duplication_spec.rb
|
111
134
|
- spec/reek/smells/feature_envy_spec.rb
|
112
135
|
- spec/reek/smells/large_class_spec.rb
|
113
136
|
- spec/reek/smells/long_method_spec.rb
|
114
137
|
- spec/reek/smells/long_parameter_list_spec.rb
|
115
138
|
- spec/reek/smells/nested_iterators_spec.rb
|
116
|
-
- spec/reek/smells/
|
139
|
+
- spec/reek/smells/simulated_polymorphism_spec.rb
|
140
|
+
- spec/reek/smells/smell_detector_spec.rb
|
117
141
|
- spec/reek/smells/uncommunicative_name_spec.rb
|
118
142
|
- spec/reek/smells/utility_function_spec.rb
|
119
|
-
- spec/
|
120
|
-
- spec/
|
121
|
-
- spec/
|
122
|
-
- spec/
|
123
|
-
- spec/
|
124
|
-
- spec/
|
125
|
-
- spec/
|
126
|
-
- spec/
|
127
|
-
- spec/
|
143
|
+
- spec/reek/sniffer_spec.rb
|
144
|
+
- spec/samples/all_but_one_masked/clean_one.rb
|
145
|
+
- spec/samples/all_but_one_masked/dirty.rb
|
146
|
+
- spec/samples/all_but_one_masked/masked.reek
|
147
|
+
- spec/samples/clean_due_to_masking/clean_one.rb
|
148
|
+
- spec/samples/clean_due_to_masking/clean_three.rb
|
149
|
+
- spec/samples/clean_due_to_masking/clean_two.rb
|
150
|
+
- spec/samples/clean_due_to_masking/dirty_one.rb
|
151
|
+
- spec/samples/clean_due_to_masking/dirty_two.rb
|
152
|
+
- spec/samples/clean_due_to_masking/masked.reek
|
153
|
+
- spec/samples/corrupt_config_file/corrupt.reek
|
154
|
+
- spec/samples/corrupt_config_file/dirty.rb
|
155
|
+
- spec/samples/empty_config_file/dirty.rb
|
156
|
+
- spec/samples/empty_config_file/empty.reek
|
157
|
+
- spec/samples/exceptions.reek
|
158
|
+
- spec/samples/inline.rb
|
159
|
+
- spec/samples/masked/dirty.rb
|
160
|
+
- spec/samples/masked/masked.reek
|
161
|
+
- spec/samples/mixed_results/clean_one.rb
|
162
|
+
- spec/samples/mixed_results/clean_three.rb
|
163
|
+
- spec/samples/mixed_results/clean_two.rb
|
164
|
+
- spec/samples/mixed_results/dirty_one.rb
|
165
|
+
- spec/samples/mixed_results/dirty_two.rb
|
166
|
+
- spec/samples/not_quite_masked/dirty.rb
|
167
|
+
- spec/samples/not_quite_masked/masked.reek
|
168
|
+
- spec/samples/optparse.rb
|
169
|
+
- spec/samples/overrides/masked/dirty.rb
|
170
|
+
- spec/samples/overrides/masked/lower.reek
|
171
|
+
- spec/samples/overrides/upper.reek
|
172
|
+
- spec/samples/redcloth.rb
|
173
|
+
- spec/samples/three_clean_files/clean_one.rb
|
174
|
+
- spec/samples/three_clean_files/clean_three.rb
|
175
|
+
- spec/samples/three_clean_files/clean_two.rb
|
176
|
+
- spec/samples/two_smelly_files/dirty_one.rb
|
177
|
+
- spec/samples/two_smelly_files/dirty_two.rb
|
128
178
|
- spec/spec.opts
|
129
179
|
- spec/spec_helper.rb
|
130
180
|
- tasks/reek.rake
|
131
|
-
- tasks/
|
181
|
+
- tasks/test.rake
|
132
182
|
has_rdoc: true
|
133
183
|
homepage: http://wiki.github.com/kevinrutherford/reek
|
134
184
|
licenses: []
|
@@ -157,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
207
|
requirements: []
|
158
208
|
|
159
209
|
rubyforge_project: reek
|
160
|
-
rubygems_version: 1.3.
|
210
|
+
rubygems_version: 1.3.5
|
161
211
|
signing_key:
|
162
212
|
specification_version: 3
|
163
213
|
summary: Code smell detector for Ruby
|