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.
- data/.yardopts +10 -0
- data/History.txt +62 -0
- data/README.md +74 -0
- data/bin/reek +2 -2
- data/config/defaults.reek +44 -5
- data/features/api.feature +20 -0
- data/features/masking_smells.feature +60 -42
- data/features/options.feature +7 -2
- data/features/rake_task.feature +29 -22
- data/features/reports.feature +9 -41
- data/features/samples.feature +184 -196
- data/features/stdin.feature +5 -8
- data/features/step_definitions/reek_steps.rb +8 -4
- data/features/support/env.rb +2 -3
- data/features/yaml.feature +85 -0
- data/lib/reek/cli/application.rb +46 -0
- data/lib/reek/cli/command_line.rb +108 -0
- data/lib/reek/cli/help_command.rb +18 -0
- data/lib/reek/cli/reek_command.rb +37 -0
- data/lib/reek/cli/report.rb +58 -0
- data/lib/reek/cli/version_command.rb +19 -0
- data/lib/reek/cli/yaml_command.rb +32 -0
- data/lib/reek/core/code_context.rb +64 -0
- data/lib/reek/core/code_parser.rb +166 -0
- data/lib/reek/core/method_context.rb +84 -0
- data/lib/reek/core/module_context.rb +20 -0
- data/lib/reek/core/object_refs.rb +51 -0
- data/lib/reek/core/singleton_method_context.rb +20 -0
- data/lib/reek/core/smell_configuration.rb +62 -0
- data/lib/reek/core/sniffer.rb +105 -0
- data/lib/reek/core/stop_context.rb +30 -0
- data/lib/reek/core/warning_collector.rb +27 -0
- data/lib/reek/examiner.rb +104 -0
- data/lib/reek/rake/task.rb +142 -0
- data/lib/reek/smell_warning.rb +73 -23
- data/lib/reek/smells/attribute.rb +26 -21
- data/lib/reek/smells/boolean_parameter.rb +38 -0
- data/lib/reek/smells/class_variable.rb +22 -9
- data/lib/reek/smells/control_couple.rb +40 -16
- data/lib/reek/smells/data_clump.rb +114 -23
- data/lib/reek/smells/duplication.rb +55 -15
- data/lib/reek/smells/feature_envy.rb +16 -7
- data/lib/reek/smells/irresponsible_module.rb +37 -0
- data/lib/reek/smells/large_class.rb +37 -19
- data/lib/reek/smells/long_method.rb +20 -9
- data/lib/reek/smells/long_parameter_list.rb +22 -10
- data/lib/reek/smells/long_yield_list.rb +43 -7
- data/lib/reek/smells/nested_iterators.rb +68 -8
- data/lib/reek/smells/simulated_polymorphism.rb +26 -15
- data/lib/reek/smells/smell_detector.rb +29 -51
- data/lib/reek/smells/uncommunicative_method_name.rb +74 -0
- data/lib/reek/smells/uncommunicative_module_name.rb +74 -0
- data/lib/reek/smells/uncommunicative_parameter_name.rb +79 -0
- data/lib/reek/smells/uncommunicative_variable_name.rb +89 -0
- data/lib/reek/smells/utility_function.rb +51 -12
- data/lib/reek/smells.rb +29 -0
- data/lib/reek/source/code_comment.rb +37 -0
- data/lib/reek/source/config_file.rb +72 -0
- data/lib/reek/source/core_extras.rb +46 -0
- data/lib/reek/source/reference_collector.rb +28 -0
- data/lib/reek/source/sexp_formatter.rb +17 -0
- data/lib/reek/source/source_code.rb +44 -0
- data/lib/reek/source/source_file.rb +32 -0
- data/lib/reek/source/source_locator.rb +42 -0
- data/lib/reek/source/tree_dresser.rb +204 -0
- data/lib/reek/source.rb +18 -0
- data/lib/reek/spec/should_reek.rb +31 -0
- data/lib/reek/spec/should_reek_of.rb +37 -0
- data/lib/reek/spec/should_reek_only_of.rb +37 -0
- data/lib/reek/spec.rb +51 -0
- data/lib/reek.rb +8 -4
- data/reek.gemspec +9 -7
- data/spec/matchers/smell_of_matcher.rb +58 -0
- data/spec/reek/{help_command_spec.rb → cli/help_command_spec.rb} +3 -4
- data/spec/reek/cli/reek_command_spec.rb +46 -0
- data/spec/reek/cli/report_spec.rb +30 -0
- data/spec/reek/{version_command_spec.rb → cli/version_command_spec.rb} +3 -3
- data/spec/reek/cli/yaml_command_spec.rb +47 -0
- data/spec/reek/core/code_context_spec.rb +145 -0
- data/spec/reek/{code_parser_spec.rb → core/code_parser_spec.rb} +7 -6
- data/spec/reek/{config_spec.rb → core/config_spec.rb} +2 -6
- data/spec/reek/{method_context_spec.rb → core/method_context_spec.rb} +16 -36
- data/spec/reek/core/module_context_spec.rb +27 -0
- data/spec/reek/{object_refs_spec.rb → core/object_refs_spec.rb} +5 -6
- data/spec/reek/core/singleton_method_context_spec.rb +9 -0
- data/spec/reek/core/smell_configuration_spec.rb +11 -0
- data/spec/reek/core/stop_context_spec.rb +17 -0
- data/spec/reek/core/warning_collector_spec.rb +27 -0
- data/spec/reek/examiner_spec.rb +103 -0
- data/spec/reek/smell_warning_spec.rb +74 -82
- data/spec/reek/smells/attribute_spec.rb +42 -23
- data/spec/reek/smells/behaves_like_variable_detector.rb +2 -2
- data/spec/reek/smells/boolean_parameter_spec.rb +66 -0
- data/spec/reek/smells/class_variable_spec.rb +60 -75
- data/spec/reek/smells/control_couple_spec.rb +37 -32
- data/spec/reek/smells/data_clump_spec.rb +63 -24
- data/spec/reek/smells/duplication_spec.rb +106 -57
- data/spec/reek/smells/feature_envy_spec.rb +113 -92
- data/spec/reek/smells/irresponsible_module_spec.rb +58 -0
- data/spec/reek/smells/large_class_spec.rb +67 -57
- data/spec/reek/smells/long_method_spec.rb +40 -10
- data/spec/reek/smells/long_parameter_list_spec.rb +50 -28
- data/spec/reek/smells/long_yield_list_spec.rb +57 -0
- data/spec/reek/smells/nested_iterators_spec.rb +115 -7
- data/spec/reek/smells/simulated_polymorphism_spec.rb +56 -20
- data/spec/reek/smells/smell_detector_shared.rb +42 -0
- data/spec/reek/smells/uncommunicative_method_name_spec.rb +42 -0
- data/spec/reek/smells/uncommunicative_module_name_spec.rb +66 -0
- data/spec/reek/smells/uncommunicative_parameter_name_spec.rb +71 -0
- data/spec/reek/smells/uncommunicative_variable_name_spec.rb +120 -0
- data/spec/reek/smells/utility_function_spec.rb +50 -4
- data/spec/reek/source/code_comment_spec.rb +82 -0
- data/spec/reek/source/object_source_spec.rb +20 -0
- data/spec/reek/source/reference_collector_spec.rb +53 -0
- data/spec/reek/{adapters/source_spec.rb → source/source_code_spec.rb} +7 -8
- data/spec/reek/source/tree_dresser_spec.rb +270 -0
- data/spec/reek/spec/should_reek_of_spec.rb +76 -0
- data/spec/reek/spec/should_reek_only_of_spec.rb +89 -0
- data/spec/reek/{adapters → spec}/should_reek_spec.rb +8 -32
- data/spec/samples/all_but_one_masked/clean_one.rb +1 -0
- data/spec/samples/all_but_one_masked/dirty.rb +1 -0
- data/spec/samples/all_but_one_masked/masked.reek +5 -1
- data/spec/samples/clean_due_to_masking/clean_one.rb +1 -0
- data/spec/samples/clean_due_to_masking/clean_three.rb +1 -0
- data/spec/samples/clean_due_to_masking/clean_two.rb +1 -0
- data/spec/samples/clean_due_to_masking/dirty_one.rb +1 -1
- data/spec/samples/clean_due_to_masking/dirty_two.rb +1 -1
- data/spec/samples/clean_due_to_masking/masked.reek +5 -1
- data/spec/samples/config/allow_duplication.reek +3 -0
- data/spec/samples/config/deeper_nested_iterators.reek +3 -0
- data/spec/samples/corrupt_config_file/dirty.rb +1 -1
- data/spec/samples/demo/demo.rb +8 -0
- data/spec/samples/empty_config_file/dirty.rb +2 -1
- data/spec/samples/exceptions.reek +1 -1
- 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/samples/masked/dirty.rb +2 -1
- data/spec/samples/masked/masked.reek +3 -1
- data/spec/samples/mixed_results/clean_one.rb +1 -0
- data/spec/samples/mixed_results/clean_three.rb +1 -0
- data/spec/samples/mixed_results/clean_two.rb +1 -0
- data/spec/samples/mixed_results/dirty_one.rb +1 -0
- data/spec/samples/mixed_results/dirty_two.rb +1 -0
- data/spec/samples/not_quite_masked/dirty.rb +2 -1
- data/spec/samples/not_quite_masked/masked.reek +1 -1
- data/spec/samples/overrides/masked/dirty.rb +2 -1
- data/spec/samples/overrides/masked/lower.reek +3 -1
- data/spec/samples/three_clean_files/clean_one.rb +1 -0
- data/spec/samples/three_clean_files/clean_three.rb +1 -0
- data/spec/samples/three_clean_files/clean_two.rb +1 -0
- data/spec/samples/two_smelly_files/dirty_one.rb +2 -1
- data/spec/samples/two_smelly_files/dirty_two.rb +2 -1
- data/spec/spec_helper.rb +10 -2
- data/tasks/reek.rake +2 -2
- data/tasks/test.rake +12 -3
- metadata +121 -79
- data/README.rdoc +0 -84
- data/features/profile.feature +0 -34
- data/lib/reek/adapters/application.rb +0 -46
- data/lib/reek/adapters/command_line.rb +0 -77
- data/lib/reek/adapters/config_file.rb +0 -31
- data/lib/reek/adapters/core_extras.rb +0 -64
- data/lib/reek/adapters/rake_task.rb +0 -121
- data/lib/reek/adapters/report.rb +0 -86
- data/lib/reek/adapters/source.rb +0 -72
- data/lib/reek/adapters/spec.rb +0 -133
- data/lib/reek/block_context.rb +0 -62
- data/lib/reek/class_context.rb +0 -41
- data/lib/reek/code_context.rb +0 -68
- data/lib/reek/code_parser.rb +0 -203
- data/lib/reek/configuration.rb +0 -57
- data/lib/reek/detector_stack.rb +0 -37
- data/lib/reek/help_command.rb +0 -14
- data/lib/reek/if_context.rb +0 -18
- data/lib/reek/masking_collection.rb +0 -33
- data/lib/reek/method_context.rb +0 -138
- data/lib/reek/module_context.rb +0 -49
- data/lib/reek/name.rb +0 -57
- data/lib/reek/object_refs.rb +0 -49
- data/lib/reek/reek_command.rb +0 -28
- data/lib/reek/sexp_formatter.rb +0 -10
- data/lib/reek/singleton_method_context.rb +0 -26
- data/lib/reek/smells/uncommunicative_name.rb +0 -84
- data/lib/reek/sniffer.rb +0 -177
- data/lib/reek/stop_context.rb +0 -35
- data/lib/reek/tree_dresser.rb +0 -82
- data/lib/reek/version_command.rb +0 -14
- data/lib/reek/yield_call_context.rb +0 -12
- data/spec/reek/adapters/report_spec.rb +0 -31
- data/spec/reek/adapters/should_reek_of_spec.rb +0 -138
- data/spec/reek/adapters/should_reek_only_of_spec.rb +0 -87
- data/spec/reek/block_context_spec.rb +0 -65
- data/spec/reek/class_context_spec.rb +0 -161
- data/spec/reek/code_context_spec.rb +0 -182
- data/spec/reek/configuration_spec.rb +0 -12
- data/spec/reek/if_context_spec.rb +0 -17
- data/spec/reek/masking_collection_spec.rb +0 -236
- data/spec/reek/module_context_spec.rb +0 -46
- data/spec/reek/name_spec.rb +0 -37
- data/spec/reek/object_source_spec.rb +0 -23
- data/spec/reek/reek_command_spec.rb +0 -45
- data/spec/reek/singleton_method_context_spec.rb +0 -16
- data/spec/reek/smells/smell_detector_spec.rb +0 -36
- data/spec/reek/smells/uncommunicative_name_spec.rb +0 -146
- data/spec/reek/sniffer_spec.rb +0 -11
- data/spec/reek/stop_context_spec.rb +0 -33
- data/spec/reek/tree_dresser_spec.rb +0 -20
data/features/samples.feature
CHANGED
|
@@ -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 --
|
|
14
|
-
|
|
15
|
-
Inline declares the 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 (
|
|
18
|
-
Inline::C declares the class variable @@type_map (
|
|
19
|
-
Inline::C has at least 13 instance variables (
|
|
20
|
-
Inline::C takes parameters [options, src] to 5 methods (
|
|
21
|
-
Inline::C tests $DEBUG at least 7 times (
|
|
22
|
-
Inline::C tests $TESTING at least 4 times (
|
|
23
|
-
Inline::C tests @@type_map.has_key?(type) at least 3 times (
|
|
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
|
|
32
|
-
Inline::C#build has
|
|
33
|
-
Inline::C#build
|
|
34
|
-
Inline::C#build
|
|
35
|
-
Inline::C#c has the name 'c' (
|
|
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 (
|
|
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
|
|
44
|
-
Inline::C#module_name
|
|
45
|
-
Inline::C#parse_signature has approx 15 statements (
|
|
46
|
-
Inline::C#parse_signature
|
|
47
|
-
Inline::C#parse_signature
|
|
48
|
-
Inline::C#
|
|
49
|
-
Inline::C#strip_comments
|
|
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 (
|
|
52
|
-
Module#inline is controlled by argument options (
|
|
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 --
|
|
62
|
-
OptionParser has at least 42 methods (
|
|
63
|
-
OptionParser
|
|
64
|
-
OptionParser
|
|
65
|
-
OptionParser
|
|
66
|
-
OptionParser
|
|
67
|
-
OptionParser
|
|
68
|
-
OptionParser
|
|
69
|
-
OptionParser
|
|
70
|
-
OptionParser
|
|
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 (
|
|
73
|
-
OptionParser#
|
|
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
|
|
87
|
-
OptionParser#make_switch
|
|
88
|
-
OptionParser#make_switch has
|
|
89
|
-
OptionParser#make_switch has the variable name '
|
|
90
|
-
OptionParser#make_switch has the variable name '
|
|
91
|
-
OptionParser#make_switch has the variable name '
|
|
92
|
-
OptionParser#make_switch
|
|
93
|
-
OptionParser#make_switch
|
|
94
|
-
OptionParser#make_switch
|
|
95
|
-
OptionParser#make_switch
|
|
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 (
|
|
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 (
|
|
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
|
|
112
|
-
OptionParser#parse_in_order
|
|
113
|
-
OptionParser#parse_in_order
|
|
114
|
-
OptionParser#parse_in_order
|
|
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 (
|
|
117
|
-
OptionParser#search
|
|
118
|
-
OptionParser#summarize has 4 parameters (
|
|
119
|
-
OptionParser#summarize
|
|
120
|
-
OptionParser#ver has the variable name 'v' (
|
|
121
|
-
OptionParser
|
|
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 (
|
|
135
|
-
OptionParser::Completion#complete has
|
|
136
|
-
OptionParser::Completion#complete has the variable name '
|
|
137
|
-
OptionParser::Completion#complete
|
|
138
|
-
OptionParser::Completion#complete refers to candidates more than self (
|
|
139
|
-
OptionParser::
|
|
140
|
-
OptionParser::
|
|
141
|
-
OptionParser::List#accept
|
|
142
|
-
OptionParser::List#
|
|
143
|
-
OptionParser::List#
|
|
144
|
-
OptionParser::List#
|
|
145
|
-
OptionParser::List#
|
|
146
|
-
OptionParser::List#
|
|
147
|
-
OptionParser::List#
|
|
148
|
-
OptionParser::List#
|
|
149
|
-
OptionParser::List#update has
|
|
150
|
-
OptionParser::List#update
|
|
151
|
-
OptionParser::List#update
|
|
152
|
-
OptionParser::
|
|
153
|
-
OptionParser::
|
|
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 (
|
|
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 (
|
|
162
|
-
OptionParser::Switch#parse_arg has the variable name 'm' (
|
|
163
|
-
OptionParser::Switch#parse_arg has the variable name 's' (
|
|
164
|
-
OptionParser::Switch#self.guess has the variable name 't' (
|
|
165
|
-
OptionParser::Switch#self.incompatible_argument_styles has the
|
|
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
|
|
175
|
-
OptionParser::Switch#summarize has
|
|
176
|
-
OptionParser::Switch#summarize has
|
|
177
|
-
OptionParser::Switch#summarize has the variable name '
|
|
178
|
-
OptionParser::Switch#summarize has the variable name '
|
|
179
|
-
OptionParser::Switch#summarize
|
|
180
|
-
OptionParser::Switch#
|
|
181
|
-
OptionParser::Switch::
|
|
182
|
-
OptionParser::Switch::
|
|
183
|
-
OptionParser::Switch::
|
|
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 --
|
|
195
|
-
RedCloth has at least 44 methods (
|
|
196
|
-
RedCloth
|
|
197
|
-
RedCloth
|
|
198
|
-
RedCloth
|
|
199
|
-
RedCloth tests
|
|
200
|
-
RedCloth tests
|
|
201
|
-
RedCloth
|
|
202
|
-
RedCloth
|
|
203
|
-
RedCloth#
|
|
204
|
-
RedCloth#
|
|
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
|
|
212
|
-
RedCloth#block_textile_lists
|
|
213
|
-
RedCloth#block_textile_lists
|
|
214
|
-
RedCloth#block_textile_lists
|
|
215
|
-
RedCloth#block_textile_lists
|
|
216
|
-
RedCloth#
|
|
217
|
-
RedCloth#block_textile_table
|
|
218
|
-
RedCloth#block_textile_table
|
|
219
|
-
RedCloth#block_textile_table
|
|
220
|
-
RedCloth#
|
|
221
|
-
RedCloth#blocks has approx 18 statements (
|
|
222
|
-
RedCloth#blocks
|
|
223
|
-
RedCloth#blocks
|
|
224
|
-
RedCloth#
|
|
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
|
|
228
|
-
RedCloth#clean_html
|
|
229
|
-
RedCloth#clean_html
|
|
230
|
-
RedCloth#clean_html
|
|
231
|
-
RedCloth#clean_html
|
|
232
|
-
RedCloth#clean_html
|
|
233
|
-
RedCloth#clean_html
|
|
234
|
-
RedCloth#
|
|
235
|
-
RedCloth#clean_white_space
|
|
236
|
-
RedCloth#
|
|
237
|
-
RedCloth#flush_left
|
|
238
|
-
RedCloth#flush_left refers to
|
|
239
|
-
RedCloth#
|
|
240
|
-
RedCloth#
|
|
241
|
-
RedCloth#
|
|
242
|
-
RedCloth#htmlesc
|
|
243
|
-
RedCloth#
|
|
244
|
-
RedCloth#
|
|
245
|
-
RedCloth#
|
|
246
|
-
RedCloth#
|
|
247
|
-
RedCloth#inline_markdown_link has
|
|
248
|
-
RedCloth#
|
|
249
|
-
RedCloth#inline_markdown_reflink has
|
|
250
|
-
RedCloth#
|
|
251
|
-
RedCloth#
|
|
252
|
-
RedCloth#inline_textile_image has
|
|
253
|
-
RedCloth#inline_textile_image
|
|
254
|
-
RedCloth#inline_textile_image
|
|
255
|
-
RedCloth#
|
|
256
|
-
RedCloth#inline_textile_link has
|
|
257
|
-
RedCloth#
|
|
258
|
-
RedCloth#inline_textile_span has approx 8 statements (
|
|
259
|
-
RedCloth#inline_textile_span
|
|
260
|
-
RedCloth#
|
|
261
|
-
RedCloth#no_textile doesn't depend on instance state (
|
|
262
|
-
RedCloth#no_textile refers to text more than self (
|
|
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 (
|
|
265
|
-
RedCloth#pba is controlled by argument text_in (
|
|
266
|
-
RedCloth#pba refers to style more than self (
|
|
267
|
-
RedCloth#pba refers to text more than self (
|
|
268
|
-
RedCloth#refs_markdown
|
|
269
|
-
RedCloth#refs_textile
|
|
270
|
-
RedCloth#retrieve
|
|
271
|
-
RedCloth#retrieve
|
|
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 (
|
|
281
|
-
RedCloth#textile_bq has 4 parameters (
|
|
282
|
-
RedCloth#textile_bq is controlled by argument atts (
|
|
283
|
-
RedCloth#textile_bq is controlled by argument cite (
|
|
284
|
-
RedCloth#textile_fn_ has 5 parameters (
|
|
285
|
-
RedCloth#textile_fn_ is controlled by argument atts (
|
|
286
|
-
RedCloth#textile_p has 4 parameters (
|
|
287
|
-
RedCloth#textile_p is controlled by argument atts (
|
|
288
|
-
RedCloth#
|
|
289
|
-
RedCloth
|
|
290
|
-
RedCloth
|
|
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
|
"""
|
data/features/stdin.feature
CHANGED
|
@@ -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
|
|
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 --
|
|
40
|
-
Turn has
|
|
41
|
-
Turn
|
|
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.
|
|
46
|
+
@last_stdout.should == "reek #{Reek::VERSION}\n"
|
|
43
47
|
end
|
data/features/support/env.rb
CHANGED
|
@@ -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/
|
|
29
|
+
require 'reek/rake/task'
|
|
31
30
|
|
|
32
31
|
EOS
|
|
33
32
|
rakefile = Tempfile.new('rake_task', '.')
|