tuxedo 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +41 -0
- data/README.md +5 -0
- data/Rakefile +30 -0
- data/bin/tuxedo +4 -0
- data/data/sample_cane_output.txt +32 -0
- data/data/sample_reek_output.yml +534 -0
- data/data/sample_reek_output_clean.yml +534 -0
- data/lib/tuxedo.rb +26 -0
- data/lib/tuxedo/cane_parser.rb +64 -0
- data/lib/tuxedo/cane_violation.rb +31 -0
- data/lib/tuxedo/cane_violation/abc_max_violation.rb +37 -0
- data/lib/tuxedo/cane_violation/style_violation.rb +40 -0
- data/lib/tuxedo/cane_violation/syntax_violation.rb +27 -0
- data/lib/tuxedo/cane_violation/threshold_violation.rb +33 -0
- data/lib/tuxedo/cane_violation/undocumented_class_violation.rb +35 -0
- data/lib/tuxedo/cli.rb +18 -0
- data/lib/tuxedo/error.rb +15 -0
- data/lib/tuxedo/formatters/base_formatter.rb +17 -0
- data/lib/tuxedo/formatters/base_text_formatter.rb +13 -0
- data/lib/tuxedo/formatters/cane_text_formatter.rb +68 -0
- data/lib/tuxedo/outputter.rb +16 -0
- data/lib/tuxedo/rake_task.rb +29 -0
- data/lib/tuxedo/reek_parser.rb +54 -0
- data/lib/tuxedo/runner.rb +64 -0
- data/lib/tuxedo/tty.rb +116 -0
- data/lib/tuxedo/version.rb +3 -0
- data/spec/fabricators/cane_output_fabricator.rb +0 -0
- data/spec/helpers/cane_output_helper.rb +42 -0
- data/spec/helpers/reek_output_helper.rb +613 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/tuxedo/cane_parser_spec.rb +63 -0
- data/spec/tuxedo/reek_parser_spec.rb +49 -0
- data/tuxedo.gemspec +32 -0
- metadata +173 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use ruby-1.9.3@tuxedo --create
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tuxedo (0.9.1)
|
5
|
+
cane
|
6
|
+
reek
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
cane (1.3.0)
|
12
|
+
diff-lcs (1.1.3)
|
13
|
+
fabrication (1.4.0)
|
14
|
+
rake (0.9.2.2)
|
15
|
+
reek (1.2.8)
|
16
|
+
ruby2ruby (~> 1.2)
|
17
|
+
ruby_parser (~> 2.0)
|
18
|
+
sexp_processor (~> 3.0)
|
19
|
+
rspec (2.10.0)
|
20
|
+
rspec-core (~> 2.10.0)
|
21
|
+
rspec-expectations (~> 2.10.0)
|
22
|
+
rspec-mocks (~> 2.10.0)
|
23
|
+
rspec-core (2.10.0)
|
24
|
+
rspec-expectations (2.10.0)
|
25
|
+
diff-lcs (~> 1.1.3)
|
26
|
+
rspec-mocks (2.10.1)
|
27
|
+
ruby2ruby (1.3.1)
|
28
|
+
ruby_parser (~> 2.0)
|
29
|
+
sexp_processor (~> 3.0)
|
30
|
+
ruby_parser (2.3.1)
|
31
|
+
sexp_processor (~> 3.0)
|
32
|
+
sexp_processor (3.2.0)
|
33
|
+
|
34
|
+
PLATFORMS
|
35
|
+
ruby
|
36
|
+
|
37
|
+
DEPENDENCIES
|
38
|
+
fabrication
|
39
|
+
rake
|
40
|
+
rspec
|
41
|
+
tuxedo!
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rspec/core/rake_task'
|
2
|
+
require './lib/tuxedo/rake_task'
|
3
|
+
require 'tuxedo/rake_task'
|
4
|
+
require 'bundler'
|
5
|
+
|
6
|
+
Bundler::GemHelper.install_tasks
|
7
|
+
|
8
|
+
Tuxedo::RakeTask.new do
|
9
|
+
end
|
10
|
+
|
11
|
+
RSpec::Core::RakeTask.new do |t|
|
12
|
+
t.pattern = "./spec/**/*_spec.rb"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Taken from RefineryCMS
|
16
|
+
# https://github.com/resolve/refinerycms/blob/master/core/lib/tasks/refinery.rake
|
17
|
+
desc 'Removes trailing whitespace across the entire application.'
|
18
|
+
task :whitespace do
|
19
|
+
require 'rbconfig'
|
20
|
+
|
21
|
+
Dir.chdir(File.expand_path("..", __FILE__)) do
|
22
|
+
if RbConfig::CONFIG['host_os'] =~ /linux/
|
23
|
+
sh %{find . -name '*.*rb' -exec sed -i 's/\t/ /g' {} \\; -exec sed -i 's/ *$//g' {} \\; }
|
24
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin/
|
25
|
+
sh %{find . -name '*.*rb' -exec sed -i '' 's/\t/ /g' {} \\; -exec sed -i '' 's/ *$//g' {} \\; }
|
26
|
+
else
|
27
|
+
puts "This doesn't work on systems other than OSX or Linux. Please use a custom whitespace tool for your platform '#{RbConfig::CONFIG["host_os"]}'."
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/bin/tuxedo
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
Methods exceeded maximum allowed ABC complexity (2):
|
2
|
+
|
3
|
+
app/controllers/orders_controller.rb OrdersController > create 23
|
4
|
+
app/controllers/user_sessions_controller.rb UserSessionsController > create 19
|
5
|
+
|
6
|
+
Lines violated style requirements (16):
|
7
|
+
|
8
|
+
app/controllers/carts_controller.rb:4 Line contains trailing whitespaces
|
9
|
+
app/controllers/products_controller.rb:47 Line is >80 characters (89)
|
10
|
+
app/controllers/products_controller.rb:48 Line is >80 characters (83)
|
11
|
+
app/controllers/products_controller.rb:51 Line is >80 characters (83)
|
12
|
+
app/controllers/products_controller.rb:63 Line is >80 characters (89)
|
13
|
+
app/controllers/products_controller.rb:67 Line is >80 characters (83)
|
14
|
+
spec/acceptance/public_user_views_products_spec.rb:9 Line contains trailing whitespaces
|
15
|
+
spec/controllers/products_controller_spec.rb:29 Line contains trailing whitespaces
|
16
|
+
spec/controllers/products_controller_spec.rb:113 Line is >80 characters (91)
|
17
|
+
spec/controllers/products_controller_spec.rb:114 Line is >80 characters (96)
|
18
|
+
spec/controllers/products_controller_spec.rb:119 Line is >80 characters (91)
|
19
|
+
spec/controllers/products_controller_spec.rb:125 Line is >80 characters (91)
|
20
|
+
spec/requests/products_spec.rb:6 Line is >80 characters (97)
|
21
|
+
spec/spec_helper.rb:12 Line contains trailing whitespaces
|
22
|
+
spec/support/example_data/products.rb:13 Line is >80 characters (126)
|
23
|
+
spec/support/example_data/projects.rb:12 Line is >80 characters (128)
|
24
|
+
|
25
|
+
Classes are not documented (6):
|
26
|
+
|
27
|
+
app/controllers/application_controller.rb:1 ApplicationController
|
28
|
+
app/controllers/carts_controller.rb:1 CartsController
|
29
|
+
app/controllers/products_controller.rb:1 ProductsController
|
30
|
+
app/models/cart.rb:1 Cart
|
31
|
+
app/models/cart_item.rb:1 CartItem
|
32
|
+
app/models/product.rb:1 Product
|
@@ -0,0 +1,534 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/object:Reek::SmellWarning
|
3
|
+
smell:
|
4
|
+
class: IrresponsibleModule
|
5
|
+
subclass: IrresponsibleModule
|
6
|
+
message: has no descriptive comment
|
7
|
+
module_name: Customer
|
8
|
+
status:
|
9
|
+
is_active: true
|
10
|
+
location:
|
11
|
+
context: SalesEngine::Customer
|
12
|
+
lines:
|
13
|
+
- 2
|
14
|
+
source: ./lib/sales_engine/customer.rb
|
15
|
+
- !ruby/object:Reek::SmellWarning
|
16
|
+
smell:
|
17
|
+
class: Duplication
|
18
|
+
subclass: DuplicateMethodCall
|
19
|
+
message: calls invoice.merchant 3 times
|
20
|
+
call: invoice.merchant
|
21
|
+
occurrences: 3
|
22
|
+
status:
|
23
|
+
is_active: true
|
24
|
+
location:
|
25
|
+
context: SalesEngine::Customer#favorite_merchant
|
26
|
+
lines:
|
27
|
+
- 26
|
28
|
+
- 27
|
29
|
+
- 29
|
30
|
+
source: ./lib/sales_engine/customer.rb
|
31
|
+
- !ruby/object:Reek::SmellWarning
|
32
|
+
smell:
|
33
|
+
class: LowCohesion
|
34
|
+
subclass: FeatureEnvy
|
35
|
+
message: refers to merchant_invoice_counter more than self
|
36
|
+
receiver: merchant_invoice_counter
|
37
|
+
references: 4
|
38
|
+
status:
|
39
|
+
is_active: true
|
40
|
+
location:
|
41
|
+
context: SalesEngine::Customer#favorite_merchant
|
42
|
+
lines:
|
43
|
+
- 23
|
44
|
+
source: ./lib/sales_engine/customer.rb
|
45
|
+
- !ruby/object:Reek::SmellWarning
|
46
|
+
smell:
|
47
|
+
class: NestedIterators
|
48
|
+
subclass: NestedIterators
|
49
|
+
message: contains iterators nested 2 deep
|
50
|
+
depth: 2
|
51
|
+
status:
|
52
|
+
is_active: true
|
53
|
+
location:
|
54
|
+
context: SalesEngine::Customer#transactions
|
55
|
+
lines:
|
56
|
+
- 18
|
57
|
+
source: ./lib/sales_engine/customer.rb
|
58
|
+
- !ruby/object:Reek::SmellWarning
|
59
|
+
smell:
|
60
|
+
class: LowCohesion
|
61
|
+
subclass: FeatureEnvy
|
62
|
+
message: refers to customer_transactions more than self
|
63
|
+
receiver: customer_transactions
|
64
|
+
references: 2
|
65
|
+
status:
|
66
|
+
is_active: true
|
67
|
+
location:
|
68
|
+
context: SalesEngine::Customer#transactions
|
69
|
+
lines:
|
70
|
+
- 15
|
71
|
+
source: ./lib/sales_engine/customer.rb
|
72
|
+
- !ruby/object:Reek::SmellWarning
|
73
|
+
smell:
|
74
|
+
class: LargeClass
|
75
|
+
subclass: TooManyMethods
|
76
|
+
message: has at least 26 methods
|
77
|
+
method_count: 26
|
78
|
+
status:
|
79
|
+
is_active: true
|
80
|
+
location:
|
81
|
+
context: SalesEngine::Database
|
82
|
+
lines:
|
83
|
+
- 2
|
84
|
+
source: ./lib/sales_engine/database.rb
|
85
|
+
- !ruby/object:Reek::SmellWarning
|
86
|
+
smell:
|
87
|
+
class: IrresponsibleModule
|
88
|
+
subclass: IrresponsibleModule
|
89
|
+
message: has no descriptive comment
|
90
|
+
module_name: Database
|
91
|
+
status:
|
92
|
+
is_active: true
|
93
|
+
location:
|
94
|
+
context: SalesEngine::Database
|
95
|
+
lines:
|
96
|
+
- 2
|
97
|
+
source: ./lib/sales_engine/database.rb
|
98
|
+
- !ruby/object:Reek::SmellWarning
|
99
|
+
smell:
|
100
|
+
class: LowCohesion
|
101
|
+
subclass: FeatureEnvy
|
102
|
+
message: refers to attribute_value more than self
|
103
|
+
receiver: attribute_value
|
104
|
+
references: 3
|
105
|
+
status:
|
106
|
+
is_active: true
|
107
|
+
location:
|
108
|
+
context: SalesEngine::Database#find_all_by
|
109
|
+
lines:
|
110
|
+
- 121
|
111
|
+
source: ./lib/sales_engine/database.rb
|
112
|
+
- !ruby/object:Reek::SmellWarning
|
113
|
+
smell:
|
114
|
+
class: Duplication
|
115
|
+
subclass: DuplicateMethodCall
|
116
|
+
message: calls Time.parse(record.created_at) twice
|
117
|
+
call: Time.parse(record.created_at)
|
118
|
+
occurrences: 2
|
119
|
+
status:
|
120
|
+
is_active: true
|
121
|
+
location:
|
122
|
+
context: SalesEngine::Database#find_all_created_on
|
123
|
+
lines:
|
124
|
+
- 155
|
125
|
+
- 156
|
126
|
+
source: ./lib/sales_engine/database.rb
|
127
|
+
- !ruby/object:Reek::SmellWarning
|
128
|
+
smell:
|
129
|
+
class: Duplication
|
130
|
+
subclass: DuplicateMethodCall
|
131
|
+
message: calls record.created_at twice
|
132
|
+
call: record.created_at
|
133
|
+
occurrences: 2
|
134
|
+
status:
|
135
|
+
is_active: true
|
136
|
+
location:
|
137
|
+
context: SalesEngine::Database#find_all_created_on
|
138
|
+
lines:
|
139
|
+
- 155
|
140
|
+
- 156
|
141
|
+
source: ./lib/sales_engine/database.rb
|
142
|
+
- !ruby/object:Reek::SmellWarning
|
143
|
+
smell:
|
144
|
+
class: Duplication
|
145
|
+
subclass: DuplicateMethodCall
|
146
|
+
message: calls invoice.merchant_id 3 times
|
147
|
+
call: invoice.merchant_id
|
148
|
+
occurrences: 3
|
149
|
+
status:
|
150
|
+
is_active: true
|
151
|
+
location:
|
152
|
+
context: SalesEngine::Database#find_all_invoices_by_merchant_id
|
153
|
+
lines:
|
154
|
+
- 144
|
155
|
+
- 144
|
156
|
+
- 148
|
157
|
+
source: ./lib/sales_engine/database.rb
|
158
|
+
- !ruby/object:Reek::SmellWarning
|
159
|
+
smell:
|
160
|
+
class: LowCohesion
|
161
|
+
subclass: FeatureEnvy
|
162
|
+
message: refers to invoice more than self
|
163
|
+
receiver: invoice
|
164
|
+
references: 3
|
165
|
+
status:
|
166
|
+
is_active: true
|
167
|
+
location:
|
168
|
+
context: SalesEngine::Database#find_all_invoices_by_merchant_id
|
169
|
+
lines:
|
170
|
+
- 141
|
171
|
+
source: ./lib/sales_engine/database.rb
|
172
|
+
- !ruby/object:Reek::SmellWarning
|
173
|
+
smell:
|
174
|
+
class: Duplication
|
175
|
+
subclass: DuplicateMethodCall
|
176
|
+
message: calls item.merchant_id 3 times
|
177
|
+
call: item.merchant_id
|
178
|
+
occurrences: 3
|
179
|
+
status:
|
180
|
+
is_active: true
|
181
|
+
location:
|
182
|
+
context: SalesEngine::Database#find_all_items_by_merchant_id
|
183
|
+
lines:
|
184
|
+
- 134
|
185
|
+
- 134
|
186
|
+
- 138
|
187
|
+
source: ./lib/sales_engine/database.rb
|
188
|
+
- !ruby/object:Reek::SmellWarning
|
189
|
+
smell:
|
190
|
+
class: LowCohesion
|
191
|
+
subclass: FeatureEnvy
|
192
|
+
message: refers to item more than self
|
193
|
+
receiver: item
|
194
|
+
references: 3
|
195
|
+
status:
|
196
|
+
is_active: true
|
197
|
+
location:
|
198
|
+
context: SalesEngine::Database#find_all_items_by_merchant_id
|
199
|
+
lines:
|
200
|
+
- 131
|
201
|
+
source: ./lib/sales_engine/database.rb
|
202
|
+
- !ruby/object:Reek::SmellWarning
|
203
|
+
smell:
|
204
|
+
class: LowCohesion
|
205
|
+
subclass: FeatureEnvy
|
206
|
+
message: refers to attribute_value more than self
|
207
|
+
receiver: attribute_value
|
208
|
+
references: 3
|
209
|
+
status:
|
210
|
+
is_active: true
|
211
|
+
location:
|
212
|
+
context: SalesEngine::Database#find_by
|
213
|
+
lines:
|
214
|
+
- 111
|
215
|
+
source: ./lib/sales_engine/database.rb
|
216
|
+
- !ruby/object:Reek::SmellWarning
|
217
|
+
smell:
|
218
|
+
class: Duplication
|
219
|
+
subclass: DuplicateMethodCall
|
220
|
+
message: calls self.send(class_name) twice
|
221
|
+
call: self.send(class_name)
|
222
|
+
occurrences: 2
|
223
|
+
status:
|
224
|
+
is_active: true
|
225
|
+
location:
|
226
|
+
context: SalesEngine::Database#get_random_record
|
227
|
+
lines:
|
228
|
+
- 55
|
229
|
+
- 55
|
230
|
+
source: ./lib/sales_engine/database.rb
|
231
|
+
- !ruby/object:Reek::SmellWarning
|
232
|
+
smell:
|
233
|
+
class: IrresponsibleModule
|
234
|
+
subclass: IrresponsibleModule
|
235
|
+
message: has no descriptive comment
|
236
|
+
module_name: Invoice
|
237
|
+
status:
|
238
|
+
is_active: true
|
239
|
+
location:
|
240
|
+
context: SalesEngine::Invoice
|
241
|
+
lines:
|
242
|
+
- 2
|
243
|
+
source: ./lib/sales_engine/invoice.rb
|
244
|
+
- !ruby/object:Reek::SmellWarning
|
245
|
+
smell:
|
246
|
+
class: LowCohesion
|
247
|
+
subclass: FeatureEnvy
|
248
|
+
message: refers to values more than self
|
249
|
+
receiver: values
|
250
|
+
references: 3
|
251
|
+
status:
|
252
|
+
is_active: true
|
253
|
+
location:
|
254
|
+
context: SalesEngine::Invoice#charge
|
255
|
+
lines:
|
256
|
+
- 37
|
257
|
+
source: ./lib/sales_engine/invoice.rb
|
258
|
+
- !ruby/object:Reek::SmellWarning
|
259
|
+
smell:
|
260
|
+
class: Duplication
|
261
|
+
subclass: DuplicateMethodCall
|
262
|
+
message: calls values[:transaction] twice
|
263
|
+
call: values[:transaction]
|
264
|
+
occurrences: 2
|
265
|
+
status:
|
266
|
+
is_active: true
|
267
|
+
location:
|
268
|
+
context: SalesEngine::Invoice#self.create
|
269
|
+
lines:
|
270
|
+
- 32
|
271
|
+
- 32
|
272
|
+
source: ./lib/sales_engine/invoice.rb
|
273
|
+
- !ruby/object:Reek::SmellWarning
|
274
|
+
smell:
|
275
|
+
class: IrresponsibleModule
|
276
|
+
subclass: IrresponsibleModule
|
277
|
+
message: has no descriptive comment
|
278
|
+
module_name: InvoiceItem
|
279
|
+
status:
|
280
|
+
is_active: true
|
281
|
+
location:
|
282
|
+
context: SalesEngine::InvoiceItem
|
283
|
+
lines:
|
284
|
+
- 2
|
285
|
+
source: ./lib/sales_engine/invoice_item.rb
|
286
|
+
- !ruby/object:Reek::SmellWarning
|
287
|
+
smell:
|
288
|
+
class: IrresponsibleModule
|
289
|
+
subclass: IrresponsibleModule
|
290
|
+
message: has no descriptive comment
|
291
|
+
module_name: Item
|
292
|
+
status:
|
293
|
+
is_active: true
|
294
|
+
location:
|
295
|
+
context: SalesEngine::Item
|
296
|
+
lines:
|
297
|
+
- 2
|
298
|
+
source: ./lib/sales_engine/item.rb
|
299
|
+
- !ruby/object:Reek::SmellWarning
|
300
|
+
smell:
|
301
|
+
class: Duplication
|
302
|
+
subclass: DuplicateMethodCall
|
303
|
+
message: calls inv_item.quantity twice
|
304
|
+
call: inv_item.quantity
|
305
|
+
occurrences: 2
|
306
|
+
status:
|
307
|
+
is_active: true
|
308
|
+
location:
|
309
|
+
context: SalesEngine::Item#add_quantity_to_date
|
310
|
+
lines:
|
311
|
+
- 41
|
312
|
+
- 43
|
313
|
+
source: ./lib/sales_engine/item.rb
|
314
|
+
- !ruby/object:Reek::SmellWarning
|
315
|
+
smell:
|
316
|
+
class: LowCohesion
|
317
|
+
subclass: UtilityFunction
|
318
|
+
message: doesn't depend on instance state
|
319
|
+
status:
|
320
|
+
is_active: true
|
321
|
+
location:
|
322
|
+
context: SalesEngine::Item#add_quantity_to_date
|
323
|
+
lines:
|
324
|
+
- 37
|
325
|
+
source: ./lib/sales_engine/item.rb
|
326
|
+
- !ruby/object:Reek::SmellWarning
|
327
|
+
smell:
|
328
|
+
class: LowCohesion
|
329
|
+
subclass: FeatureEnvy
|
330
|
+
message: refers to inv_item more than self
|
331
|
+
receiver: inv_item
|
332
|
+
references: 3
|
333
|
+
status:
|
334
|
+
is_active: true
|
335
|
+
location:
|
336
|
+
context: SalesEngine::Item#add_quantity_to_date
|
337
|
+
lines:
|
338
|
+
- 37
|
339
|
+
source: ./lib/sales_engine/item.rb
|
340
|
+
- !ruby/object:Reek::SmellWarning
|
341
|
+
smell:
|
342
|
+
class: LowCohesion
|
343
|
+
subclass: FeatureEnvy
|
344
|
+
message: refers to tracker_hash more than self
|
345
|
+
receiver: tracker_hash
|
346
|
+
references: 3
|
347
|
+
status:
|
348
|
+
is_active: true
|
349
|
+
location:
|
350
|
+
context: SalesEngine::Item#add_quantity_to_date
|
351
|
+
lines:
|
352
|
+
- 37
|
353
|
+
source: ./lib/sales_engine/item.rb
|
354
|
+
- !ruby/object:Reek::SmellWarning
|
355
|
+
smell:
|
356
|
+
class: IrresponsibleModule
|
357
|
+
subclass: IrresponsibleModule
|
358
|
+
message: has no descriptive comment
|
359
|
+
module_name: Merchant
|
360
|
+
status:
|
361
|
+
is_active: true
|
362
|
+
location:
|
363
|
+
context: SalesEngine::Merchant
|
364
|
+
lines:
|
365
|
+
- 2
|
366
|
+
source: ./lib/sales_engine/merchant.rb
|
367
|
+
- !ruby/object:Reek::SmellWarning
|
368
|
+
smell:
|
369
|
+
class: LowCohesion
|
370
|
+
subclass: FeatureEnvy
|
371
|
+
message: refers to invoice more than self
|
372
|
+
receiver: invoice
|
373
|
+
references: 2
|
374
|
+
status:
|
375
|
+
is_active: true
|
376
|
+
location:
|
377
|
+
context: SalesEngine::Merchant#customers_with_pending_invoices
|
378
|
+
lines:
|
379
|
+
- 56
|
380
|
+
source: ./lib/sales_engine/merchant.rb
|
381
|
+
- !ruby/object:Reek::SmellWarning
|
382
|
+
smell:
|
383
|
+
class: Duplication
|
384
|
+
subclass: DuplicateMethodCall
|
385
|
+
message: calls invoice.customer 3 times
|
386
|
+
call: invoice.customer
|
387
|
+
occurrences: 3
|
388
|
+
status:
|
389
|
+
is_active: true
|
390
|
+
location:
|
391
|
+
context: SalesEngine::Merchant#favorite_customer
|
392
|
+
lines:
|
393
|
+
- 47
|
394
|
+
- 48
|
395
|
+
- 50
|
396
|
+
source: ./lib/sales_engine/merchant.rb
|
397
|
+
- !ruby/object:Reek::SmellWarning
|
398
|
+
smell:
|
399
|
+
class: LowCohesion
|
400
|
+
subclass: FeatureEnvy
|
401
|
+
message: refers to customer_invoice_counter more than self
|
402
|
+
receiver: customer_invoice_counter
|
403
|
+
references: 4
|
404
|
+
status:
|
405
|
+
is_active: true
|
406
|
+
location:
|
407
|
+
context: SalesEngine::Merchant#favorite_customer
|
408
|
+
lines:
|
409
|
+
- 44
|
410
|
+
source: ./lib/sales_engine/merchant.rb
|
411
|
+
- !ruby/object:Reek::SmellWarning
|
412
|
+
smell:
|
413
|
+
class: Duplication
|
414
|
+
subclass: DuplicateMethodCall
|
415
|
+
message: calls invoice.total_revenue twice
|
416
|
+
call: invoice.total_revenue
|
417
|
+
occurrences: 2
|
418
|
+
status:
|
419
|
+
is_active: true
|
420
|
+
location:
|
421
|
+
context: SalesEngine::Merchant#revenue
|
422
|
+
lines:
|
423
|
+
- 32
|
424
|
+
- 36
|
425
|
+
source: ./lib/sales_engine/merchant.rb
|
426
|
+
- !ruby/object:Reek::SmellWarning
|
427
|
+
smell:
|
428
|
+
class: LowCohesion
|
429
|
+
subclass: FeatureEnvy
|
430
|
+
message: refers to invoice more than self
|
431
|
+
receiver: invoice
|
432
|
+
references: 3
|
433
|
+
status:
|
434
|
+
is_active: true
|
435
|
+
location:
|
436
|
+
context: SalesEngine::Merchant#revenue
|
437
|
+
lines:
|
438
|
+
- 29
|
439
|
+
source: ./lib/sales_engine/merchant.rb
|
440
|
+
- !ruby/object:Reek::SmellWarning
|
441
|
+
smell:
|
442
|
+
class: IrresponsibleModule
|
443
|
+
subclass: IrresponsibleModule
|
444
|
+
message: has no descriptive comment
|
445
|
+
module_name: Record
|
446
|
+
status:
|
447
|
+
is_active: true
|
448
|
+
location:
|
449
|
+
context: SalesEngine::Record
|
450
|
+
lines:
|
451
|
+
- 2
|
452
|
+
source: ./lib/sales_engine/record.rb
|
453
|
+
- !ruby/object:Reek::SmellWarning
|
454
|
+
smell:
|
455
|
+
class: LowCohesion
|
456
|
+
subclass: UtilityFunction
|
457
|
+
message: doesn't depend on instance state
|
458
|
+
status:
|
459
|
+
is_active: true
|
460
|
+
location:
|
461
|
+
context: SalesEngine::Record#convert_to_big_decimal
|
462
|
+
lines:
|
463
|
+
- 11
|
464
|
+
source: ./lib/sales_engine/record.rb
|
465
|
+
- !ruby/object:Reek::SmellWarning
|
466
|
+
smell:
|
467
|
+
class: LowCohesion
|
468
|
+
subclass: FeatureEnvy
|
469
|
+
message: refers to value more than self
|
470
|
+
receiver: value
|
471
|
+
references: 3
|
472
|
+
status:
|
473
|
+
is_active: true
|
474
|
+
location:
|
475
|
+
context: SalesEngine::Record#convert_to_big_decimal
|
476
|
+
lines:
|
477
|
+
- 11
|
478
|
+
source: ./lib/sales_engine/record.rb
|
479
|
+
- !ruby/object:Reek::SmellWarning
|
480
|
+
smell:
|
481
|
+
class: Duplication
|
482
|
+
subclass: DuplicateMethodCall
|
483
|
+
message: calls Time.now twice
|
484
|
+
call: Time.now
|
485
|
+
occurrences: 2
|
486
|
+
status:
|
487
|
+
is_active: true
|
488
|
+
location:
|
489
|
+
context: SalesEngine::Record#initialize
|
490
|
+
lines:
|
491
|
+
- 7
|
492
|
+
- 8
|
493
|
+
source: ./lib/sales_engine/record.rb
|
494
|
+
- !ruby/object:Reek::SmellWarning
|
495
|
+
smell:
|
496
|
+
class: Duplication
|
497
|
+
subclass: DuplicateMethodCall
|
498
|
+
message: calls Time.now.to_s twice
|
499
|
+
call: Time.now.to_s
|
500
|
+
occurrences: 2
|
501
|
+
status:
|
502
|
+
is_active: true
|
503
|
+
location:
|
504
|
+
context: SalesEngine::Record#initialize
|
505
|
+
lines:
|
506
|
+
- 7
|
507
|
+
- 8
|
508
|
+
source: ./lib/sales_engine/record.rb
|
509
|
+
- !ruby/object:Reek::SmellWarning
|
510
|
+
smell:
|
511
|
+
class: IrresponsibleModule
|
512
|
+
subclass: IrresponsibleModule
|
513
|
+
message: has no descriptive comment
|
514
|
+
module_name: Transaction
|
515
|
+
status:
|
516
|
+
is_active: true
|
517
|
+
location:
|
518
|
+
context: SalesEngine::Transaction
|
519
|
+
lines:
|
520
|
+
- 2
|
521
|
+
source: ./lib/sales_engine/transaction.rb
|
522
|
+
- !ruby/object:Reek::SmellWarning
|
523
|
+
smell:
|
524
|
+
class: IrresponsibleModule
|
525
|
+
subclass: IrresponsibleModule
|
526
|
+
message: has no descriptive comment
|
527
|
+
module_name: Array
|
528
|
+
status:
|
529
|
+
is_active: true
|
530
|
+
location:
|
531
|
+
context: Array
|
532
|
+
lines:
|
533
|
+
- 1
|
534
|
+
source: ./lib/utilities.rb
|