reek 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. data/.yardopts +10 -0
  2. data/History.txt +62 -0
  3. data/README.md +74 -0
  4. data/bin/reek +2 -2
  5. data/config/defaults.reek +44 -5
  6. data/features/api.feature +20 -0
  7. data/features/masking_smells.feature +60 -42
  8. data/features/options.feature +7 -2
  9. data/features/rake_task.feature +29 -22
  10. data/features/reports.feature +9 -41
  11. data/features/samples.feature +184 -196
  12. data/features/stdin.feature +5 -8
  13. data/features/step_definitions/reek_steps.rb +8 -4
  14. data/features/support/env.rb +2 -3
  15. data/features/yaml.feature +85 -0
  16. data/lib/reek/cli/application.rb +46 -0
  17. data/lib/reek/cli/command_line.rb +108 -0
  18. data/lib/reek/cli/help_command.rb +18 -0
  19. data/lib/reek/cli/reek_command.rb +37 -0
  20. data/lib/reek/cli/report.rb +58 -0
  21. data/lib/reek/cli/version_command.rb +19 -0
  22. data/lib/reek/cli/yaml_command.rb +32 -0
  23. data/lib/reek/core/code_context.rb +64 -0
  24. data/lib/reek/core/code_parser.rb +166 -0
  25. data/lib/reek/core/method_context.rb +84 -0
  26. data/lib/reek/core/module_context.rb +20 -0
  27. data/lib/reek/core/object_refs.rb +51 -0
  28. data/lib/reek/core/singleton_method_context.rb +20 -0
  29. data/lib/reek/core/smell_configuration.rb +62 -0
  30. data/lib/reek/core/sniffer.rb +105 -0
  31. data/lib/reek/core/stop_context.rb +30 -0
  32. data/lib/reek/core/warning_collector.rb +27 -0
  33. data/lib/reek/examiner.rb +104 -0
  34. data/lib/reek/rake/task.rb +142 -0
  35. data/lib/reek/smell_warning.rb +73 -23
  36. data/lib/reek/smells/attribute.rb +26 -21
  37. data/lib/reek/smells/boolean_parameter.rb +38 -0
  38. data/lib/reek/smells/class_variable.rb +22 -9
  39. data/lib/reek/smells/control_couple.rb +40 -16
  40. data/lib/reek/smells/data_clump.rb +114 -23
  41. data/lib/reek/smells/duplication.rb +55 -15
  42. data/lib/reek/smells/feature_envy.rb +16 -7
  43. data/lib/reek/smells/irresponsible_module.rb +37 -0
  44. data/lib/reek/smells/large_class.rb +37 -19
  45. data/lib/reek/smells/long_method.rb +20 -9
  46. data/lib/reek/smells/long_parameter_list.rb +22 -10
  47. data/lib/reek/smells/long_yield_list.rb +43 -7
  48. data/lib/reek/smells/nested_iterators.rb +68 -8
  49. data/lib/reek/smells/simulated_polymorphism.rb +26 -15
  50. data/lib/reek/smells/smell_detector.rb +29 -51
  51. data/lib/reek/smells/uncommunicative_method_name.rb +74 -0
  52. data/lib/reek/smells/uncommunicative_module_name.rb +74 -0
  53. data/lib/reek/smells/uncommunicative_parameter_name.rb +79 -0
  54. data/lib/reek/smells/uncommunicative_variable_name.rb +89 -0
  55. data/lib/reek/smells/utility_function.rb +51 -12
  56. data/lib/reek/smells.rb +29 -0
  57. data/lib/reek/source/code_comment.rb +37 -0
  58. data/lib/reek/source/config_file.rb +72 -0
  59. data/lib/reek/source/core_extras.rb +46 -0
  60. data/lib/reek/source/reference_collector.rb +28 -0
  61. data/lib/reek/source/sexp_formatter.rb +17 -0
  62. data/lib/reek/source/source_code.rb +44 -0
  63. data/lib/reek/source/source_file.rb +32 -0
  64. data/lib/reek/source/source_locator.rb +42 -0
  65. data/lib/reek/source/tree_dresser.rb +204 -0
  66. data/lib/reek/source.rb +18 -0
  67. data/lib/reek/spec/should_reek.rb +31 -0
  68. data/lib/reek/spec/should_reek_of.rb +37 -0
  69. data/lib/reek/spec/should_reek_only_of.rb +37 -0
  70. data/lib/reek/spec.rb +51 -0
  71. data/lib/reek.rb +8 -4
  72. data/reek.gemspec +9 -7
  73. data/spec/matchers/smell_of_matcher.rb +58 -0
  74. data/spec/reek/{help_command_spec.rb → cli/help_command_spec.rb} +3 -4
  75. data/spec/reek/cli/reek_command_spec.rb +46 -0
  76. data/spec/reek/cli/report_spec.rb +30 -0
  77. data/spec/reek/{version_command_spec.rb → cli/version_command_spec.rb} +3 -3
  78. data/spec/reek/cli/yaml_command_spec.rb +47 -0
  79. data/spec/reek/core/code_context_spec.rb +145 -0
  80. data/spec/reek/{code_parser_spec.rb → core/code_parser_spec.rb} +7 -6
  81. data/spec/reek/{config_spec.rb → core/config_spec.rb} +2 -6
  82. data/spec/reek/{method_context_spec.rb → core/method_context_spec.rb} +16 -36
  83. data/spec/reek/core/module_context_spec.rb +27 -0
  84. data/spec/reek/{object_refs_spec.rb → core/object_refs_spec.rb} +5 -6
  85. data/spec/reek/core/singleton_method_context_spec.rb +9 -0
  86. data/spec/reek/core/smell_configuration_spec.rb +11 -0
  87. data/spec/reek/core/stop_context_spec.rb +17 -0
  88. data/spec/reek/core/warning_collector_spec.rb +27 -0
  89. data/spec/reek/examiner_spec.rb +103 -0
  90. data/spec/reek/smell_warning_spec.rb +74 -82
  91. data/spec/reek/smells/attribute_spec.rb +42 -23
  92. data/spec/reek/smells/behaves_like_variable_detector.rb +2 -2
  93. data/spec/reek/smells/boolean_parameter_spec.rb +66 -0
  94. data/spec/reek/smells/class_variable_spec.rb +60 -75
  95. data/spec/reek/smells/control_couple_spec.rb +37 -32
  96. data/spec/reek/smells/data_clump_spec.rb +63 -24
  97. data/spec/reek/smells/duplication_spec.rb +106 -57
  98. data/spec/reek/smells/feature_envy_spec.rb +113 -92
  99. data/spec/reek/smells/irresponsible_module_spec.rb +58 -0
  100. data/spec/reek/smells/large_class_spec.rb +67 -57
  101. data/spec/reek/smells/long_method_spec.rb +40 -10
  102. data/spec/reek/smells/long_parameter_list_spec.rb +50 -28
  103. data/spec/reek/smells/long_yield_list_spec.rb +57 -0
  104. data/spec/reek/smells/nested_iterators_spec.rb +115 -7
  105. data/spec/reek/smells/simulated_polymorphism_spec.rb +56 -20
  106. data/spec/reek/smells/smell_detector_shared.rb +42 -0
  107. data/spec/reek/smells/uncommunicative_method_name_spec.rb +42 -0
  108. data/spec/reek/smells/uncommunicative_module_name_spec.rb +66 -0
  109. data/spec/reek/smells/uncommunicative_parameter_name_spec.rb +71 -0
  110. data/spec/reek/smells/uncommunicative_variable_name_spec.rb +120 -0
  111. data/spec/reek/smells/utility_function_spec.rb +50 -4
  112. data/spec/reek/source/code_comment_spec.rb +82 -0
  113. data/spec/reek/source/object_source_spec.rb +20 -0
  114. data/spec/reek/source/reference_collector_spec.rb +53 -0
  115. data/spec/reek/{adapters/source_spec.rb → source/source_code_spec.rb} +7 -8
  116. data/spec/reek/source/tree_dresser_spec.rb +270 -0
  117. data/spec/reek/spec/should_reek_of_spec.rb +76 -0
  118. data/spec/reek/spec/should_reek_only_of_spec.rb +89 -0
  119. data/spec/reek/{adapters → spec}/should_reek_spec.rb +8 -32
  120. data/spec/samples/all_but_one_masked/clean_one.rb +1 -0
  121. data/spec/samples/all_but_one_masked/dirty.rb +1 -0
  122. data/spec/samples/all_but_one_masked/masked.reek +5 -1
  123. data/spec/samples/clean_due_to_masking/clean_one.rb +1 -0
  124. data/spec/samples/clean_due_to_masking/clean_three.rb +1 -0
  125. data/spec/samples/clean_due_to_masking/clean_two.rb +1 -0
  126. data/spec/samples/clean_due_to_masking/dirty_one.rb +1 -1
  127. data/spec/samples/clean_due_to_masking/dirty_two.rb +1 -1
  128. data/spec/samples/clean_due_to_masking/masked.reek +5 -1
  129. data/spec/samples/config/allow_duplication.reek +3 -0
  130. data/spec/samples/config/deeper_nested_iterators.reek +3 -0
  131. data/spec/samples/corrupt_config_file/dirty.rb +1 -1
  132. data/spec/samples/demo/demo.rb +8 -0
  133. data/spec/samples/empty_config_file/dirty.rb +2 -1
  134. data/spec/samples/exceptions.reek +1 -1
  135. data/spec/samples/inline_config/dirty.rb +16 -0
  136. data/spec/samples/inline_config/masked.reek +7 -0
  137. data/spec/samples/mask_some/dirty.rb +8 -0
  138. data/spec/samples/mask_some/some.reek +8 -0
  139. data/spec/samples/masked/dirty.rb +2 -1
  140. data/spec/samples/masked/masked.reek +3 -1
  141. data/spec/samples/mixed_results/clean_one.rb +1 -0
  142. data/spec/samples/mixed_results/clean_three.rb +1 -0
  143. data/spec/samples/mixed_results/clean_two.rb +1 -0
  144. data/spec/samples/mixed_results/dirty_one.rb +1 -0
  145. data/spec/samples/mixed_results/dirty_two.rb +1 -0
  146. data/spec/samples/not_quite_masked/dirty.rb +2 -1
  147. data/spec/samples/not_quite_masked/masked.reek +1 -1
  148. data/spec/samples/overrides/masked/dirty.rb +2 -1
  149. data/spec/samples/overrides/masked/lower.reek +3 -1
  150. data/spec/samples/three_clean_files/clean_one.rb +1 -0
  151. data/spec/samples/three_clean_files/clean_three.rb +1 -0
  152. data/spec/samples/three_clean_files/clean_two.rb +1 -0
  153. data/spec/samples/two_smelly_files/dirty_one.rb +2 -1
  154. data/spec/samples/two_smelly_files/dirty_two.rb +2 -1
  155. data/spec/spec_helper.rb +10 -2
  156. data/tasks/reek.rake +2 -2
  157. data/tasks/test.rake +12 -3
  158. metadata +121 -79
  159. data/README.rdoc +0 -84
  160. data/features/profile.feature +0 -34
  161. data/lib/reek/adapters/application.rb +0 -46
  162. data/lib/reek/adapters/command_line.rb +0 -77
  163. data/lib/reek/adapters/config_file.rb +0 -31
  164. data/lib/reek/adapters/core_extras.rb +0 -64
  165. data/lib/reek/adapters/rake_task.rb +0 -121
  166. data/lib/reek/adapters/report.rb +0 -86
  167. data/lib/reek/adapters/source.rb +0 -72
  168. data/lib/reek/adapters/spec.rb +0 -133
  169. data/lib/reek/block_context.rb +0 -62
  170. data/lib/reek/class_context.rb +0 -41
  171. data/lib/reek/code_context.rb +0 -68
  172. data/lib/reek/code_parser.rb +0 -203
  173. data/lib/reek/configuration.rb +0 -57
  174. data/lib/reek/detector_stack.rb +0 -37
  175. data/lib/reek/help_command.rb +0 -14
  176. data/lib/reek/if_context.rb +0 -18
  177. data/lib/reek/masking_collection.rb +0 -33
  178. data/lib/reek/method_context.rb +0 -138
  179. data/lib/reek/module_context.rb +0 -49
  180. data/lib/reek/name.rb +0 -57
  181. data/lib/reek/object_refs.rb +0 -49
  182. data/lib/reek/reek_command.rb +0 -28
  183. data/lib/reek/sexp_formatter.rb +0 -10
  184. data/lib/reek/singleton_method_context.rb +0 -26
  185. data/lib/reek/smells/uncommunicative_name.rb +0 -84
  186. data/lib/reek/sniffer.rb +0 -177
  187. data/lib/reek/stop_context.rb +0 -35
  188. data/lib/reek/tree_dresser.rb +0 -82
  189. data/lib/reek/version_command.rb +0 -14
  190. data/lib/reek/yield_call_context.rb +0 -12
  191. data/spec/reek/adapters/report_spec.rb +0 -31
  192. data/spec/reek/adapters/should_reek_of_spec.rb +0 -138
  193. data/spec/reek/adapters/should_reek_only_of_spec.rb +0 -87
  194. data/spec/reek/block_context_spec.rb +0 -65
  195. data/spec/reek/class_context_spec.rb +0 -161
  196. data/spec/reek/code_context_spec.rb +0 -182
  197. data/spec/reek/configuration_spec.rb +0 -12
  198. data/spec/reek/if_context_spec.rb +0 -17
  199. data/spec/reek/masking_collection_spec.rb +0 -236
  200. data/spec/reek/module_context_spec.rb +0 -46
  201. data/spec/reek/name_spec.rb +0 -37
  202. data/spec/reek/object_source_spec.rb +0 -23
  203. data/spec/reek/reek_command_spec.rb +0 -45
  204. data/spec/reek/singleton_method_context_spec.rb +0 -16
  205. data/spec/reek/smells/smell_detector_spec.rb +0 -36
  206. data/spec/reek/smells/uncommunicative_name_spec.rb +0 -146
  207. data/spec/reek/sniffer_spec.rb +0 -11
  208. data/spec/reek/stop_context_spec.rb +0 -33
  209. data/spec/reek/tree_dresser_spec.rb +0 -20
