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.
Files changed (76) hide show
  1. data/History.txt +17 -0
  2. data/README.md +32 -48
  3. data/config/defaults.reek +7 -1
  4. data/features/api.feature +20 -0
  5. data/features/masking_smells.feature +41 -0
  6. data/features/options.feature +4 -0
  7. data/features/rake_task.feature +14 -0
  8. data/features/yaml.feature +8 -8
  9. data/lib/reek.rb +1 -1
  10. data/lib/reek/cli/command_line.rb +9 -2
  11. data/lib/reek/cli/reek_command.rb +5 -4
  12. data/lib/reek/cli/yaml_command.rb +2 -2
  13. data/lib/reek/core/code_context.rb +10 -1
  14. data/lib/reek/core/method_context.rb +2 -2
  15. data/lib/reek/core/sniffer.rb +3 -1
  16. data/lib/reek/core/stop_context.rb +4 -0
  17. data/lib/reek/examiner.rb +2 -2
  18. data/lib/reek/rake/task.rb +16 -0
  19. data/lib/reek/smell_warning.rb +3 -2
  20. data/lib/reek/smells/attribute.rb +13 -9
  21. data/lib/reek/smells/boolean_parameter.rb +14 -9
  22. data/lib/reek/smells/class_variable.rb +16 -5
  23. data/lib/reek/smells/control_couple.rb +11 -6
  24. data/lib/reek/smells/data_clump.rb +33 -30
  25. data/lib/reek/smells/duplication.rb +39 -8
  26. data/lib/reek/smells/feature_envy.rb +7 -8
  27. data/lib/reek/smells/irresponsible_module.rb +12 -3
  28. data/lib/reek/smells/large_class.rb +31 -15
  29. data/lib/reek/smells/long_method.rb +15 -5
  30. data/lib/reek/smells/long_parameter_list.rb +14 -7
  31. data/lib/reek/smells/long_yield_list.rb +12 -9
  32. data/lib/reek/smells/nested_iterators.rb +46 -11
  33. data/lib/reek/smells/simulated_polymorphism.rb +16 -8
  34. data/lib/reek/smells/smell_detector.rb +13 -13
  35. data/lib/reek/smells/uncommunicative_method_name.rb +12 -20
  36. data/lib/reek/smells/uncommunicative_module_name.rb +17 -19
  37. data/lib/reek/smells/uncommunicative_parameter_name.rb +22 -15
  38. data/lib/reek/smells/uncommunicative_variable_name.rb +24 -18
  39. data/lib/reek/smells/utility_function.rb +6 -6
  40. data/lib/reek/source/code_comment.rb +19 -1
  41. data/lib/reek/source/tree_dresser.rb +40 -22
  42. data/reek.gemspec +6 -4
  43. data/spec/matchers/smell_of_matcher.rb +58 -0
  44. data/spec/reek/core/code_context_spec.rb +4 -2
  45. data/spec/reek/core/code_parser_spec.rb +2 -1
  46. data/spec/reek/core/method_context_spec.rb +5 -5
  47. data/spec/reek/smells/attribute_spec.rb +2 -4
  48. data/spec/reek/smells/boolean_parameter_spec.rb +32 -42
  49. data/spec/reek/smells/class_variable_spec.rb +22 -6
  50. data/spec/reek/smells/control_couple_spec.rb +15 -14
  51. data/spec/reek/smells/data_clump_spec.rb +29 -111
  52. data/spec/reek/smells/duplication_spec.rb +79 -49
  53. data/spec/reek/smells/feature_envy_spec.rb +1 -2
  54. data/spec/reek/smells/irresponsible_module_spec.rb +43 -22
  55. data/spec/reek/smells/large_class_spec.rb +34 -59
  56. data/spec/reek/smells/long_method_spec.rb +15 -10
  57. data/spec/reek/smells/long_parameter_list_spec.rb +24 -24
  58. data/spec/reek/smells/long_yield_list_spec.rb +13 -14
  59. data/spec/reek/smells/nested_iterators_spec.rb +93 -76
  60. data/spec/reek/smells/smell_detector_shared.rb +4 -2
  61. data/spec/reek/smells/uncommunicative_method_name_spec.rb +10 -27
  62. data/spec/reek/smells/uncommunicative_module_name_spec.rb +22 -23
  63. data/spec/reek/smells/uncommunicative_parameter_name_spec.rb +36 -26
  64. data/spec/reek/smells/uncommunicative_variable_name_spec.rb +45 -48
  65. data/spec/reek/smells/utility_function_spec.rb +14 -13
  66. data/spec/reek/source/code_comment_spec.rb +61 -3
  67. data/spec/reek/source/tree_dresser_spec.rb +96 -1
  68. data/spec/samples/config/allow_duplication.reek +3 -0
  69. data/spec/samples/config/deeper_nested_iterators.reek +3 -0
  70. data/spec/samples/demo/demo.rb +8 -0
  71. data/spec/samples/inline_config/dirty.rb +16 -0
  72. data/spec/samples/inline_config/masked.reek +7 -0
  73. data/spec/samples/mask_some/dirty.rb +8 -0
  74. data/spec/samples/mask_some/some.reek +8 -0
  75. data/spec/spec_helper.rb +2 -0
  76. 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
@@ -0,0 +1,7 @@
1
+ ---
2
+ IrresponsibleModule:
3
+ enabled: false
4
+ UncommunicativeVariableName:
5
+ enabled: false
6
+ UncommunicativeMethodName:
7
+ enabled: false
@@ -0,0 +1,8 @@
1
+ # smelly class for testing purposes
2
+ class Dirty
3
+ def a
4
+ puts @s.title
5
+ @s = fred.map {|x| x.each {|key| key += 3}}
6
+ puts @s.title
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ ---
2
+ Duplication:
3
+ allow_calls:
4
+ - puts\(@s.title\)
5
+ UncommunicativeVariableName:
6
+ enabled: false
7
+ UncommunicativeMethodName:
8
+ enabled: false
@@ -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
- - 7
9
- - 3
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-03-29 00:00:00 +01:00
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
- For more information on reek, see http://wiki.github.com/kevinrutherford/reek
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