reek 1.2.8 → 1.2.9
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/History.txt +4 -0
- data/README.md +40 -25
- data/Rakefile +2 -15
- data/bin/reek +1 -1
- data/features/{options.feature → command_line_interface/options.feature} +1 -3
- data/features/{stdin.feature → command_line_interface/stdin.feature} +2 -2
- data/features/{masking_smells.feature → configuration_files/masking_smells.feature} +23 -23
- data/features/{rake_task.feature → rake_task/rake_task.feature} +9 -9
- data/features/{reports.feature → reports/reports.feature} +10 -10
- data/features/{yaml.feature → reports/yaml.feature} +2 -2
- data/features/{api.feature → ruby_api/api.feature} +6 -6
- data/features/samples.feature +239 -247
- data/features/step_definitions/reek_steps.rb +15 -1
- data/features/support/env.rb +0 -1
- data/lib/reek.rb +1 -4
- data/lib/reek/cli/command_line.rb +6 -5
- data/lib/reek/cli/report.rb +1 -1
- data/lib/reek/core/hash_extensions.rb +29 -0
- data/lib/reek/core/method_context.rb +3 -16
- data/lib/reek/core/object_refs.rb +5 -22
- data/lib/reek/core/smell_repository.rb +65 -0
- data/lib/reek/core/sniffer.rb +7 -76
- data/lib/reek/core/warning_collector.rb +1 -5
- data/lib/reek/examiner.rb +3 -13
- data/lib/reek/rake/task.rb +10 -2
- data/lib/reek/smell_warning.rb +1 -0
- data/lib/reek/smells/smell_detector.rb +0 -3
- data/lib/reek/smells/uncommunicative_module_name.rb +6 -3
- data/lib/reek/smells/uncommunicative_variable_name.rb +1 -1
- data/lib/reek/source/config_file.rb +8 -2
- data/lib/reek/source/sexp_formatter.rb +1 -1
- data/lib/reek/source/source_repository.rb +31 -0
- data/lib/reek/source/tree_dresser.rb +1 -1
- data/lib/reek/spec/should_reek.rb +5 -2
- data/lib/reek/version.rb +3 -0
- data/lib/xp.reek +63 -0
- data/reek.gemspec +16 -28
- data/spec/gem/manifest_spec.rb +22 -0
- data/spec/gem/updates_spec.rb +26 -0
- data/spec/gem/yard_spec.rb +15 -0
- data/spec/matchers/smell_of_matcher.rb +0 -1
- data/spec/reek/cli/reek_command_spec.rb +1 -1
- data/spec/reek/core/method_context_spec.rb +2 -2
- data/spec/reek/core/object_refs_spec.rb +115 -118
- data/spec/reek/smell_warning_spec.rb +2 -2
- data/spec/reek/smells/uncommunicative_variable_name_spec.rb +3 -0
- data/spec/reek/source/sexp_formatter_spec.rb +19 -0
- data/spec/reek/spec/should_reek_spec.rb +21 -3
- data/tasks/deployment.rake +69 -0
- data/tasks/develop.rake +29 -0
- data/tasks/test.rake +1 -6
- metadata +200 -138
data/History.txt
CHANGED
data/README.md
CHANGED
|
@@ -1,50 +1,62 @@
|
|
|
1
1
|
# Reek -- code smell detection for Ruby
|
|
2
2
|
|
|
3
|
+
[](http://travis-ci.org/troessner/reek?branch=master)
|
|
4
|
+
|
|
3
5
|
Reek is a tool that examines Ruby classes, modules and methods and
|
|
4
6
|
reports any code smells it finds. Install it like this:
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
```bash
|
|
9
|
+
$ gem install reek
|
|
10
|
+
```
|
|
7
11
|
|
|
8
12
|
and run it like this:
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
```bash
|
|
15
|
+
$ reek [options] [dir_or_source_file]*
|
|
16
|
+
```
|
|
11
17
|
|
|
12
18
|
For a full list of command-line options see the Reek
|
|
13
|
-
wiki[http://wiki.github.com/
|
|
19
|
+
wiki[http://wiki.github.com/troessner/reek/command-line-options]
|
|
14
20
|
or run
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
```bash
|
|
23
|
+
$ reek --help
|
|
24
|
+
```
|
|
17
25
|
|
|
18
26
|
## Example
|
|
19
27
|
|
|
20
28
|
Imagine a source file <tt>demo.rb</tt> containing:
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
```ruby
|
|
31
|
+
class Dirty
|
|
32
|
+
# This method smells of :reek:NestedIterators but ignores them
|
|
33
|
+
def awful(x, y, offset = 0, log = false)
|
|
34
|
+
puts @screen.title
|
|
35
|
+
@screen = widgets.map {|w| w.each {|key| key += 3}}
|
|
36
|
+
puts @screen.contents
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
```
|
|
30
40
|
|
|
31
41
|
Reek will report the following code smells in this file:
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
```bash
|
|
44
|
+
$ reek demo.rb
|
|
45
|
+
spec/samples/demo/demo.rb -- 6 warnings:
|
|
46
|
+
Dirty has no descriptive comment (IrresponsibleModule)
|
|
47
|
+
Dirty#awful has 4 parameters (LongParameterList)
|
|
48
|
+
Dirty#awful has boolean parameter 'log' (ControlCouple)
|
|
49
|
+
Dirty#awful has the parameter name 'x' (UncommunicativeName)
|
|
50
|
+
Dirty#awful has the parameter name 'y' (UncommunicativeName)
|
|
51
|
+
Dirty#awful has the variable name 'w' (UncommunicativeName)
|
|
52
|
+
```
|
|
41
53
|
|
|
42
54
|
## Features
|
|
43
55
|
|
|
44
56
|
Reek currently includes checks for some aspects of Control Couple,
|
|
45
57
|
Data Clump, Feature Envy, Large Class, Long Method, Long Parameter List,
|
|
46
58
|
Simulated Polymorphism, Uncommunicative Name and more.
|
|
47
|
-
See the [Reek wiki](http://wiki.github.com/
|
|
59
|
+
See the [Reek wiki](http://wiki.github.com/troessner/reek/code-smells)
|
|
48
60
|
for up to date details of exactly what Reek will check in your code.
|
|
49
61
|
|
|
50
62
|
### Tool Integration
|
|
@@ -53,7 +65,9 @@ Reek integrates with many of your favourite tools:
|
|
|
53
65
|
|
|
54
66
|
* `require 'reek/rake/task'` to easily add Reek to your Rakefile
|
|
55
67
|
* `require 'reek/spec'` to add the `should_not reek` custom matcher to your Rspec examples
|
|
56
|
-
* Reek is
|
|
68
|
+
* Reek is compatible with Ruby 1.8.6, 1.8.7, 1.9.2 and 1.9.3
|
|
69
|
+
|
|
70
|
+
At present Reek is unable to parse the new Ruby 1.9 hash syntax of {a: 1}.
|
|
57
71
|
|
|
58
72
|
### Dependencies
|
|
59
73
|
|
|
@@ -68,7 +82,8 @@ Learn More
|
|
|
68
82
|
|
|
69
83
|
Find out more about Reek from any of the following sources:
|
|
70
84
|
|
|
71
|
-
* Browse the Reek documentation at [http://wiki.github.com/
|
|
72
|
-
* Browse the code or install the latest development version from [http://github.com/
|
|
73
|
-
* Read the code API at [http://rdoc.info/projects/
|
|
85
|
+
* Browse the Reek documentation at [http://wiki.github.com/troessner/reek](http://wiki.github.com/troessner/reek)
|
|
86
|
+
* Browse the code or install the latest development version from [http://github.com/troessner/reek/tree](http://github.com/troessner/reek/tree)
|
|
87
|
+
* Read the code API at [http://rdoc.info/projects/troessner/reek](http://rdoc.info/projects/troessner/reek)
|
|
74
88
|
* Follow [@rubyreek](http://twitter.com/rubyreek) on twitter!
|
|
89
|
+
|
data/Rakefile
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
$:.unshift File.dirname(__FILE__) + '/lib'
|
|
4
|
-
|
|
5
|
-
PROJECT_NAME = 'reek'
|
|
6
|
-
|
|
7
|
-
BUILD_DIR = 'build'; directory BUILD_DIR
|
|
8
|
-
PKG_DIR = "#{BUILD_DIR}/pkg"; directory PKG_DIR
|
|
9
|
-
|
|
10
|
-
GEM_MANIFEST = "Manifest.txt"
|
|
11
|
-
VERSION_FILE = 'lib/reek.rb'
|
|
12
|
-
|
|
13
|
-
CLOBBER.include("#{BUILD_DIR}/*")
|
|
14
|
-
|
|
15
|
-
Dir['tasks/**/*.rake'].each { |t| load t }
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
require "bundler/gem_tasks"
|
data/bin/reek
CHANGED
|
@@ -28,17 +28,15 @@ Feature: Reek can be controlled using command-line options
|
|
|
28
28
|
reek -q lib
|
|
29
29
|
cat my_class.rb | reek
|
|
30
30
|
|
|
31
|
-
See http://wiki.github.com/
|
|
31
|
+
See http://wiki.github.com/troessner/reek for detailed help.
|
|
32
32
|
|
|
33
33
|
Common options:
|
|
34
34
|
-h, --help Show this message
|
|
35
35
|
-v, --version Show version
|
|
36
36
|
|
|
37
|
-
|
|
38
37
|
Configuration:
|
|
39
38
|
-c, --config FILE Read configuration options from FILE
|
|
40
39
|
|
|
41
|
-
|
|
42
40
|
Report formatting:
|
|
43
41
|
-q, --[no-]quiet Suppress headings for smell-free source files
|
|
44
42
|
-y, --yaml Report smells in YAML format
|
|
@@ -34,8 +34,8 @@ Feature: Reek reads from $stdin when no files are given
|
|
|
34
34
|
"""
|
|
35
35
|
$stdin -- 3 warnings:
|
|
36
36
|
Turn has no descriptive comment (IrresponsibleModule)
|
|
37
|
-
Turn has the variable name '@x' (
|
|
38
|
-
Turn#y has the name 'y' (
|
|
37
|
+
Turn has the variable name '@x' (UncommunicativeVariableName)
|
|
38
|
+
Turn#y has the name 'y' (UncommunicativeMethodName)
|
|
39
39
|
|
|
40
40
|
"""
|
|
41
41
|
|
|
@@ -10,12 +10,12 @@ Feature: Masking smells using config files
|
|
|
10
10
|
And it reports:
|
|
11
11
|
"""
|
|
12
12
|
spec/samples/empty_config_file/dirty.rb -- 6 warnings:
|
|
13
|
-
Dirty has the variable name '@s' (
|
|
14
|
-
Dirty#a calls @s.title twice (
|
|
15
|
-
Dirty#a calls puts(@s.title) twice (
|
|
13
|
+
Dirty has the variable name '@s' (UncommunicativeVariableName)
|
|
14
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
15
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
16
16
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
17
|
-
Dirty#a has the name 'a' (
|
|
18
|
-
Dirty#a has the variable name 'x' (
|
|
17
|
+
Dirty#a has the name 'a' (UncommunicativeMethodName)
|
|
18
|
+
Dirty#a has the variable name 'x' (UncommunicativeVariableName)
|
|
19
19
|
|
|
20
20
|
"""
|
|
21
21
|
|
|
@@ -26,15 +26,15 @@ Feature: Masking smells using config files
|
|
|
26
26
|
"""
|
|
27
27
|
spec/samples/corrupt_config_file/dirty.rb -- 7 warnings:
|
|
28
28
|
Dirty has no descriptive comment (IrresponsibleModule)
|
|
29
|
-
Dirty has the variable name '@s' (
|
|
30
|
-
Dirty#a calls @s.title twice (
|
|
31
|
-
Dirty#a calls puts(@s.title) twice (
|
|
29
|
+
Dirty has the variable name '@s' (UncommunicativeVariableName)
|
|
30
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
31
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
32
32
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
33
|
-
Dirty#a has the name 'a' (
|
|
34
|
-
Dirty#a has the variable name 'x' (
|
|
33
|
+
Dirty#a has the name 'a' (UncommunicativeMethodName)
|
|
34
|
+
Dirty#a has the variable name 'x' (UncommunicativeVariableName)
|
|
35
35
|
|
|
36
36
|
"""
|
|
37
|
-
And it reports
|
|
37
|
+
And it reports an error
|
|
38
38
|
|
|
39
39
|
Scenario: missing source file is an error
|
|
40
40
|
When I run reek no_such_file.rb spec/samples/masked/dirty.rb
|
|
@@ -42,8 +42,8 @@ Feature: Masking smells using config files
|
|
|
42
42
|
And it reports:
|
|
43
43
|
"""
|
|
44
44
|
spec/samples/masked/dirty.rb -- 3 warnings:
|
|
45
|
-
Dirty#a calls @s.title twice (
|
|
46
|
-
Dirty#a calls puts(@s.title) twice (
|
|
45
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
46
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
47
47
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
48
48
|
|
|
49
49
|
"""
|
|
@@ -55,8 +55,8 @@ Feature: Masking smells using config files
|
|
|
55
55
|
And it reports:
|
|
56
56
|
"""
|
|
57
57
|
spec/samples/masked/dirty.rb -- 3 warnings:
|
|
58
|
-
Dirty#a calls @s.title twice (
|
|
59
|
-
Dirty#a calls puts(@s.title) twice (
|
|
58
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
59
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
60
60
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
61
61
|
|
|
62
62
|
"""
|
|
@@ -67,11 +67,11 @@ Feature: Masking smells using config files
|
|
|
67
67
|
And it reports:
|
|
68
68
|
"""
|
|
69
69
|
spec/samples/not_quite_masked/dirty.rb -- 5 warnings:
|
|
70
|
-
Dirty has the variable name '@s' (
|
|
71
|
-
Dirty#a calls @s.title twice (
|
|
72
|
-
Dirty#a calls puts(@s.title) twice (
|
|
70
|
+
Dirty has the variable name '@s' (UncommunicativeVariableName)
|
|
71
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
72
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
73
73
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
74
|
-
Dirty#a has the name 'a' (
|
|
74
|
+
Dirty#a has the name 'a' (UncommunicativeMethodName)
|
|
75
75
|
|
|
76
76
|
"""
|
|
77
77
|
|
|
@@ -82,8 +82,8 @@ Feature: Masking smells using config files
|
|
|
82
82
|
And it reports:
|
|
83
83
|
"""
|
|
84
84
|
spec/samples/overrides/masked/dirty.rb -- 2 warnings:
|
|
85
|
-
Dirty#a calls @s.title twice (
|
|
86
|
-
Dirty#a calls puts(@s.title) twice (
|
|
85
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
86
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
87
87
|
|
|
88
88
|
"""
|
|
89
89
|
|
|
@@ -93,7 +93,7 @@ Feature: Masking smells using config files
|
|
|
93
93
|
And it reports:
|
|
94
94
|
"""
|
|
95
95
|
spec/samples/mask_some/dirty.rb -- 2 warnings:
|
|
96
|
-
Dirty#a calls @s.title twice (
|
|
96
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
97
97
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
98
98
|
|
|
99
99
|
"""
|
|
@@ -105,7 +105,7 @@ Feature: Masking smells using config files
|
|
|
105
105
|
And it reports:
|
|
106
106
|
"""
|
|
107
107
|
spec/samples/inline_config/dirty.rb -- 1 warning:
|
|
108
|
-
Dirty#a calls @s.title twice (
|
|
108
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
109
109
|
|
|
110
110
|
"""
|
|
111
111
|
|
|
@@ -14,8 +14,8 @@ Feature: Reek can be driven through its Task
|
|
|
14
14
|
And it reports:
|
|
15
15
|
"""
|
|
16
16
|
spec/samples/masked/dirty.rb -- 3 warnings:
|
|
17
|
-
Dirty#a calls @s.title twice (
|
|
18
|
-
Dirty#a calls puts(@s.title) twice (
|
|
17
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
18
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
19
19
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
20
20
|
"""
|
|
21
21
|
|
|
@@ -30,8 +30,8 @@ Feature: Reek can be driven through its Task
|
|
|
30
30
|
And it reports:
|
|
31
31
|
"""
|
|
32
32
|
spec/samples/masked/dirty.rb -- 3 warnings:
|
|
33
|
-
Dirty#a calls @s.title twice (
|
|
34
|
-
Dirty#a calls puts(@s.title) twice (
|
|
33
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
34
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
35
35
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
36
36
|
"""
|
|
37
37
|
|
|
@@ -58,12 +58,12 @@ Feature: Reek can be driven through its Task
|
|
|
58
58
|
And it reports:
|
|
59
59
|
"""
|
|
60
60
|
spec/samples/empty_config_file/dirty.rb -- 6 warnings:
|
|
61
|
-
Dirty has the variable name '@s' (
|
|
62
|
-
Dirty#a calls @s.title twice (
|
|
63
|
-
Dirty#a calls puts(@s.title) twice (
|
|
61
|
+
Dirty has the variable name '@s' (UncommunicativeVariableName)
|
|
62
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
63
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
64
64
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
65
|
-
Dirty#a has the name 'a' (
|
|
66
|
-
Dirty#a has the variable name 'x' (
|
|
65
|
+
Dirty#a has the name 'a' (UncommunicativeMethodName)
|
|
66
|
+
Dirty#a has the variable name 'x' (UncommunicativeVariableName)
|
|
67
67
|
"""
|
|
68
68
|
|
|
69
69
|
Scenario: can be configured with config_files
|
|
@@ -10,19 +10,19 @@ Feature: Correctly formatted reports
|
|
|
10
10
|
And it reports:
|
|
11
11
|
"""
|
|
12
12
|
spec/samples/two_smelly_files/dirty_one.rb -- 6 warnings:
|
|
13
|
-
Dirty has the variable name '@s' (
|
|
14
|
-
Dirty#a calls @s.title twice (
|
|
15
|
-
Dirty#a calls puts(@s.title) twice (
|
|
13
|
+
Dirty has the variable name '@s' (UncommunicativeVariableName)
|
|
14
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
15
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
16
16
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
17
|
-
Dirty#a has the name 'a' (
|
|
18
|
-
Dirty#a has the variable name 'x' (
|
|
17
|
+
Dirty#a has the name 'a' (UncommunicativeMethodName)
|
|
18
|
+
Dirty#a has the variable name 'x' (UncommunicativeVariableName)
|
|
19
19
|
spec/samples/two_smelly_files/dirty_two.rb -- 6 warnings:
|
|
20
|
-
Dirty has the variable name '@s' (
|
|
21
|
-
Dirty#a calls @s.title twice (
|
|
22
|
-
Dirty#a calls puts(@s.title) twice (
|
|
20
|
+
Dirty has the variable name '@s' (UncommunicativeVariableName)
|
|
21
|
+
Dirty#a calls @s.title twice (DuplicateMethodCall)
|
|
22
|
+
Dirty#a calls puts(@s.title) twice (DuplicateMethodCall)
|
|
23
23
|
Dirty#a contains iterators nested 2 deep (NestedIterators)
|
|
24
|
-
Dirty#a has the name 'a' (
|
|
25
|
-
Dirty#a has the variable name 'x' (
|
|
24
|
+
Dirty#a has the name 'a' (UncommunicativeMethodName)
|
|
25
|
+
Dirty#a has the variable name 'x' (UncommunicativeVariableName)
|
|
26
26
|
|
|
27
27
|
"""
|
|
28
28
|
|
|
@@ -12,7 +12,7 @@ Feature: Report smells using simple YAML layout
|
|
|
12
12
|
Scenario: masked smells always appear
|
|
13
13
|
When I run reek --yaml spec/samples/masked/dirty.rb
|
|
14
14
|
Then the exit status indicates smells
|
|
15
|
-
And it reports:
|
|
15
|
+
And it reports this yaml:
|
|
16
16
|
"""
|
|
17
17
|
---
|
|
18
18
|
- !ruby/object:Reek::SmellWarning
|
|
@@ -65,7 +65,7 @@ Feature: Report smells using simple YAML layout
|
|
|
65
65
|
Scenario: return non-zero status when there are smells
|
|
66
66
|
When I pass "class Turn; end" to reek --yaml
|
|
67
67
|
Then the exit status indicates smells
|
|
68
|
-
And it reports:
|
|
68
|
+
And it reports this yaml:
|
|
69
69
|
"""
|
|
70
70
|
---
|
|
71
71
|
- !ruby/object:Reek::SmellWarning
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@masking
|
|
2
2
|
Feature: The Reek API maintains backwards compatibility
|
|
3
|
-
In order to use Reek
|
|
3
|
+
In order to use Reek without fuss
|
|
4
4
|
As a developer
|
|
5
|
-
I want to
|
|
5
|
+
I want to have a stable API
|
|
6
6
|
|
|
7
7
|
Scenario: the demo example reports as expected
|
|
8
8
|
When I run reek spec/samples/demo
|
|
@@ -12,9 +12,9 @@ Feature: The Reek API maintains backwards compatibility
|
|
|
12
12
|
spec/samples/demo/demo.rb -- 6 warnings:
|
|
13
13
|
Dirty has no descriptive comment (IrresponsibleModule)
|
|
14
14
|
Dirty#awful has 4 parameters (LongParameterList)
|
|
15
|
-
Dirty#awful has boolean parameter 'log' (
|
|
16
|
-
Dirty#awful has the parameter name 'x' (
|
|
17
|
-
Dirty#awful has the parameter name 'y' (
|
|
18
|
-
Dirty#awful has the variable name 'w' (
|
|
15
|
+
Dirty#awful has boolean parameter 'log' (BooleanParameter)
|
|
16
|
+
Dirty#awful has the parameter name 'x' (UncommunicativeParameterName)
|
|
17
|
+
Dirty#awful has the parameter name 'y' (UncommunicativeParameterName)
|
|
18
|
+
Dirty#awful has the variable name 'w' (UncommunicativeVariableName)
|
|
19
19
|
|
|
20
20
|
"""
|
data/features/samples.feature
CHANGED
|
@@ -2,176 +2,168 @@
|
|
|
2
2
|
Feature: Basic smell detection
|
|
3
3
|
In order to write better software
|
|
4
4
|
As a developer
|
|
5
|
-
I want to detect the
|
|
5
|
+
I want to detect the smells in my Ruby code
|
|
6
6
|
|
|
7
7
|
@inline
|
|
8
8
|
Scenario: Correct smells from inline.rb
|
|
9
9
|
When I run reek spec/samples/inline.rb
|
|
10
10
|
Then the exit status indicates smells
|
|
11
|
-
And it reports:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Module#inline has approx 11 statements (LongMethod)
|
|
54
|
-
Module#inline is controlled by argument options (ControlCouple)
|
|
55
|
-
|
|
56
|
-
"""
|
|
11
|
+
And it reports something like: spec/samples/inline.rb -- 41 warnings:
|
|
12
|
+
And it reports something like: File has no descriptive comment (IrresponsibleModule)
|
|
13
|
+
And it reports something like: Inline declares the class variable @@directory (ClassVariable)
|
|
14
|
+
And it reports something like: Inline declares the class variable @@rootdir (ClassVariable)
|
|
15
|
+
And it reports something like: Inline#self.rootdir calls env.nil? twice (DuplicateMethodCall)
|
|
16
|
+
And it reports something like: Inline#self.rootdir has approx 8 statements (TooManyStatements)
|
|
17
|
+
And it reports something like: Inline::C declares the class variable @@type_map (ClassVariable)
|
|
18
|
+
And it reports something like: Inline::C has at least 13 instance variables (TooManyInstanceVariables)
|
|
19
|
+
And it reports something like: Inline::C takes parameters [options, src] to 5 methods (DataClump)
|
|
20
|
+
And it reports something like: Inline::C tests $DEBUG at least 7 times (RepeatedConditional)
|
|
21
|
+
And it reports something like: Inline::C tests $TESTING at least 4 times (RepeatedConditional)
|
|
22
|
+
And it reports something like: Inline::C tests @@type_map.has_key?(type) at least 3 times (RepeatedConditional)
|
|
23
|
+
And it reports something like: Inline::C#build calls ($? == 0) twice (DuplicateMethodCall)
|
|
24
|
+
And it reports something like: Inline::C#build calls Inline.directory 5 times (DuplicateMethodCall)
|
|
25
|
+
And it reports something like: Inline::C#build calls io.puts 6 times (DuplicateMethodCall)
|
|
26
|
+
And it reports something like: Inline::C#build calls io.puts("#endif") twice (DuplicateMethodCall)
|
|
27
|
+
And it reports something like: Inline::C#build calls io.puts("#ifdef __cplusplus") twice (DuplicateMethodCall)
|
|
28
|
+
And it reports something like: Inline::C#build calls module_name twice (DuplicateMethodCall)
|
|
29
|
+
And it reports something like (pending): Inline::C#build calls warn("Output:\n#{result}") twice (DuplicateMethodCall)
|
|
30
|
+
And it reports something like: Inline::C#build contains iterators nested 2 deep (NestedIterators)
|
|
31
|
+
And it reports something like: Inline::C#build has approx 60 statements (TooManyStatements)
|
|
32
|
+
And it reports something like: Inline::C#build has the variable name 'n' (UncommunicativeVariableName)
|
|
33
|
+
And it reports something like: Inline::C#build has the variable name 't' (UncommunicativeVariableName)
|
|
34
|
+
And it reports something like: Inline::C#c has the name 'c' (UncommunicativeMethodName)
|
|
35
|
+
And it reports something like: Inline::C#crap_for_windoze calls Config::CONFIG["libdir"] twice (DuplicateMethodCall)
|
|
36
|
+
And it reports something like: Inline::C#generate calls result.sub!(/\A\n/, "") twice (DuplicateMethodCall)
|
|
37
|
+
And it reports something like: Inline::C#generate calls signature["args"] twice (DuplicateMethodCall)
|
|
38
|
+
And it reports something like: Inline::C#generate calls signature["args"].map twice (DuplicateMethodCall)
|
|
39
|
+
And it reports something like: Inline::C#generate has approx 32 statements (TooManyStatements)
|
|
40
|
+
And it reports something like: Inline::C#initialize calls stack.empty? twice (DuplicateMethodCall)
|
|
41
|
+
And it reports something like: Inline::C#load calls so_name twice (DuplicateMethodCall)
|
|
42
|
+
And it reports something like: Inline::C#module_name has the variable name 'm' (UncommunicativeVariableName)
|
|
43
|
+
And it reports something like: Inline::C#module_name has the variable name 'x' (UncommunicativeVariableName)
|
|
44
|
+
And it reports something like: Inline::C#parse_signature has approx 15 statements (TooManyStatements)
|
|
45
|
+
And it reports something like: Inline::C#parse_signature has boolean parameter 'raw' (BooleanParameter)
|
|
46
|
+
And it reports something like: Inline::C#parse_signature has the variable name 'x' (UncommunicativeVariableName)
|
|
47
|
+
And it reports something like: Inline::C#parse_signature is controlled by argument raw (ControlParameter)
|
|
48
|
+
And it reports something like: Inline::C#strip_comments doesn't depend on instance state (UtilityFunction)
|
|
49
|
+
And it reports something like: Inline::C#strip_comments refers to src more than self (FeatureEnvy)
|
|
50
|
+
And it reports something like: Module#inline calls Inline.const_get(lang) twice (DuplicateMethodCall)
|
|
51
|
+
And it reports something like: Module#inline has approx 11 statements (TooManyStatements)
|
|
52
|
+
And it reports something like: Module#inline is controlled by argument options (ControlParameter)
|
|
57
53
|
|
|
58
54
|
Scenario: Correct smells from optparse.rb
|
|
59
55
|
When I run reek spec/samples/optparse.rb
|
|
60
56
|
Then the exit status indicates smells
|
|
61
|
-
And it reports:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
OptionParser::Switch::PlacedArgument#parse has approx 6 statements (LongMethod)
|
|
172
|
-
OptionParser::Switch::RequiredArgument#parse is controlled by argument arg (ControlCouple)
|
|
173
|
-
|
|
174
|
-
"""
|
|
57
|
+
And it reports something like: spec/samples/optparse.rb -- 109 warnings:
|
|
58
|
+
And it reports something like: OptionParser has at least 42 methods (TooManyMethods)
|
|
59
|
+
And it reports something like: OptionParser has the variable name 'f' (UncommunicativeVariableName)
|
|
60
|
+
And it reports something like: OptionParser has the variable name 'k' (UncommunicativeVariableName)
|
|
61
|
+
And it reports something like: OptionParser has the variable name 'o' (UncommunicativeVariableName)
|
|
62
|
+
And it reports something like: OptionParser has the variable name 's' (UncommunicativeVariableName)
|
|
63
|
+
And it reports something like: OptionParser has the variable name 'v' (UncommunicativeVariableName)
|
|
64
|
+
And it reports something like: OptionParser tests ((argv.size == 1) and Array.===(argv[0])) at least 3 times (RepeatedConditional)
|
|
65
|
+
And it reports something like: OptionParser tests a at least 7 times (RepeatedConditional)
|
|
66
|
+
And it reports something like: OptionParser tests default_pattern at least 7 times (RepeatedConditional)
|
|
67
|
+
And it reports something like: OptionParser tests not_style at least 3 times (RepeatedConditional)
|
|
68
|
+
And it reports something like: OptionParser tests s at least 7 times (RepeatedConditional)
|
|
69
|
+
And it reports something like: OptionParser#complete contains iterators nested 2 deep (NestedIterators)
|
|
70
|
+
And it reports something like: OptionParser#complete has 4 parameters (LongParameterList)
|
|
71
|
+
And it reports something like: OptionParser#complete has boolean parameter 'icase' (BooleanParameter)
|
|
72
|
+
And it reports something like: OptionParser#getopts calls result[opt] = false twice (DuplicateMethodCall)
|
|
73
|
+
And it reports something like: OptionParser#getopts has approx 17 statements (TooManyStatements)
|
|
74
|
+
And it reports something like: OptionParser#load has the variable name 's' (UncommunicativeVariableName)
|
|
75
|
+
And it reports something like: OptionParser#make_switch calls (long << o = q.downcase) twice (DuplicateMethodCall)
|
|
76
|
+
And it reports something like (pending): OptionParser#make_switch calls (sdesc << "-#{q}") twice (DuplicateMethodCall)
|
|
77
|
+
And it reports something like: OptionParser#make_switch calls default_style.guess(arg = a) 4 times (DuplicateMethodCall)
|
|
78
|
+
And it reports something like: OptionParser#make_switch calls notwice(NilClass, klass, "type") twice (DuplicateMethodCall)
|
|
79
|
+
And it reports something like: OptionParser#make_switch calls notwice(a ? (Object) : (TrueClass), klass, "type") twice (DuplicateMethodCall)
|
|
80
|
+
And it reports something like: OptionParser#make_switch calls pattern.method(:convert) twice (DuplicateMethodCall)
|
|
81
|
+
And it reports something like: OptionParser#make_switch calls pattern.method(:convert).to_proc twice (DuplicateMethodCall)
|
|
82
|
+
And it reports something like: OptionParser#make_switch calls pattern.respond_to?(:convert) twice (DuplicateMethodCall)
|
|
83
|
+
And it reports something like: OptionParser#make_switch calls q.downcase 3 times (DuplicateMethodCall)
|
|
84
|
+
And it reports something like: OptionParser#make_switch calls search(:atype, FalseClass) twice (DuplicateMethodCall)
|
|
85
|
+
And it reports something like: OptionParser#make_switch calls search(:atype, o) 6 times (DuplicateMethodCall)
|
|
86
|
+
And it reports something like: OptionParser#make_switch contains iterators nested 2 deep (NestedIterators)
|
|
87
|
+
And it reports something like: OptionParser#make_switch contains iterators nested 3 deep (NestedIterators)
|
|
88
|
+
And it reports something like: OptionParser#make_switch has approx 68 statements (TooManyStatements)
|
|
89
|
+
And it reports something like: OptionParser#make_switch has the variable name 'a' (UncommunicativeVariableName)
|
|
90
|
+
And it reports something like: OptionParser#make_switch has the variable name 'c' (UncommunicativeVariableName)
|
|
91
|
+
And it reports something like: OptionParser#make_switch has the variable name 'n' (UncommunicativeVariableName)
|
|
92
|
+
And it reports something like: OptionParser#make_switch has the variable name 'o' (UncommunicativeVariableName)
|
|
93
|
+
And it reports something like: OptionParser#make_switch has the variable name 'q' (UncommunicativeVariableName)
|
|
94
|
+
And it reports something like: OptionParser#make_switch has the variable name 's' (UncommunicativeVariableName)
|
|
95
|
+
And it reports something like: OptionParser#make_switch has the variable name 'v' (UncommunicativeVariableName)
|
|
96
|
+
And it reports something like: OptionParser#order calls argv[0] twice (DuplicateMethodCall)
|
|
97
|
+
And it reports something like: OptionParser#order refers to argv more than self (FeatureEnvy)
|
|
98
|
+
And it reports something like: OptionParser#parse calls argv[0] twice (DuplicateMethodCall)
|
|
99
|
+
And it reports something like: OptionParser#parse refers to argv more than self (FeatureEnvy)
|
|
100
|
+
And it reports something like: OptionParser#parse_in_order calls $!.set_option(arg, true) twice (DuplicateMethodCall)
|
|
101
|
+
And it reports something like: OptionParser#parse_in_order calls cb.call(val) twice (DuplicateMethodCall)
|
|
102
|
+
And it reports something like: OptionParser#parse_in_order calls raise($!.set_option(arg, true)) twice (DuplicateMethodCall)
|
|
103
|
+
And it reports something like: OptionParser#parse_in_order calls raise(*exc) twice (DuplicateMethodCall)
|
|
104
|
+
And it reports something like: OptionParser#parse_in_order calls setter.call(sw.switch_name, val) twice (DuplicateMethodCall)
|
|
105
|
+
And it reports something like: OptionParser#parse_in_order calls sw.block twice (DuplicateMethodCall)
|
|
106
|
+
And it reports something like: OptionParser#parse_in_order calls sw.switch_name twice (DuplicateMethodCall)
|
|
107
|
+
And it reports something like: OptionParser#parse_in_order contains iterators nested 2 deep (NestedIterators)
|
|
108
|
+
And it reports something like: OptionParser#parse_in_order contains iterators nested 3 deep (NestedIterators)
|
|
109
|
+
And it reports something like: OptionParser#parse_in_order has approx 28 statements (TooManyStatements)
|
|
110
|
+
And it reports something like: OptionParser#parse_in_order is controlled by argument setter (ControlParameter)
|
|
111
|
+
And it reports something like: OptionParser#permute calls argv[0] twice (DuplicateMethodCall)
|
|
112
|
+
And it reports something like: OptionParser#permute refers to argv more than self (FeatureEnvy)
|
|
113
|
+
And it reports something like: OptionParser#search has the variable name 'k' (UncommunicativeVariableName)
|
|
114
|
+
And it reports something like: OptionParser#summarize has 4 parameters (LongParameterList)
|
|
115
|
+
And it reports something like: OptionParser#summarize has the variable name 'l' (UncommunicativeVariableName)
|
|
116
|
+
And it reports something like: OptionParser#ver has the variable name 'v' (UncommunicativeVariableName)
|
|
117
|
+
And it reports something like: OptionParser::CompletingHash#match contains iterators nested 2 deep (NestedIterators)
|
|
118
|
+
And it reports something like: OptionParser::Completion#complete calls candidates.size twice (DuplicateMethodCall)
|
|
119
|
+
And it reports something like: OptionParser::Completion#complete calls k.id2name twice (DuplicateMethodCall)
|
|
120
|
+
And it reports something like: OptionParser::Completion#complete has approx 22 statements (TooManyStatements)
|
|
121
|
+
And it reports something like: OptionParser::Completion#complete has boolean parameter 'icase' (BooleanParameter)
|
|
122
|
+
And it reports something like: OptionParser::Completion#complete has the variable name 'k' (UncommunicativeVariableName)
|
|
123
|
+
And it reports something like: OptionParser::Completion#complete has the variable name 'v' (UncommunicativeVariableName)
|
|
124
|
+
And it reports something like: OptionParser::Completion#complete refers to candidates more than self (FeatureEnvy)
|
|
125
|
+
And it reports something like: OptionParser::List#accept has the parameter name 't' (UncommunicativeParameterName)
|
|
126
|
+
And it reports something like: OptionParser::List#accept is controlled by argument pat (ControlParameter)
|
|
127
|
+
And it reports something like: OptionParser::List#accept refers to pat more than self (FeatureEnvy)
|
|
128
|
+
And it reports something like: OptionParser::List#add_banner refers to opt more than self (FeatureEnvy)
|
|
129
|
+
And it reports something like: OptionParser::List#complete has 4 parameters (LongParameterList)
|
|
130
|
+
And it reports something like: OptionParser::List#complete has boolean parameter 'icase' (BooleanParameter)
|
|
131
|
+
And it reports something like: OptionParser::List#reject has the parameter name 't' (UncommunicativeParameterName)
|
|
132
|
+
And it reports something like: OptionParser::List#summarize refers to opt more than self (FeatureEnvy)
|
|
133
|
+
And it reports something like: OptionParser::List#update has 5 parameters (LongParameterList)
|
|
134
|
+
And it reports something like: OptionParser::List#update has approx 6 statements (TooManyStatements)
|
|
135
|
+
And it reports something like: OptionParser::List#update has the variable name 'o' (UncommunicativeVariableName)
|
|
136
|
+
And it reports something like: OptionParser::List#update is controlled by argument lopts (ControlParameter)
|
|
137
|
+
And it reports something like: OptionParser::List#update is controlled by argument sopts (ControlParameter)
|
|
138
|
+
And it reports something like: OptionParser::ParseError#set_option is controlled by argument eq (ControlParameter)
|
|
139
|
+
And it reports something like: OptionParser::Switch#add_banner has the variable name 's' (UncommunicativeVariableName)
|
|
140
|
+
And it reports something like: OptionParser::Switch#conv_arg calls conv twice (DuplicateMethodCall)
|
|
141
|
+
And it reports something like: OptionParser::Switch#initialize has 7 parameters (LongParameterList)
|
|
142
|
+
And it reports something like: OptionParser::Switch#parse_arg calls pattern twice (DuplicateMethodCall)
|
|
143
|
+
And it reports something like: OptionParser::Switch#parse_arg calls s.length twice (DuplicateMethodCall)
|
|
144
|
+
And it reports something like: OptionParser::Switch#parse_arg has approx 11 statements (TooManyStatements)
|
|
145
|
+
And it reports something like: OptionParser::Switch#parse_arg has the variable name 'm' (UncommunicativeVariableName)
|
|
146
|
+
And it reports something like: OptionParser::Switch#parse_arg has the variable name 's' (UncommunicativeVariableName)
|
|
147
|
+
And it reports something like: OptionParser::Switch#self.guess has the variable name 't' (UncommunicativeVariableName)
|
|
148
|
+
And it reports something like: OptionParser::Switch#self.incompatible_argument_styles has the parameter name 't' (UncommunicativeParameterName)
|
|
149
|
+
And it reports something like: OptionParser::Switch#summarize calls (indent + l) twice (DuplicateMethodCall)
|
|
150
|
+
And it reports something like: OptionParser::Switch#summarize calls arg 4 times (DuplicateMethodCall)
|
|
151
|
+
And it reports something like: OptionParser::Switch#summarize calls left.collect twice (DuplicateMethodCall)
|
|
152
|
+
And it reports something like: OptionParser::Switch#summarize calls left.collect { |s| s.length }.max twice (DuplicateMethodCall)
|
|
153
|
+
And it reports something like: OptionParser::Switch#summarize calls left.collect { |s| s.length }.max.to_i twice (DuplicateMethodCall)
|
|
154
|
+
And it reports something like: OptionParser::Switch#summarize calls left.shift twice (DuplicateMethodCall)
|
|
155
|
+
And it reports something like: OptionParser::Switch#summarize calls left[-1] 3 times (DuplicateMethodCall)
|
|
156
|
+
And it reports something like: OptionParser::Switch#summarize calls s.length 3 times (DuplicateMethodCall)
|
|
157
|
+
And it reports something like: OptionParser::Switch#summarize contains iterators nested 2 deep (NestedIterators)
|
|
158
|
+
And it reports something like: OptionParser::Switch#summarize has 5 parameters (LongParameterList)
|
|
159
|
+
And it reports something like: OptionParser::Switch#summarize has approx 25 statements (TooManyStatements)
|
|
160
|
+
And it reports something like: OptionParser::Switch#summarize has the variable name 'l' (UncommunicativeVariableName)
|
|
161
|
+
And it reports something like: OptionParser::Switch#summarize has the variable name 'r' (UncommunicativeVariableName)
|
|
162
|
+
And it reports something like: OptionParser::Switch#summarize has the variable name 's' (UncommunicativeVariableName)
|
|
163
|
+
And it reports something like: OptionParser::Switch::NoArgument#parse is controlled by argument arg (ControlParameter)
|
|
164
|
+
And it reports something like: OptionParser::Switch::OptionalArgument#parse is controlled by argument arg (ControlParameter)
|
|
165
|
+
And it reports something like: OptionParser::Switch::PlacedArgument#parse has approx 6 statements (TooManyStatements)
|
|
166
|
+
And it reports something like: OptionParser::Switch::RequiredArgument#parse is controlled by argument arg (ControlParameter)
|
|
175
167
|
|
|
176
168
|
Scenario: Correct smells from redcloth.rb
|
|
177
169
|
When I run reek spec/samples/redcloth.rb
|
|
@@ -179,102 +171,102 @@ Feature: Basic smell detection
|
|
|
179
171
|
And it reports:
|
|
180
172
|
"""
|
|
181
173
|
spec/samples/redcloth.rb -- 97 warnings:
|
|
182
|
-
RedCloth has at least 44 methods (
|
|
183
|
-
RedCloth has the variable name 'a' (
|
|
184
|
-
RedCloth has the variable name 'b' (
|
|
174
|
+
RedCloth has at least 44 methods (TooManyMethods)
|
|
175
|
+
RedCloth has the variable name 'a' (UncommunicativeVariableName)
|
|
176
|
+
RedCloth has the variable name 'b' (UncommunicativeVariableName)
|
|
185
177
|
RedCloth takes parameters [atts, cite, content, tag] to 3 methods (DataClump)
|
|
186
|
-
RedCloth tests atts at least 6 times (
|
|
187
|
-
RedCloth tests codepre.zero? at least 3 times (
|
|
188
|
-
RedCloth tests href at least 3 times (
|
|
189
|
-
RedCloth tests title at least 4 times (
|
|
190
|
-
RedCloth#block_markdown_atx refers to text more than self (
|
|
191
|
-
RedCloth#block_markdown_bq has approx 6 statements (
|
|
192
|
-
RedCloth#block_markdown_rule refers to text more than self (
|
|
193
|
-
RedCloth#block_markdown_setext refers to text more than self (
|
|
194
|
-
RedCloth#block_textile_lists calls (line_id - 1) twice (
|
|
195
|
-
RedCloth#block_textile_lists calls depth.last 5 times (
|
|
196
|
-
RedCloth#block_textile_lists calls depth.last.length twice (
|
|
197
|
-
RedCloth#block_textile_lists calls depth[i] twice (
|
|
198
|
-
RedCloth#block_textile_lists calls lines[(line_id - 1)] twice (
|
|
199
|
-
RedCloth#block_textile_lists calls tl.length 3 times (
|
|
178
|
+
RedCloth tests atts at least 6 times (RepeatedConditional)
|
|
179
|
+
RedCloth tests codepre.zero? at least 3 times (RepeatedConditional)
|
|
180
|
+
RedCloth tests href at least 3 times (RepeatedConditional)
|
|
181
|
+
RedCloth tests title at least 4 times (RepeatedConditional)
|
|
182
|
+
RedCloth#block_markdown_atx refers to text more than self (FeatureEnvy)
|
|
183
|
+
RedCloth#block_markdown_bq has approx 6 statements (TooManyStatements)
|
|
184
|
+
RedCloth#block_markdown_rule refers to text more than self (FeatureEnvy)
|
|
185
|
+
RedCloth#block_markdown_setext refers to text more than self (FeatureEnvy)
|
|
186
|
+
RedCloth#block_textile_lists calls (line_id - 1) twice (DuplicateMethodCall)
|
|
187
|
+
RedCloth#block_textile_lists calls depth.last 5 times (DuplicateMethodCall)
|
|
188
|
+
RedCloth#block_textile_lists calls depth.last.length twice (DuplicateMethodCall)
|
|
189
|
+
RedCloth#block_textile_lists calls depth[i] twice (DuplicateMethodCall)
|
|
190
|
+
RedCloth#block_textile_lists calls lines[(line_id - 1)] twice (DuplicateMethodCall)
|
|
191
|
+
RedCloth#block_textile_lists calls tl.length 3 times (DuplicateMethodCall)
|
|
200
192
|
RedCloth#block_textile_lists contains iterators nested 3 deep (NestedIterators)
|
|
201
|
-
RedCloth#block_textile_lists has approx 20 statements (
|
|
202
|
-
RedCloth#block_textile_lists has the variable name 'i' (
|
|
203
|
-
RedCloth#block_textile_lists has the variable name 'v' (
|
|
204
|
-
RedCloth#block_textile_lists refers to depth more than self (
|
|
193
|
+
RedCloth#block_textile_lists has approx 20 statements (TooManyStatements)
|
|
194
|
+
RedCloth#block_textile_lists has the variable name 'i' (UncommunicativeVariableName)
|
|
195
|
+
RedCloth#block_textile_lists has the variable name 'v' (UncommunicativeVariableName)
|
|
196
|
+
RedCloth#block_textile_lists refers to depth more than self (FeatureEnvy)
|
|
205
197
|
RedCloth#block_textile_table contains iterators nested 2 deep (NestedIterators)
|
|
206
198
|
RedCloth#block_textile_table contains iterators nested 3 deep (NestedIterators)
|
|
207
|
-
RedCloth#block_textile_table has approx 18 statements (
|
|
208
|
-
RedCloth#block_textile_table has the variable name 'x' (
|
|
199
|
+
RedCloth#block_textile_table has approx 18 statements (TooManyStatements)
|
|
200
|
+
RedCloth#block_textile_table has the variable name 'x' (UncommunicativeVariableName)
|
|
209
201
|
RedCloth#blocks contains iterators nested 2 deep (NestedIterators)
|
|
210
|
-
RedCloth#blocks has approx 18 statements (
|
|
211
|
-
RedCloth#blocks has boolean parameter 'deep_code' (
|
|
212
|
-
RedCloth#blocks is controlled by argument deep_code (
|
|
213
|
-
RedCloth#check_refs is controlled by argument text (
|
|
214
|
-
RedCloth#clean_html calls tags[tag] twice (
|
|
202
|
+
RedCloth#blocks has approx 18 statements (TooManyStatements)
|
|
203
|
+
RedCloth#blocks has boolean parameter 'deep_code' (BooleanParameter)
|
|
204
|
+
RedCloth#blocks is controlled by argument deep_code (ControlParameter)
|
|
205
|
+
RedCloth#check_refs is controlled by argument text (ControlParameter)
|
|
206
|
+
RedCloth#clean_html calls tags[tag] twice (DuplicateMethodCall)
|
|
215
207
|
RedCloth#clean_html contains iterators nested 3 deep (NestedIterators)
|
|
216
|
-
RedCloth#clean_html doesn't depend on instance state (
|
|
217
|
-
RedCloth#clean_html has approx 14 statements (
|
|
218
|
-
RedCloth#clean_html has the variable name 'q' (
|
|
219
|
-
RedCloth#clean_html has the variable name 'q2' (
|
|
220
|
-
RedCloth#clean_html refers to raw more than self (
|
|
221
|
-
RedCloth#clean_html refers to tags more than self (
|
|
222
|
-
RedCloth#clean_white_space has approx 7 statements (
|
|
223
|
-
RedCloth#clean_white_space refers to text more than self (
|
|
224
|
-
RedCloth#flush_left doesn't depend on instance state (
|
|
225
|
-
RedCloth#flush_left refers to indt more than self (
|
|
226
|
-
RedCloth#flush_left refers to text more than self (
|
|
227
|
-
RedCloth#footnote_ref refers to text more than self (
|
|
228
|
-
RedCloth#glyphs_textile has approx 10 statements (
|
|
229
|
-
RedCloth#htmlesc doesn't depend on instance state (
|
|
230
|
-
RedCloth#htmlesc refers to str more than self (
|
|
231
|
-
RedCloth#incoming_entities refers to text more than self (
|
|
232
|
-
RedCloth#initialize has the variable name 'r' (
|
|
208
|
+
RedCloth#clean_html doesn't depend on instance state (UtilityFunction)
|
|
209
|
+
RedCloth#clean_html has approx 14 statements (TooManyStatements)
|
|
210
|
+
RedCloth#clean_html has the variable name 'q' (UncommunicativeVariableName)
|
|
211
|
+
RedCloth#clean_html has the variable name 'q2' (UncommunicativeVariableName)
|
|
212
|
+
RedCloth#clean_html refers to raw more than self (FeatureEnvy)
|
|
213
|
+
RedCloth#clean_html refers to tags more than self (FeatureEnvy)
|
|
214
|
+
RedCloth#clean_white_space has approx 7 statements (TooManyStatements)
|
|
215
|
+
RedCloth#clean_white_space refers to text more than self (FeatureEnvy)
|
|
216
|
+
RedCloth#flush_left doesn't depend on instance state (UtilityFunction)
|
|
217
|
+
RedCloth#flush_left refers to indt more than self (FeatureEnvy)
|
|
218
|
+
RedCloth#flush_left refers to text more than self (FeatureEnvy)
|
|
219
|
+
RedCloth#footnote_ref refers to text more than self (FeatureEnvy)
|
|
220
|
+
RedCloth#glyphs_textile has approx 10 statements (TooManyStatements)
|
|
221
|
+
RedCloth#htmlesc doesn't depend on instance state (UtilityFunction)
|
|
222
|
+
RedCloth#htmlesc refers to str more than self (FeatureEnvy)
|
|
223
|
+
RedCloth#incoming_entities refers to text more than self (FeatureEnvy)
|
|
224
|
+
RedCloth#initialize has the variable name 'r' (UncommunicativeVariableName)
|
|
233
225
|
RedCloth#inline contains iterators nested 2 deep (NestedIterators)
|
|
234
|
-
RedCloth#inline_markdown_link has approx 6 statements (
|
|
235
|
-
RedCloth#inline_markdown_link has the variable name 'm' (
|
|
236
|
-
RedCloth#inline_markdown_reflink has approx 8 statements (
|
|
237
|
-
RedCloth#inline_markdown_reflink has the variable name 'm' (
|
|
238
|
-
RedCloth#inline_textile_code has the variable name 'm' (
|
|
239
|
-
RedCloth#inline_textile_image has approx 17 statements (
|
|
240
|
-
RedCloth#inline_textile_image has the variable name 'href_a1' (
|
|
241
|
-
RedCloth#inline_textile_image has the variable name 'href_a2' (
|
|
242
|
-
RedCloth#inline_textile_image has the variable name 'm' (
|
|
243
|
-
RedCloth#inline_textile_link has approx 9 statements (
|
|
244
|
-
RedCloth#inline_textile_link has the variable name 'm' (
|
|
226
|
+
RedCloth#inline_markdown_link has approx 6 statements (TooManyStatements)
|
|
227
|
+
RedCloth#inline_markdown_link has the variable name 'm' (UncommunicativeVariableName)
|
|
228
|
+
RedCloth#inline_markdown_reflink has approx 8 statements (TooManyStatements)
|
|
229
|
+
RedCloth#inline_markdown_reflink has the variable name 'm' (UncommunicativeVariableName)
|
|
230
|
+
RedCloth#inline_textile_code has the variable name 'm' (UncommunicativeVariableName)
|
|
231
|
+
RedCloth#inline_textile_image has approx 17 statements (TooManyStatements)
|
|
232
|
+
RedCloth#inline_textile_image has the variable name 'href_a1' (UncommunicativeVariableName)
|
|
233
|
+
RedCloth#inline_textile_image has the variable name 'href_a2' (UncommunicativeVariableName)
|
|
234
|
+
RedCloth#inline_textile_image has the variable name 'm' (UncommunicativeVariableName)
|
|
235
|
+
RedCloth#inline_textile_link has approx 9 statements (TooManyStatements)
|
|
236
|
+
RedCloth#inline_textile_link has the variable name 'm' (UncommunicativeVariableName)
|
|
245
237
|
RedCloth#inline_textile_span contains iterators nested 2 deep (NestedIterators)
|
|
246
|
-
RedCloth#inline_textile_span has approx 8 statements (
|
|
247
|
-
RedCloth#inline_textile_span has the variable name 'm' (
|
|
248
|
-
RedCloth#lT has the name 'lT' (
|
|
249
|
-
RedCloth#no_textile doesn't depend on instance state (
|
|
250
|
-
RedCloth#no_textile refers to text more than self (
|
|
251
|
-
RedCloth#pba calls $1.length twice (
|
|
252
|
-
RedCloth#pba has approx 21 statements (
|
|
253
|
-
RedCloth#pba is controlled by argument text_in (
|
|
254
|
-
RedCloth#pba refers to style more than self (
|
|
255
|
-
RedCloth#pba refers to text more than self (
|
|
256
|
-
RedCloth#refs_markdown has the variable name 'm' (
|
|
257
|
-
RedCloth#refs_textile has the variable name 'm' (
|
|
258
|
-
RedCloth#retrieve has the variable name 'i' (
|
|
259
|
-
RedCloth#retrieve has the variable name 'r' (
|
|
260
|
-
RedCloth#rip_offtags calls ((codepre - used_offtags.length) > 0) twice (
|
|
261
|
-
RedCloth#rip_offtags calls (@pre_list.last << line) twice (
|
|
262
|
-
RedCloth#rip_offtags calls (codepre - used_offtags.length) twice (
|
|
263
|
-
RedCloth#rip_offtags calls @pre_list.last twice (
|
|
264
|
-
RedCloth#rip_offtags calls codepre.zero? twice (
|
|
265
|
-
RedCloth#rip_offtags calls htmlesc(line, :NoQuotes) twice (
|
|
266
|
-
RedCloth#rip_offtags calls used_offtags.length twice (
|
|
267
|
-
RedCloth#rip_offtags calls used_offtags["notextile"] 3 times (
|
|
268
|
-
RedCloth#rip_offtags has approx 18 statements (
|
|
238
|
+
RedCloth#inline_textile_span has approx 8 statements (TooManyStatements)
|
|
239
|
+
RedCloth#inline_textile_span has the variable name 'm' (UncommunicativeVariableName)
|
|
240
|
+
RedCloth#lT has the name 'lT' (UncommunicativeMethodName)
|
|
241
|
+
RedCloth#no_textile doesn't depend on instance state (UtilityFunction)
|
|
242
|
+
RedCloth#no_textile refers to text more than self (FeatureEnvy)
|
|
243
|
+
RedCloth#pba calls $1.length twice (DuplicateMethodCall)
|
|
244
|
+
RedCloth#pba has approx 21 statements (TooManyStatements)
|
|
245
|
+
RedCloth#pba is controlled by argument text_in (ControlParameter)
|
|
246
|
+
RedCloth#pba refers to style more than self (FeatureEnvy)
|
|
247
|
+
RedCloth#pba refers to text more than self (FeatureEnvy)
|
|
248
|
+
RedCloth#refs_markdown has the variable name 'm' (UncommunicativeVariableName)
|
|
249
|
+
RedCloth#refs_textile has the variable name 'm' (UncommunicativeVariableName)
|
|
250
|
+
RedCloth#retrieve has the variable name 'i' (UncommunicativeVariableName)
|
|
251
|
+
RedCloth#retrieve has the variable name 'r' (UncommunicativeVariableName)
|
|
252
|
+
RedCloth#rip_offtags calls ((codepre - used_offtags.length) > 0) twice (DuplicateMethodCall)
|
|
253
|
+
RedCloth#rip_offtags calls (@pre_list.last << line) twice (DuplicateMethodCall)
|
|
254
|
+
RedCloth#rip_offtags calls (codepre - used_offtags.length) twice (DuplicateMethodCall)
|
|
255
|
+
RedCloth#rip_offtags calls @pre_list.last twice (DuplicateMethodCall)
|
|
256
|
+
RedCloth#rip_offtags calls codepre.zero? twice (DuplicateMethodCall)
|
|
257
|
+
RedCloth#rip_offtags calls htmlesc(line, :NoQuotes) twice (DuplicateMethodCall)
|
|
258
|
+
RedCloth#rip_offtags calls used_offtags.length twice (DuplicateMethodCall)
|
|
259
|
+
RedCloth#rip_offtags calls used_offtags["notextile"] 3 times (DuplicateMethodCall)
|
|
260
|
+
RedCloth#rip_offtags has approx 18 statements (TooManyStatements)
|
|
269
261
|
RedCloth#textile_bq has 4 parameters (LongParameterList)
|
|
270
|
-
RedCloth#textile_bq is controlled by argument atts (
|
|
271
|
-
RedCloth#textile_bq is controlled by argument cite (
|
|
262
|
+
RedCloth#textile_bq is controlled by argument atts (ControlParameter)
|
|
263
|
+
RedCloth#textile_bq is controlled by argument cite (ControlParameter)
|
|
272
264
|
RedCloth#textile_fn_ has 5 parameters (LongParameterList)
|
|
273
|
-
RedCloth#textile_fn_ is controlled by argument atts (
|
|
265
|
+
RedCloth#textile_fn_ is controlled by argument atts (ControlParameter)
|
|
274
266
|
RedCloth#textile_p has 4 parameters (LongParameterList)
|
|
275
|
-
RedCloth#textile_p is controlled by argument atts (
|
|
276
|
-
RedCloth#textile_popup_help has the parameter name 'windowH' (
|
|
277
|
-
RedCloth#textile_popup_help has the parameter name 'windowW' (
|
|
278
|
-
RedCloth#to_html has approx 24 statements (
|
|
267
|
+
RedCloth#textile_p is controlled by argument atts (ControlParameter)
|
|
268
|
+
RedCloth#textile_popup_help has the parameter name 'windowH' (UncommunicativeParameterName)
|
|
269
|
+
RedCloth#textile_popup_help has the parameter name 'windowW' (UncommunicativeParameterName)
|
|
270
|
+
RedCloth#to_html has approx 24 statements (TooManyStatements)
|
|
279
271
|
|
|
280
272
|
"""
|