@@ -10,17 +10,18 @@ Feature: Basic smell detection
10
10
  Then the exit status indicates smells
11
11
  And it reports:
12
12
  """
13
- spec/samples/inline.rb -- 39 warnings (+1 masked):
14
- Inline declares the class variable @@directory (Class Variable)
15
- Inline declares the class variable @@rootdir (Class Variable)
13
+ spec/samples/inline.rb -- 41 warnings:
14
+ File has no descriptive comment (IrresponsibleModule)
15
+ Inline declares the class variable @@directory (ClassVariable)
16
+ Inline declares the class variable @@rootdir (ClassVariable)
16
17
  Inline#self.rootdir calls env.nil? twice (Duplication)
17
- Inline#self.rootdir has approx 8 statements (Long Method)
18
- Inline::C declares the class variable @@type_map (Class Variable)
19
- Inline::C has at least 13 instance variables (Large Class)
20
- Inline::C takes parameters [options, src] to 5 methods (Data Clump)
21
- Inline::C tests $DEBUG at least 7 times (Simulated Polymorphism)
22
- Inline::C tests $TESTING at least 4 times (Simulated Polymorphism)
23
- Inline::C tests @@type_map.has_key?(type) at least 3 times (Simulated Polymorphism)
18
+ Inline#self.rootdir has approx 8 statements (LongMethod)
19
+ Inline::C declares the class variable @@type_map (ClassVariable)
20
+ Inline::C has at least 13 instance variables (LargeClass)
21
+ Inline::C takes parameters [options, src] to 5 methods (DataClump)
22
+ Inline::C tests $DEBUG at least 7 times (SimulatedPolymorphism)
23
+ Inline::C tests $TESTING at least 4 times (SimulatedPolymorphism)
24
+ Inline::C tests @@type_map.has_key?(type) at least 3 times (SimulatedPolymorphism)
24
25
  Inline::C#build calls ($? == 0) twice (Duplication)
25
26
  Inline::C#build calls Inline.directory 5 times (Duplication)
26
27
  Inline::C#build calls io.puts 6 times (Duplication)
@@ -28,28 +29,29 @@ Feature: Basic smell detection
28
29
  Inline::C#build calls io.puts("#ifdef __cplusplus") twice (Duplication)
29
30
  Inline::C#build calls module_name twice (Duplication)
30
31
  Inline::C#build calls warn("Output:\n#{result}") twice (Duplication)
31
- Inline::C#build has approx 60 statements (Long Method)
32
- Inline::C#build has the variable name 't' (Uncommunicative Name)
33
- Inline::C#build/block/block has the variable name 'n' (Uncommunicative Name)
34
- Inline::C#build/block/block is nested (Nested Iterators)
35
- Inline::C#c has the name 'c' (Uncommunicative Name)
32
+ Inline::C#build contains iterators nested 2 deep (NestedIterators)
33
+ Inline::C#build has approx 60 statements (LongMethod)
34
+ Inline::C#build has the variable name 'n' (UncommunicativeName)
35
+ Inline::C#build has the variable name 't' (UncommunicativeName)
36
+ Inline::C#c has the name 'c' (UncommunicativeName)
36
37
  Inline::C#crap_for_windoze calls Config::CONFIG["libdir"] twice (Duplication)
37
38
  Inline::C#generate calls result.sub!(/\A\n/, "") twice (Duplication)
38
39
  Inline::C#generate calls signature["args"] twice (Duplication)
39
40
  Inline::C#generate calls signature["args"].map twice (Duplication)
40
- Inline::C#generate has approx 32 statements (Long Method)
41
+ Inline::C#generate has approx 32 statements (LongMethod)
41
42
  Inline::C#initialize calls stack.empty? twice (Duplication)
42
43
  Inline::C#load calls so_name twice (Duplication)
43
- Inline::C#module_name/block has the variable name 'm' (Uncommunicative Name)
44
- Inline::C#module_name/block has the variable name 'x' (Uncommunicative Name)
45
- Inline::C#parse_signature has approx 15 statements (Long Method)
46
- Inline::C#parse_signature is controlled by argument raw (Control Couple)
47
- Inline::C#parse_signature/block has the variable name 'x' (Uncommunicative Name)
48
- Inline::C#strip_comments doesn't depend on instance state (Utility Function)
49
- Inline::C#strip_comments refers to src more than self (Feature Envy)
44
+ Inline::C#module_name has the variable name 'm' (UncommunicativeName)
45
+ Inline::C#module_name has the variable name 'x' (UncommunicativeName)
46
+ Inline::C#parse_signature has approx 15 statements (LongMethod)
47
+ Inline::C#parse_signature has boolean parameter 'raw' (ControlCouple)
48
+ Inline::C#parse_signature has the variable name 'x' (UncommunicativeName)
49
+ Inline::C#parse_signature is controlled by argument raw (ControlCouple)
50
+ Inline::C#strip_comments doesn't depend on instance state (LowCohesion)
51
+ Inline::C#strip_comments refers to src more than self (LowCohesion)
50
52
  Module#inline calls Inline.const_get(lang) twice (Duplication)
51
- Module#inline has approx 11 statements (Long Method)
52
- Module#inline is controlled by argument options (Control Couple)
53
+ Module#inline has approx 11 statements (LongMethod)
54
+ Module#inline is controlled by argument options (ControlCouple)
53
55
 
54
56
  """
