reek 1.2.7.3 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +17 -0
- data/README.md +32 -48
- data/config/defaults.reek +7 -1
- data/features/api.feature +20 -0
- data/features/masking_smells.feature +41 -0
- data/features/options.feature +4 -0
- data/features/rake_task.feature +14 -0
- data/features/yaml.feature +8 -8
- data/lib/reek.rb +1 -1
- data/lib/reek/cli/command_line.rb +9 -2
- data/lib/reek/cli/reek_command.rb +5 -4
- data/lib/reek/cli/yaml_command.rb +2 -2
- data/lib/reek/core/code_context.rb +10 -1
- data/lib/reek/core/method_context.rb +2 -2
- data/lib/reek/core/sniffer.rb +3 -1
- data/lib/reek/core/stop_context.rb +4 -0
- data/lib/reek/examiner.rb +2 -2
- data/lib/reek/rake/task.rb +16 -0
- data/lib/reek/smell_warning.rb +3 -2
- data/lib/reek/smells/attribute.rb +13 -9
- data/lib/reek/smells/boolean_parameter.rb +14 -9
- data/lib/reek/smells/class_variable.rb +16 -5
- data/lib/reek/smells/control_couple.rb +11 -6
- data/lib/reek/smells/data_clump.rb +33 -30
- data/lib/reek/smells/duplication.rb +39 -8
- data/lib/reek/smells/feature_envy.rb +7 -8
- data/lib/reek/smells/irresponsible_module.rb +12 -3
- data/lib/reek/smells/large_class.rb +31 -15
- data/lib/reek/smells/long_method.rb +15 -5
- data/lib/reek/smells/long_parameter_list.rb +14 -7
- data/lib/reek/smells/long_yield_list.rb +12 -9
- data/lib/reek/smells/nested_iterators.rb +46 -11
- data/lib/reek/smells/simulated_polymorphism.rb +16 -8
- data/lib/reek/smells/smell_detector.rb +13 -13
- data/lib/reek/smells/uncommunicative_method_name.rb +12 -20
- data/lib/reek/smells/uncommunicative_module_name.rb +17 -19
- data/lib/reek/smells/uncommunicative_parameter_name.rb +22 -15
- data/lib/reek/smells/uncommunicative_variable_name.rb +24 -18
- data/lib/reek/smells/utility_function.rb +6 -6
- data/lib/reek/source/code_comment.rb +19 -1
- data/lib/reek/source/tree_dresser.rb +40 -22
- data/reek.gemspec +6 -4
- data/spec/matchers/smell_of_matcher.rb +58 -0
- data/spec/reek/core/code_context_spec.rb +4 -2
- data/spec/reek/core/code_parser_spec.rb +2 -1
- data/spec/reek/core/method_context_spec.rb +5 -5
- data/spec/reek/smells/attribute_spec.rb +2 -4
- data/spec/reek/smells/boolean_parameter_spec.rb +32 -42
- data/spec/reek/smells/class_variable_spec.rb +22 -6
- data/spec/reek/smells/control_couple_spec.rb +15 -14
- data/spec/reek/smells/data_clump_spec.rb +29 -111
- data/spec/reek/smells/duplication_spec.rb +79 -49
- data/spec/reek/smells/feature_envy_spec.rb +1 -2
- data/spec/reek/smells/irresponsible_module_spec.rb +43 -22
- data/spec/reek/smells/large_class_spec.rb +34 -59
- data/spec/reek/smells/long_method_spec.rb +15 -10
- data/spec/reek/smells/long_parameter_list_spec.rb +24 -24
- data/spec/reek/smells/long_yield_list_spec.rb +13 -14
- data/spec/reek/smells/nested_iterators_spec.rb +93 -76
- data/spec/reek/smells/smell_detector_shared.rb +4 -2
- data/spec/reek/smells/uncommunicative_method_name_spec.rb +10 -27
- data/spec/reek/smells/uncommunicative_module_name_spec.rb +22 -23
- data/spec/reek/smells/uncommunicative_parameter_name_spec.rb +36 -26
- data/spec/reek/smells/uncommunicative_variable_name_spec.rb +45 -48
- data/spec/reek/smells/utility_function_spec.rb +14 -13
- data/spec/reek/source/code_comment_spec.rb +61 -3
- data/spec/reek/source/tree_dresser_spec.rb +96 -1
- data/spec/samples/config/allow_duplication.reek +3 -0
- data/spec/samples/config/deeper_nested_iterators.reek +3 -0
- data/spec/samples/demo/demo.rb +8 -0
- data/spec/samples/inline_config/dirty.rb +16 -0
- data/spec/samples/inline_config/masked.reek +7 -0
- data/spec/samples/mask_some/dirty.rb +8 -0
- data/spec/samples/mask_some/some.reek +8 -0
- data/spec/spec_helper.rb +2 -0
- metadata +15 -5
@@ -0,0 +1,16 @@
|
|
1
|
+
# :reek:Duplication: { allow_calls: [ puts ] }
|
2
|
+
# smells of :reek:NestedIterators but ignores them
|
3
|
+
class Dirty
|
4
|
+
def a
|
5
|
+
puts @s.title
|
6
|
+
@s = fred.map {|x| x.each {|key| key += 3}}
|
7
|
+
puts @s.title
|
8
|
+
end
|
9
|
+
|
10
|
+
# :reek:Duplication: { max_calls: 2 }
|
11
|
+
def b
|
12
|
+
puts @s.title
|
13
|
+
@s = fred.map {|x| x.each {|key| key += 3}}
|
14
|
+
puts @s.title
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -12,6 +12,8 @@ require 'spec/autorun'
|
|
12
12
|
require File.join((File.dirname(File.dirname(File.expand_path(__FILE__)))), 'lib', 'reek', 'spec')
|
13
13
|
require File.join((File.dirname(File.dirname(File.expand_path(__FILE__)))), 'lib', 'reek', 'source', 'tree_dresser')
|
14
14
|
|
15
|
+
require File.join(File.dirname(File.expand_path(__FILE__)), 'matchers', 'smell_of_matcher')
|
16
|
+
|
15
17
|
SAMPLES_DIR = 'spec/samples' unless Object.const_defined?('SAMPLES_DIR')
|
16
18
|
|
17
19
|
def ast(*args)
|
metadata
CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 1.2.7.3
|
8
|
+
- 8
|
9
|
+
version: 1.2.8
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Kevin Rutherford
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-04-26 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -78,6 +77,7 @@ files:
|
|
78
77
|
- Rakefile
|
79
78
|
- bin/reek
|
80
79
|
- config/defaults.reek
|
80
|
+
- features/api.feature
|
81
81
|
- features/masking_smells.feature
|
82
82
|
- features/options.feature
|
83
83
|
- features/rake_task.feature
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/reek/spec/should_reek_of.rb
|
145
145
|
- lib/reek/spec/should_reek_only_of.rb
|
146
146
|
- reek.gemspec
|
147
|
+
- spec/matchers/smell_of_matcher.rb
|
147
148
|
- spec/reek/cli/help_command_spec.rb
|
148
149
|
- spec/reek/cli/reek_command_spec.rb
|
149
150
|
- spec/reek/cli/report_spec.rb
|
@@ -199,12 +200,19 @@ files:
|
|
199
200
|
- spec/samples/clean_due_to_masking/dirty_one.rb
|
200
201
|
- spec/samples/clean_due_to_masking/dirty_two.rb
|
201
202
|
- spec/samples/clean_due_to_masking/masked.reek
|
203
|
+
- spec/samples/config/allow_duplication.reek
|
204
|
+
- spec/samples/config/deeper_nested_iterators.reek
|
202
205
|
- spec/samples/corrupt_config_file/corrupt.reek
|
203
206
|
- spec/samples/corrupt_config_file/dirty.rb
|
207
|
+
- spec/samples/demo/demo.rb
|
204
208
|
- spec/samples/empty_config_file/dirty.rb
|
205
209
|
- spec/samples/empty_config_file/empty.reek
|
206
210
|
- spec/samples/exceptions.reek
|
211
|
+
- spec/samples/inline_config/dirty.rb
|
212
|
+
- spec/samples/inline_config/masked.reek
|
207
213
|
- spec/samples/inline.rb
|
214
|
+
- spec/samples/mask_some/dirty.rb
|
215
|
+
- spec/samples/mask_some/some.reek
|
208
216
|
- spec/samples/masked/dirty.rb
|
209
217
|
- spec/samples/masked/masked.reek
|
210
218
|
- spec/samples/mixed_results/clean_one.rb
|
@@ -234,7 +242,9 @@ licenses: []
|
|
234
242
|
|
235
243
|
post_install_message: |
|
236
244
|
|
237
|
-
|
245
|
+
Thank you for downloading Reek. For info:
|
246
|
+
- see the reek wiki http://wiki.github.com/kevinrutherford/reek
|
247
|
+
- follow @rubyreek on twitter
|
238
248
|
|
239
249
|
rdoc_options:
|
240
250
|
- --main
|