55
57
 
@@ -58,20 +60,24 @@ Feature: Basic smell detection
58
60
  Then the exit status indicates smells
59
61
  And it reports:
60
62
  """
61
- spec/samples/optparse.rb -- 124 warnings:
62
- OptionParser has at least 42 methods (Large Class)
63
- OptionParser tests ((argv.size == 1) and Array.===(argv[0])) at least 3 times (Simulated Polymorphism)
64
- OptionParser tests a at least 7 times (Simulated Polymorphism)
65
- OptionParser tests default_pattern at least 7 times (Simulated Polymorphism)
66
- OptionParser tests not_style at least 3 times (Simulated Polymorphism)
67
- OptionParser tests s at least 7 times (Simulated Polymorphism)
68
- OptionParser#complete has 4 parameters (Long Parameter List)
69
- OptionParser#complete is controlled by argument icase (Control Couple)
70
- OptionParser#complete/block/block is nested (Nested Iterators)
63
+ spec/samples/optparse.rb -- 109 warnings:
64
+ OptionParser has at least 42 methods (LargeClass)
65
+ OptionParser has the variable name 'f' (UncommunicativeName)
66
+ OptionParser has the variable name 'k' (UncommunicativeName)
67
+ OptionParser has the variable name 'o' (UncommunicativeName)
68
+ OptionParser has the variable name 's' (UncommunicativeName)
69
+ OptionParser has the variable name 'v' (UncommunicativeName)
70
+ OptionParser tests ((argv.size == 1) and Array.===(argv[0])) at least 3 times (SimulatedPolymorphism)
71
+ OptionParser tests a at least 7 times (SimulatedPolymorphism)
72
+ OptionParser tests default_pattern at least 7 times (SimulatedPolymorphism)
73
+ OptionParser tests not_style at least 3 times (SimulatedPolymorphism)
74
+ OptionParser tests s at least 7 times (SimulatedPolymorphism)
75
+ OptionParser#complete contains iterators nested 2 deep (NestedIterators)
76
+ OptionParser#complete has 4 parameters (LongParameterList)
77
+ OptionParser#complete has boolean parameter 'icase' (ControlCouple)
71
78
  OptionParser#getopts calls result[opt] = false twice (Duplication)
72
- OptionParser#getopts has approx 17 statements (Long Method)
73
- OptionParser#getopts/block is controlled by argument val (Control Couple)
74
- OptionParser#load/block has the variable name 's' (Uncommunicative Name)
79
+ OptionParser#getopts has approx 17 statements (LongMethod)
80
+ OptionParser#load has the variable name 's' (UncommunicativeName)
75
81
  OptionParser#make_switch calls (long << o = q.downcase) twice (Duplication)
76
82
  OptionParser#make_switch calls (sdesc << "-#{q}") twice (Duplication)
77
83
  OptionParser#make_switch calls default_style.guess(arg = a) 4 times (Duplication)
@@ -83,24 +89,20 @@ Feature: Basic smell detection
83
89
  OptionParser#make_switch calls q.downcase 3 times (Duplication)
84
90
  OptionParser#make_switch calls search(:atype, FalseClass) twice (Duplication)
85
91
  OptionParser#make_switch calls search(:atype, o) 6 times (Duplication)
86
- OptionParser#make_switch has approx 68 statements (Long Method)
87
- OptionParser#make_switch has the variable name 'a' (Uncommunicative Name)
88
- OptionParser#make_switch has the variable name 'n' (Uncommunicative Name)
89
- OptionParser#make_switch has the variable name 'o' (Uncommunicative Name)
90
- OptionParser#make_switch has the variable name 'q' (Uncommunicative Name)
91
- OptionParser#make_switch has the variable name 's' (Uncommunicative Name)
92
- OptionParser#make_switch/block has the variable name 'a' (Uncommunicative Name)
93
- OptionParser#make_switch/block has the variable name 'o' (Uncommunicative Name)
94
- OptionParser#make_switch/block has the variable name 'q' (Uncommunicative Name)
95
- OptionParser#make_switch/block/block has the variable name 'c' (Uncommunicative Name)
96
- OptionParser#make_switch/block/block has the variable name 'o' (Uncommunicative Name)
97
- OptionParser#make_switch/block/block has the variable name 'v' (Uncommunicative Name)
98
- OptionParser#make_switch/block/block is nested (Nested Iterators)
99
- OptionParser#make_switch/block/block/block is nested (Nested Iterators)
92
+ OptionParser#make_switch contains iterators nested 2 deep (NestedIterators)
93
+ OptionParser#make_switch contains iterators nested 3 deep (NestedIterators)
94
+ OptionParser#make_switch has approx 68 statements (LongMethod)
95
+ OptionParser#make_switch has the variable name 'a' (UncommunicativeName)
96
+ OptionParser#make_switch has the variable name 'c' (UncommunicativeName)
97
+ OptionParser#make_switch has the variable name 'n' (UncommunicativeName)
98
+ OptionParser#make_switch has the variable name 'o' (UncommunicativeName)
99
+ OptionParser#make_switch has the variable name 'q' (UncommunicativeName)
100
+ OptionParser#make_switch has the variable name 's' (UncommunicativeName)
101
+ OptionParser#make_switch has the variable name 'v' (UncommunicativeName)
100
102
  OptionParser#order calls argv[0] twice (Duplication)
101
- OptionParser#order refers to argv more than self (Feature Envy)
103
+ OptionParser#order refers to argv more than self (LowCohesion)
102
104
  OptionParser#parse calls argv[0] twice (Duplication)
103
- OptionParser#parse refers to argv more than self (Feature Envy)
105
+ OptionParser#parse refers to argv more than self (LowCohesion)
104
106
  OptionParser#parse_in_order calls $!.set_option(arg, true) twice (Duplication)
105
107
  OptionParser#parse_in_order calls cb.call(val) twice (Duplication)
106
108
  OptionParser#parse_in_order calls raise($!.set_option(arg, true)) twice (Duplication)
@@ -108,61 +110,48 @@ Feature: Basic smell detection
108
110
  OptionParser#parse_in_order calls setter.call(sw.switch_name, val) twice (Duplication)
109
111
  OptionParser#parse_in_order calls sw.block twice (Duplication)
110
112
  OptionParser#parse_in_order calls sw.switch_name twice (Duplication)
111
- OptionParser#parse_in_order has approx 28 statements (Long Method)
112
- OptionParser#parse_in_order/block is controlled by argument setter (Control Couple)
113
- OptionParser#parse_in_order/block/block is nested (Nested Iterators)
114
- OptionParser#parse_in_order/block/block/block is nested (Nested Iterators)
113
+ OptionParser#parse_in_order contains iterators nested 2 deep (NestedIterators)
114
+ OptionParser#parse_in_order contains iterators nested 3 deep (NestedIterators)
115
+ OptionParser#parse_in_order has approx 28 statements (LongMethod)
116
+ OptionParser#parse_in_order is controlled by argument setter (ControlCouple)
115
117
  OptionParser#permute calls argv[0] twice (Duplication)
116
- OptionParser#permute refers to argv more than self (Feature Envy)
117
- OptionParser#search/block has the variable name 'k' (Uncommunicative Name)
118
- OptionParser#summarize has 4 parameters (Long Parameter List)
119
- OptionParser#summarize/block has the variable name 'l' (Uncommunicative Name)
120
- OptionParser#ver has the variable name 'v' (Uncommunicative Name)
121
- OptionParser/block has the variable name 'f' (Uncommunicative Name)
122
- OptionParser/block has the variable name 'k' (Uncommunicative Name)
123
- OptionParser/block has the variable name 'o' (Uncommunicative Name)
124
- OptionParser/block has the variable name 's' (Uncommunicative Name)
125
- OptionParser/block is controlled by argument o (Control Couple)
126
- OptionParser/block is controlled by argument s (Control Couple)
127
- OptionParser/block/block has the variable name 's' (Uncommunicative Name)
128
- OptionParser/block/block has the variable name 'v' (Uncommunicative Name)
129
- OptionParser/block/block is controlled by argument pkg (Control Couple)
130
- OptionParser/block/block is nested (Nested Iterators)
131
- OptionParser::CompletingHash#match/block/block is nested (Nested Iterators)
118
+ OptionParser#permute refers to argv more than self (LowCohesion)
119
+ OptionParser#search has the variable name 'k' (UncommunicativeName)
120
+ OptionParser#summarize has 4 parameters (LongParameterList)
121
+ OptionParser#summarize has the variable name 'l' (UncommunicativeName)
122
+ OptionParser#ver has the variable name 'v' (UncommunicativeName)
123
+ OptionParser::CompletingHash#match contains iterators nested 2 deep (NestedIterators)
132
124
  OptionParser::Completion#complete calls candidates.size twice (Duplication)
133
125
  OptionParser::Completion#complete calls k.id2name twice (Duplication)
134
- OptionParser::Completion#complete has approx 22 statements (Long Method)
135
- OptionParser::Completion#complete has the variable name 'k' (Uncommunicative Name)
136
- OptionParser::Completion#complete has the variable name 'v' (Uncommunicative Name)
137
- OptionParser::Completion#complete is controlled by argument icase (Control Couple)
138
- OptionParser::Completion#complete refers to candidates more than self (Feature Envy)
139
- OptionParser::Completion#complete/block has the variable name 'k' (Uncommunicative Name)
140
- OptionParser::Completion#complete/block has the variable name 'v' (Uncommunicative Name)
141
- OptionParser::List#accept has the variable name 't' (Uncommunicative Name)
142
- OptionParser::List#accept is controlled by argument pat (Control Couple)
143
- OptionParser::List#accept refers to pat more than self (Feature Envy)
144
- OptionParser::List#add_banner refers to opt more than self (Feature Envy)
145
- OptionParser::List#complete has 4 parameters (Long Parameter List)
146
- OptionParser::List#complete is controlled by argument icase (Control Couple)
147
- OptionParser::List#reject has the variable name 't' (Uncommunicative Name)
148
- OptionParser::List#summarize refers to opt more than self (Feature Envy)
149
- OptionParser::List#update has 5 parameters (Long Parameter List)
150
- OptionParser::List#update has approx 6 statements (Long Method)
151
- OptionParser::List#update has the variable name 'o' (Uncommunicative Name)
152
- OptionParser::List#update is controlled by argument lopts (Control Couple)
153
- OptionParser::List#update is controlled by argument sopts (Control Couple)
154
- OptionParser::List#update/block has the variable name 'o' (Uncommunicative Name)
155
- OptionParser::ParseError#set_option is controlled by argument eq (Control Couple)
156
- OptionParser::Switch#add_banner has the variable name 's' (Uncommunicative Name)
126
+ OptionParser::Completion#complete has approx 22 statements (LongMethod)
127
+ OptionParser::Completion#complete has boolean parameter 'icase' (ControlCouple)
128
+ OptionParser::Completion#complete has the variable name 'k' (UncommunicativeName)
129
+ OptionParser::Completion#complete has the variable name 'v' (UncommunicativeName)
130
+ OptionParser::Completion#complete refers to candidates more than self (LowCohesion)
131
+ OptionParser::List#accept has the parameter name 't' (UncommunicativeName)
132
+ OptionParser::List#accept is controlled by argument pat (ControlCouple)
133
+ OptionParser::List#accept refers to pat more than self (LowCohesion)
134
+ OptionParser::List#add_banner refers to opt more than self (LowCohesion)
135
+ OptionParser::List#complete has 4 parameters (LongParameterList)
136
+ OptionParser::List#complete has boolean parameter 'icase' (ControlCouple)
137
+ OptionParser::List#reject has the parameter name 't' (UncommunicativeName)
138
+ OptionParser::List#summarize refers to opt more than self (LowCohesion)
139
+ OptionParser::List#update has 5 parameters (LongParameterList)
140
+ OptionParser::List#update has approx 6 statements (LongMethod)
141
+ OptionParser::List#update has the variable name 'o' (UncommunicativeName)
142
+ OptionParser::List#update is controlled by argument lopts (ControlCouple)
143
+ OptionParser::List#update is controlled by argument sopts (ControlCouple)
144
+ OptionParser::ParseError#set_option is controlled by argument eq (ControlCouple)
145
+ OptionParser::Switch#add_banner has the variable name 's' (UncommunicativeName)
157
146
  OptionParser::Switch#conv_arg calls conv twice (Duplication)
158
- OptionParser::Switch#initialize has 7 parameters (Long Parameter List)
147
+ OptionParser::Switch#initialize has 7 parameters (LongParameterList)
159
148
  OptionParser::Switch#parse_arg calls pattern twice (Duplication)
160
149
  OptionParser::Switch#parse_arg calls s.length twice (Duplication)
161
- OptionParser::Switch#parse_arg has approx 11 statements (Long Method)
162
- OptionParser::Switch#parse_arg has the variable name 'm' (Uncommunicative Name)
163
- OptionParser::Switch#parse_arg has the variable name 's' (Uncommunicative Name)
164
- OptionParser::Switch#self.guess has the variable name 't' (Uncommunicative Name)
165
- OptionParser::Switch#self.incompatible_argument_styles has the variable name 't' (Uncommunicative Name)
150
+ OptionParser::Switch#parse_arg has approx 11 statements (LongMethod)
151
+ OptionParser::Switch#parse_arg has the variable name 'm' (UncommunicativeName)
152
+ OptionParser::Switch#parse_arg has the variable name 's' (UncommunicativeName)
153
+ OptionParser::Switch#self.guess has the variable name 't' (UncommunicativeName)
154
+ OptionParser::Switch#self.incompatible_argument_styles has the parameter name 't' (UncommunicativeName)
166
155
  OptionParser::Switch#summarize calls (indent + l) twice (Duplication)
167
156
  OptionParser::Switch#summarize calls arg 4 times (Duplication)
168
157
  OptionParser::Switch#summarize calls left.collect twice (Duplication)
@@ -171,18 +160,16 @@ Feature: Basic smell detection
171
160
  OptionParser::Switch#summarize calls left.shift twice (Duplication)
172
161
  OptionParser::Switch#summarize calls left[-1] 3 times (Duplication)
173
162
  OptionParser::Switch#summarize calls s.length 3 times (Duplication)
174
- OptionParser::Switch#summarize has 5 parameters (Long Parameter List)
175
- OptionParser::Switch#summarize has approx 25 statements (Long Method)
176
- OptionParser::Switch#summarize has the variable name 'l' (Uncommunicative Name)
177
- OptionParser::Switch#summarize has the variable name 'r' (Uncommunicative Name)
178
- OptionParser::Switch#summarize has the variable name 's' (Uncommunicative Name)
179
- OptionParser::Switch#summarize/block has the variable name 's' (Uncommunicative Name)
180
- OptionParser::Switch#summarize/block/block is nested (Nested Iterators)
181
- OptionParser::Switch::NoArgument#parse is controlled by argument arg (Control Couple)
182
- OptionParser::Switch::OptionalArgument#parse is controlled by argument arg (Control Couple)
183
- OptionParser::Switch::PlacedArgument#parse has approx 6 statements (Long Method)
184
- OptionParser::Switch::RequiredArgument#parse is controlled by argument arg (Control Couple)
185
- block has the variable name 'q' (Uncommunicative Name)
163
+ OptionParser::Switch#summarize contains iterators nested 2 deep (NestedIterators)
164
+ OptionParser::Switch#summarize has 5 parameters (LongParameterList)
165
+ OptionParser::Switch#summarize has approx 25 statements (LongMethod)
166
+ OptionParser::Switch#summarize has the variable name 'l' (UncommunicativeName)
167
+ OptionParser::Switch#summarize has the variable name 'r' (UncommunicativeName)
168
+ OptionParser::Switch#summarize has the variable name 's' (UncommunicativeName)
169
+ OptionParser::Switch::NoArgument#parse is controlled by argument arg (ControlCouple)
170
+ OptionParser::Switch::OptionalArgument#parse is controlled by argument arg (ControlCouple)
171
+ OptionParser::Switch::PlacedArgument#parse has approx 6 statements (LongMethod)
172
+ OptionParser::Switch::RequiredArgument#parse is controlled by argument arg (ControlCouple)
186
173
 
187
174
  """
188
175
 
@@ -191,84 +178,85 @@ Feature: Basic smell detection
191
178
  Then the exit status indicates smells
192
179
  And it reports:
193
180
  """
194
- spec/samples/redcloth.rb -- 96 warnings:
195
- RedCloth has at least 44 methods (Large Class)
196
- RedCloth takes parameters [atts, cite, content, tag] to 3 methods (Data Clump)
197
- RedCloth tests atts at least 6 times (Simulated Polymorphism)
198
- RedCloth tests codepre.zero? at least 3 times (Simulated Polymorphism)
199
- RedCloth tests href at least 3 times (Simulated Polymorphism)
200
- RedCloth tests title at least 4 times (Simulated Polymorphism)
201
- RedCloth#block_markdown_atx refers to text more than self (Feature Envy)
202
- RedCloth#block_markdown_bq has approx 6 statements (Long Method)
203
- RedCloth#block_markdown_rule refers to text more than self (Feature Envy)
204
- RedCloth#block_markdown_setext refers to text more than self (Feature Envy)
181
+ spec/samples/redcloth.rb -- 97 warnings:
182
+ RedCloth has at least 44 methods (LargeClass)
183
+ RedCloth has the variable name 'a' (UncommunicativeName)
184
+ RedCloth has the variable name 'b' (UncommunicativeName)
185
+ RedCloth takes parameters [atts, cite, content, tag] to 3 methods (DataClump)
186
+ RedCloth tests atts at least 6 times (SimulatedPolymorphism)
187
+ RedCloth tests codepre.zero? at least 3 times (SimulatedPolymorphism)
188
+ RedCloth tests href at least 3 times (SimulatedPolymorphism)
189
+ RedCloth tests title at least 4 times (SimulatedPolymorphism)
190
+ RedCloth#block_markdown_atx refers to text more than self (LowCohesion)
191
+ RedCloth#block_markdown_bq has approx 6 statements (LongMethod)
192
+ RedCloth#block_markdown_rule refers to text more than self (LowCohesion)
193
+ RedCloth#block_markdown_setext refers to text more than self (LowCohesion)
205
194
  RedCloth#block_textile_lists calls (line_id - 1) twice (Duplication)
206
195
  RedCloth#block_textile_lists calls depth.last 5 times (Duplication)
207
196
  RedCloth#block_textile_lists calls depth.last.length twice (Duplication)
208
197
  RedCloth#block_textile_lists calls depth[i] twice (Duplication)
209
198
  RedCloth#block_textile_lists calls lines[(line_id - 1)] twice (Duplication)
210
199
  RedCloth#block_textile_lists calls tl.length 3 times (Duplication)
211
- RedCloth#block_textile_lists has approx 20 statements (Long Method)
212
- RedCloth#block_textile_lists refers to depth more than self (Feature Envy)
213
- RedCloth#block_textile_lists/block/block is nested (Nested Iterators)
214
- RedCloth#block_textile_lists/block/block/block has the variable name 'i' (Uncommunicative Name)
215
- RedCloth#block_textile_lists/block/block/block has the variable name 'v' (Uncommunicative Name)
216
- RedCloth#block_textile_lists/block/block/block is nested (Nested Iterators)
217
- RedCloth#block_textile_table has approx 18 statements (Long Method)
218
- RedCloth#block_textile_table/block/block has the variable name 'x' (Uncommunicative Name)
219
- RedCloth#block_textile_table/block/block is nested (Nested Iterators)
220
- RedCloth#block_textile_table/block/block/block is nested (Nested Iterators)
221
- RedCloth#blocks has approx 18 statements (Long Method)
222
- RedCloth#blocks is controlled by argument deep_code (Control Couple)
223
- RedCloth#blocks/block is controlled by argument deep_code (Control Couple)
224
- RedCloth#blocks/block/block is nested (Nested Iterators)
225
- RedCloth#check_refs is controlled by argument text (Control Couple)
200
+ RedCloth#block_textile_lists contains iterators nested 3 deep (NestedIterators)
201
+ RedCloth#block_textile_lists has approx 20 statements (LongMethod)
202
+ RedCloth#block_textile_lists has the variable name 'i' (UncommunicativeName)
203
+ RedCloth#block_textile_lists has the variable name 'v' (UncommunicativeName)
204
+ RedCloth#block_textile_lists refers to depth more than self (LowCohesion)
205
+ RedCloth#block_textile_table contains iterators nested 2 deep (NestedIterators)
206
+ RedCloth#block_textile_table contains iterators nested 3 deep (NestedIterators)
207
+ RedCloth#block_textile_table has approx 18 statements (LongMethod)
208
+ RedCloth#block_textile_table has the variable name 'x' (UncommunicativeName)
209
+ RedCloth#blocks contains iterators nested 2 deep (NestedIterators)
210
+ RedCloth#blocks has approx 18 statements (LongMethod)
211
+ RedCloth#blocks has boolean parameter 'deep_code' (ControlCouple)
212
+ RedCloth#blocks is controlled by argument deep_code (ControlCouple)
213
+ RedCloth#check_refs is controlled by argument text (ControlCouple)
226
214
  RedCloth#clean_html calls tags[tag] twice (Duplication)
227
- RedCloth#clean_html doesn't depend on instance state (Utility Function)
228
- RedCloth#clean_html has approx 14 statements (Long Method)
229
- RedCloth#clean_html refers to raw more than self (Feature Envy)
230
- RedCloth#clean_html refers to tags more than self (Feature Envy)
231
- RedCloth#clean_html/block/block is nested (Nested Iterators)
232
- RedCloth#clean_html/block/block/block has the variable name 'q' (Uncommunicative Name)
233
- RedCloth#clean_html/block/block/block has the variable name 'q2' (Uncommunicative Name)
234
- RedCloth#clean_html/block/block/block is nested (Nested Iterators)
235
- RedCloth#clean_white_space has approx 7 statements (Long Method)
236
- RedCloth#clean_white_space refers to text more than self (Feature Envy)
237
- RedCloth#flush_left doesn't depend on instance state (Utility Function)
238
- RedCloth#flush_left refers to indt more than self (Feature Envy)
239
- RedCloth#flush_left refers to text more than self (Feature Envy)
240
- RedCloth#footnote_ref refers to text more than self (Feature Envy)
241
- RedCloth#glyphs_textile has approx 10 statements (Long Method)
242
- RedCloth#htmlesc doesn't depend on instance state (Utility Function)
243
- RedCloth#htmlesc refers to str more than self (Feature Envy)
244
- RedCloth#incoming_entities refers to text more than self (Feature Envy)
245
- RedCloth#initialize/block has the variable name 'r' (Uncommunicative Name)
246
- RedCloth#inline/block/block is nested (Nested Iterators)
247
- RedCloth#inline_markdown_link has approx 6 statements (Long Method)
248
- RedCloth#inline_markdown_link/block has the variable name 'm' (Uncommunicative Name)
249
- RedCloth#inline_markdown_reflink has approx 8 statements (Long Method)
250
- RedCloth#inline_markdown_reflink/block has the variable name 'm' (Uncommunicative Name)
251
- RedCloth#inline_textile_code/block has the variable name 'm' (Uncommunicative Name)
252
- RedCloth#inline_textile_image has approx 17 statements (Long Method)
253
- RedCloth#inline_textile_image/block has the variable name 'href_a1' (Uncommunicative Name)
254
- RedCloth#inline_textile_image/block has the variable name 'href_a2' (Uncommunicative Name)
255
- RedCloth#inline_textile_image/block has the variable name 'm' (Uncommunicative Name)
256
- RedCloth#inline_textile_link has approx 9 statements (Long Method)
257
- RedCloth#inline_textile_link/block has the variable name 'm' (Uncommunicative Name)
258
- RedCloth#inline_textile_span has approx 8 statements (Long Method)
259
- RedCloth#inline_textile_span/block/block has the variable name 'm' (Uncommunicative Name)
260
- RedCloth#inline_textile_span/block/block is nested (Nested Iterators)
261
- RedCloth#no_textile doesn't depend on instance state (Utility Function)
262
- RedCloth#no_textile refers to text more than self (Feature Envy)
215
+ RedCloth#clean_html contains iterators nested 3 deep (NestedIterators)
216
+ RedCloth#clean_html doesn't depend on instance state (LowCohesion)
217
+ RedCloth#clean_html has approx 14 statements (LongMethod)
218
+ RedCloth#clean_html has the variable name 'q' (UncommunicativeName)
219
+ RedCloth#clean_html has the variable name 'q2' (UncommunicativeName)
220
+ RedCloth#clean_html refers to raw more than self (LowCohesion)
221
+ RedCloth#clean_html refers to tags more than self (LowCohesion)
222
+ RedCloth#clean_white_space has approx 7 statements (LongMethod)
223
+ RedCloth#clean_white_space refers to text more than self (LowCohesion)
224
+ RedCloth#flush_left doesn't depend on instance state (LowCohesion)
225
+ RedCloth#flush_left refers to indt more than self (LowCohesion)
226
+ RedCloth#flush_left refers to text more than self (LowCohesion)
227
+ RedCloth#footnote_ref refers to text more than self (LowCohesion)
228
+ RedCloth#glyphs_textile has approx 10 statements (LongMethod)
229
+ RedCloth#htmlesc doesn't depend on instance state (LowCohesion)
230
+ RedCloth#htmlesc refers to str more than self (LowCohesion)
231
+ RedCloth#incoming_entities refers to text more than self (LowCohesion)
232
+ RedCloth#initialize has the variable name 'r' (UncommunicativeName)
233
+ RedCloth#inline contains iterators nested 2 deep (NestedIterators)
234
+ RedCloth#inline_markdown_link has approx 6 statements (LongMethod)
235
+ RedCloth#inline_markdown_link has the variable name 'm' (UncommunicativeName)
236
+ RedCloth#inline_markdown_reflink has approx 8 statements (LongMethod)
237
+ RedCloth#inline_markdown_reflink has the variable name 'm' (UncommunicativeName)
238
+ RedCloth#inline_textile_code has the variable name 'm' (UncommunicativeName)
239
+ RedCloth#inline_textile_image has approx 17 statements (LongMethod)
240
+ RedCloth#inline_textile_image has the variable name 'href_a1' (UncommunicativeName)
241
+ RedCloth#inline_textile_image has the variable name 'href_a2' (UncommunicativeName)
242
+ RedCloth#inline_textile_image has the variable name 'm' (UncommunicativeName)
243
+ RedCloth#inline_textile_link has approx 9 statements (LongMethod)
244
+ RedCloth#inline_textile_link has the variable name 'm' (UncommunicativeName)
245
+ RedCloth#inline_textile_span contains iterators nested 2 deep (NestedIterators)
246
+ RedCloth#inline_textile_span has approx 8 statements (LongMethod)
247
+ RedCloth#inline_textile_span has the variable name 'm' (UncommunicativeName)
248
+ RedCloth#lT has the name 'lT' (UncommunicativeName)
249
+ RedCloth#no_textile doesn't depend on instance state (LowCohesion)
250
+ RedCloth#no_textile refers to text more than self (LowCohesion)
263
251
  RedCloth#pba calls $1.length twice (Duplication)
264
- RedCloth#pba has approx 21 statements (Long Method)
265
- RedCloth#pba is controlled by argument text_in (Control Couple)
266
- RedCloth#pba refers to style more than self (Feature Envy)
267
- RedCloth#pba refers to text more than self (Feature Envy)
268
- RedCloth#refs_markdown/block has the variable name 'm' (Uncommunicative Name)
269
- RedCloth#refs_textile/block has the variable name 'm' (Uncommunicative Name)
270
- RedCloth#retrieve/block has the variable name 'i' (Uncommunicative Name)
271
- RedCloth#retrieve/block has the variable name 'r' (Uncommunicative Name)
252
+ RedCloth#pba has approx 21 statements (LongMethod)
253
+ RedCloth#pba is controlled by argument text_in (ControlCouple)
254
+ RedCloth#pba refers to style more than self (LowCohesion)
255
+ RedCloth#pba refers to text more than self (LowCohesion)
256
+ RedCloth#refs_markdown has the variable name 'm' (UncommunicativeName)
257
+ RedCloth#refs_textile has the variable name 'm' (UncommunicativeName)
258
+ RedCloth#retrieve has the variable name 'i' (UncommunicativeName)
259
+ RedCloth#retrieve has the variable name 'r' (UncommunicativeName)
272
260
  RedCloth#rip_offtags calls ((codepre - used_offtags.length) > 0) twice (Duplication)
273
261
  RedCloth#rip_offtags calls (@pre_list.last << line) twice (Duplication)
274
262
  RedCloth#rip_offtags calls (codepre - used_offtags.length) twice (Duplication)
@@ -277,16 +265,16 @@ Feature: Basic smell detection
277
265
  RedCloth#rip_offtags calls htmlesc(line, :NoQuotes) twice (Duplication)
278
266
  RedCloth#rip_offtags calls used_offtags.length twice (Duplication)
279
267
  RedCloth#rip_offtags calls used_offtags["notextile"] 3 times (Duplication)
280
- RedCloth#rip_offtags has approx 18 statements (Long Method)
281
- RedCloth#textile_bq has 4 parameters (Long Parameter List)
282
- RedCloth#textile_bq is controlled by argument atts (Control Couple)
283
- RedCloth#textile_bq is controlled by argument cite (Control Couple)
284
- RedCloth#textile_fn_ has 5 parameters (Long Parameter List)
285
- RedCloth#textile_fn_ is controlled by argument atts (Control Couple)
286
- RedCloth#textile_p has 4 parameters (Long Parameter List)
287
- RedCloth#textile_p is controlled by argument atts (Control Couple)
288
- RedCloth#to_html has approx 24 statements (Long Method)
289
- RedCloth/block has the variable name 'a' (Uncommunicative Name)
290
- RedCloth/block has the variable name 'b' (Uncommunicative Name)
268
+ RedCloth#rip_offtags has approx 18 statements (LongMethod)
269
+ RedCloth#textile_bq has 4 parameters (LongParameterList)
270
+ RedCloth#textile_bq is controlled by argument atts (ControlCouple)
271
+ RedCloth#textile_bq is controlled by argument cite (ControlCouple)
272
+ RedCloth#textile_fn_ has 5 parameters (LongParameterList)
273
+ RedCloth#textile_fn_ is controlled by argument atts (ControlCouple)
274
+ RedCloth#textile_p has 4 parameters (LongParameterList)
275
+ RedCloth#textile_p is controlled by argument atts (ControlCouple)
276
+ RedCloth#textile_popup_help has the parameter name 'windowH' (UncommunicativeName)
277
+ RedCloth#textile_popup_help has the parameter name 'windowW' (UncommunicativeName)
278
+ RedCloth#to_html has approx 24 statements (LongMethod)
291
279
 
292
280
  """
@@ -25,20 +25,17 @@ Feature: Reek reads from $stdin when no files are given
25
25
  Scenario: outputs nothing on empty stdin in quiet mode
26
26
  When I pass "" to reek --quiet
27
27
  Then it succeeds
28
- And it reports:
29
- """
30
-
31
-
32
- """
28
+ And stdout equals ""
33
29
 
34
30
  Scenario: return non-zero status when there are smells
35
31
  When I pass "class Turn; def y() @x = 3; end end" to reek
36
32
  Then the exit status indicates smells
37
33
  And it reports:
38
34
  """
39
- $stdin -- 2 warnings:
40
- Turn has the variable name '@x' (Uncommunicative Name)
41
- Turn#y has the name 'y' (Uncommunicative Name)
35
+ $stdin -- 3 warnings:
36
+ Turn has no descriptive comment (IrresponsibleModule)
37
+ Turn has the variable name '@x' (UncommunicativeName)
38
+ Turn#y has the name 'y' (UncommunicativeName)
42
39
 
43
40
  """
44
41
 
@@ -14,16 +14,20 @@ Then /^stdout equals "([^\"]*)"$/ do |report|
14
14
  @last_stdout.should == report
15
15
  end
16
16
 
17
+ Then /^stdout includes \/([^\"]*)\/$/ do |report|
18
+ @last_stdout.should match(report)
19
+ end
20
+
17
21
  Then /^it succeeds$/ do
18
- @last_exit_status.should == Reek::Application::STATUS_SUCCESS
22
+ @last_exit_status.should == Reek::Cli::Application::STATUS_SUCCESS
19
23
  end
20
24
 
21
25
  Then /^the exit status indicates an error$/ do
22
- @last_exit_status.should == Reek::Application::STATUS_ERROR
26
+ @last_exit_status.should == Reek::Cli::Application::STATUS_ERROR
23
27
  end
24
28
 
25
29
  Then /^the exit status indicates smells$/ do
26
- @last_exit_status.should == Reek::Application::STATUS_SMELLS
30
+ @last_exit_status.should == Reek::Cli::Application::STATUS_SMELLS
27
31
  end
28
32
 
29
33
  Then /^it reports:$/ do |report|
@@ -39,5 +43,5 @@ Then /^it reports the error ['"](.*)['"]$/ do |string|
39
43
  end
40
44
 
41
45
  Then /^it reports the current version$/ do
42
- @last_stdout.chomp.should == "reek #{Reek::VERSION}"
46
+ @last_stdout.should == "reek #{Reek::VERSION}\n"
43
47
  end
@@ -4,8 +4,7 @@ require 'rubygems'
4
4
  require 'tempfile'
5
5
  require 'spec/expectations'
6
6
  require 'fileutils'
7
- require 'reek'
8
- require 'reek/adapters/application'
7
+ require 'reek/cli/application'
9
8
 
10
9
  class ReekWorld
11
10
  def run(cmd)
@@ -27,7 +26,7 @@ class ReekWorld
27
26
  def rake(name, task_def)
28
27
  header = <<EOS
29
28
  $:.unshift('lib')
30
- require 'reek/adapters/rake_task'
29
+ require 'reek/rake/task'
31
30
 
32
31
  EOS
33
32
  rakefile = Tempfile.new('rake_task', '.')