-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcodeclimate_diff_baseline.json
More file actions
258 lines (258 loc) · 324 KB
/
codeclimate_diff_baseline.json
File metadata and controls
258 lines (258 loc) · 324 KB
1
2
3
4
5
6
7
8
9
10
11
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
54
55
56
57
58
59
60
61
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
[{"engine_name":"structure","fingerprint":"42352230cb1d831fdd7634b27cb6c41d","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `reset` has 27 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/supplejack/config.rb","lines":{"begin":89,"end":118}},"other_locations":[],"remediation_points":648000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"9b56cd0d19f6230a7f53d4b601aaa5f6","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `link_to_remove_filter` has 6 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":229,"end":229}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"66c60a2acb145618cf326452f6391ea7","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `link_to_add_filter` has 6 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":247,"end":247}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"7c97115659823ae81b2a7c44947e2e46","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `link_to_lock_filter` has 6 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":255,"end":255}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"b2ecaabb42832039bc86a46dd82b14dc","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `attribute` has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":39,"end":102}},"other_locations":[],"remediation_points":3550000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"e2a07912c817b859811f093e07b86ce7","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `previous_record_link` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":133,"end":146}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"a9432f7264c45a1bdb8b0174e30face2","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `next_record_link` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":148,"end":161}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"c8affe1f6006cbac9faa04bdfcb6a6e9","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `form_fields` has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":184,"end":215}},"other_locations":[],"remediation_points":1350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"55fc96d97253a082d61b0acdd54bdc98","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `attribute` has 52 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":39,"end":102}},"other_locations":[],"remediation_points":1248000,"severity":"major","type":"issue"},
{"engine_name":"structure","fingerprint":"33d13186a4252d9814898713fd272239","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `log_request` has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":5,"end":31}},"other_locations":[],"remediation_points":550000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"1cbb7ed30eda49a05284a15b98adf47a","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `metadata` has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/record.rb","lines":{"begin":63,"end":88}},"other_locations":[],"remediation_points":1350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"3de2845fe3d4f46e818638ad7f036259","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `find` has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/record.rb","lines":{"begin":126,"end":159}},"other_locations":[],"remediation_points":750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"0befc373b9e9feb608fb205a4086470c","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `get` has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/request.rb","lines":{"begin":7,"end":40}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"96c6efc928900d0e5cd25d5ac98bea91","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `get` has 28 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/supplejack/request.rb","lines":{"begin":7,"end":40}},"other_locations":[],"remediation_points":672000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"a73b9a1c26142536e2be45da364936b1","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `initialize` has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/search.rb","lines":{"begin":15,"end":50}},"other_locations":[],"remediation_points":550000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"4a7e4d1418585b05d2c618e624071c72","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `counts_params` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/search.rb","lines":{"begin":204,"end":227}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"05350be7b8ef57d6df2cfbc203d5d67b","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `merge_extra_filters` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/search.rb","lines":{"begin":363,"end":370}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"ce4d3c1d36675f28e837f85874c9280d","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Search` has 23 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"lib/supplejack/search.rb","lines":{"begin":8,"end":371}},"other_locations":[],"remediation_points":1500000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"50afdcba007669e737c0c4add618189f","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `save` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/story.rb","lines":{"begin":56,"end":71}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"e2eaf699f6a22ca1844cf1168fe0d259","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Story` has 30 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"lib/supplejack/story.rb","lines":{"begin":4,"end":310}},"other_locations":[],"remediation_points":2200000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"31f6a2be07310ab20b51e4b57dee4c62","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `save` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/story_item.rb","lines":{"begin":64,"end":86}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"34532f4930754bcfe72215297911b1af","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `to_api_hash` has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":17,"end":43}},"other_locations":[],"remediation_points":1050000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"23d3ad7e85f2af45d4219112ef4169f3","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `filter_symbol` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":102,"end":108}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"d738a3d2775b43bb90ef6d831ec21de8","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `options` has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":160,"end":204}},"other_locations":[],"remediation_points":2450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"47c6d13ec6151a5c3edc6209e444d1c7","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `options` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":160,"end":204}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"08aa8dc7c2e557cf50db140baece702d","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `save` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":147,"end":159}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"0d3dc67fd3415c8d46cffc9f85eac41a","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `destroy` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":220,"end":233}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"070b43df4ee6c2a5e48831b7b5b7d83a","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `UserSet` has 28 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":19,"end":341}},"other_locations":[],"remediation_points":2000000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"06865006dbeff4f051be20e6e2ad6cbc","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `order` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/user_set_relation.rb","lines":{"begin":109,"end":117}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"5d4fb3f334cd87353700533ae71fd1e3","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `deep_merge_into` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack/util.rb","lines":{"begin":88,"end":106}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"name":"ruby.parse.succeeded","type":"measurement","value":29,"engine_name":"structure"},
{"engine_name":"duplication","fingerprint":"fb4497f56a5a1658e789bb6a709d7345","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 3 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":42,"end":58}},"remediation_points":950000,"other_locations":[{"path":"lib/supplejack/request.rb","lines":{"begin":72,"end":89}},{"path":"lib/supplejack/request.rb","lines":{"begin":94,"end":117}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},
{"engine_name":"duplication","fingerprint":"fb4497f56a5a1658e789bb6a709d7345","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 3 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":72,"end":89}},"remediation_points":950000,"other_locations":[{"path":"lib/supplejack/request.rb","lines":{"begin":42,"end":58}},{"path":"lib/supplejack/request.rb","lines":{"begin":94,"end":117}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},
{"engine_name":"duplication","fingerprint":"fb4497f56a5a1658e789bb6a709d7345","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 3 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":94,"end":117}},"remediation_points":950000,"other_locations":[{"path":"lib/supplejack/request.rb","lines":{"begin":42,"end":58}},{"path":"lib/supplejack/request.rb","lines":{"begin":72,"end":89}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},
{"engine_name":"duplication","fingerprint":"2a5b10a5fdc7908fe55bf2c7091050da","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/concept.rb","lines":{"begin":18,"end":30}},"remediation_points":150000,"other_locations":[{"path":"lib/supplejack/record.rb","lines":{"begin":27,"end":39}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"a1d1467b3c0aec739b61ea9067ead308","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":27,"end":39}},"remediation_points":150000,"other_locations":[{"path":"lib/supplejack/concept.rb","lines":{"begin":18,"end":30}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"45edcbd4422751f192963e1b228ca705","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/item.rb","lines":{"begin":68,"end":74}},"remediation_points":310000,"other_locations":[{"path":"lib/supplejack/story_item.rb","lines":{"begin":98,"end":108}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 33**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"e49708611c287c04c56a34c6a17a0d5a","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/story_item.rb","lines":{"begin":98,"end":108}},"remediation_points":310000,"other_locations":[{"path":"lib/supplejack/item.rb","lines":{"begin":68,"end":74}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 33**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"c9e9d6d39125278a8861fc5d6a20535b","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":83,"end":93}},"remediation_points":290000,"other_locations":[{"path":"lib/supplejack/user_set.rb","lines":{"begin":224,"end":231}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 32**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"fd7290ce9474b9be4f929c3b8d336c77","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":224,"end":231}},"remediation_points":290000,"other_locations":[{"path":"lib/supplejack/story.rb","lines":{"begin":83,"end":93}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 32**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"a202454bfa05641ba9a6cfb2dd1ce612","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":111,"end":119}},"remediation_points":150000,"other_locations":[{"path":"lib/supplejack/story.rb","lines":{"begin":121,"end":129}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"a202454bfa05641ba9a6cfb2dd1ce612","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":121,"end":129}},"remediation_points":150000,"other_locations":[{"path":"lib/supplejack/story.rb","lines":{"begin":111,"end":119}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a777df0e08dbddaa695e6e1d5626ff83","type":"issue","check_name":"Attribute","description":"Supplejack::Concept#attributes is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/concept.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"78c625bd93e9b7f917fff4bd7dcb70b2","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Concept#initialize refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/concept.rb","lines":{"begin":19,"end":28}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"996ed75dc8cd251a3716b7c03a61b868","type":"issue","check_name":"ModuleInitialize","description":"Supplejack::Concept has initialize method","categories":["Complexity"],"location":{"path":"lib/supplejack/concept.rb","lines":{"begin":6,"end":6}},"remediation_points":350000,"content":{"body":"A module is usually a mixin, so when an `#initialize` method is present it is\nhard to tell initialization order and parameters so having `#initialize`\nin a module is usually a bad idea.\n\n## Example\n\nThe `Foo` module below contains a method `initialize`. Although class `B` inherits from `A`, the inclusion of `Foo` stops `A#initialize` from being called.\n\n```Ruby\nclass A\n def initialize(a)\n @a = a\n end\nend\n\nmodule Foo\n def initialize(foo)\n @foo = foo\n end\nend\n\nclass B \u003c A\n include Foo\n\n def initialize(b)\n super('bar')\n @b = b\n end\nend\n```\n\nA simple solution is to rename `Foo#initialize` and call that method by name:\n\n```Ruby\nmodule Foo\n def setup_foo_module(foo)\n @foo = foo\n end\nend\n\nclass B \u003c A\n include Foo\n\n def initialize(b)\n super 'bar'\n setup_foo_module('foo')\n @b = b\n end\nend\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fd7b4a4df0cd362608fc02371b614e11","type":"issue","check_name":"TooManyConstants","description":"Supplejack::Config has 27 constants","categories":["Complexity"],"location":{"path":"lib/supplejack/config.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Constants` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyConstants:\n max_constants: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyConstants\n CONST_1 = :dummy\n CONST_2 = :dummy\n CONST_3 = :dummy\n CONST_4 = :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warnings:\n [1]:TooManyConstants has 4 constants (TooManyConstants)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"97dea911f9a1a8a8f96ecf6d0255de02","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Config#reset has approx 27 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/config.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fef669d1d4a7678ce22b2e375c0f6a56","type":"issue","check_name":"UtilityFunction","description":"Supplejack::Config#url_format_klass doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/config.rb","lines":{"begin":84,"end":84}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"93e54c70fe4a053f57721a01bef91832","type":"issue","check_name":"ControlParameter","description":"Supplejack::Controllers::Helpers#search is controlled by argument 'special_params'","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":14,"end":14}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"611e36623459643a39be082361483e11","type":"issue","check_name":"DataClump","description":"Supplejack::Controllers::Helpers takes parameters ['html_options', 'name', 'options', 'path_name', 'value'] to 3 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":229,"end":255}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n\u003e The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"873e47bf583eef759921febe18765d73","type":"issue","check_name":"DataClump","description":"Supplejack::Controllers::Helpers takes parameters ['html_options', 'record'] to 3 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":118,"end":148}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n\u003e The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b853b0aa125c30c6a7373d2e1bdabcab","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'attribute.to_s' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":87,"end":90}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d55575381090197509e04e6ec2eb4acd","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'attribute.to_s.capitalize' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":87,"end":90}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c0b74da5268bdb0b6f949a4d1aaefca7","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'content.html_safe' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":100,"end":100}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1f830c4576beee17ed0891eac809561c","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:extra_html]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":97,"end":97}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c9e7bfd42d5bcf9c790537e87ee198db","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:limit]' 6 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":66,"end":79}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e1d82969458a0138c6904082894f969a","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:limit].to_i' 5 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":66,"end":79}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"7de5a4380c5bb4bb436caf6a8a365a22","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:limit].to_i.positive?' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":66,"end":79}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b7172fa75436051f0ac1b90e50f49052","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:link]' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":69,"end":81}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fefb52f2f5e5aa8a956e87302ecab160","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:link_path]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":67,"end":67}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ed84b844657055b2c2f78345978bfb5b","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:tag]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":100,"end":100}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d9d54e91255a24da66bacaa083bebee1","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'options[:trans_key]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":86,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3c53caf21fd2b1798956907ce2f708d2","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#attribute calls 'value.map' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":67,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"eb9b70be74d76a961c69e66706f8d37a","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#form_fields calls 'options[:except]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":192,"end":192}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"39ccfafad1d32bd2a7d5ca63b44c909a","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#form_fields calls 'search.send(field)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":195,"end":195}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"19a8f2f6b5a633d55ea62168f236473a","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#generate_path calls 'segments[0]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":292,"end":293}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"57eba82f13df1bab9b5060a101ac3455","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#link_to_add_filter calls 'options[:except]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":249,"end":250}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a31c41d8d387b03dae48d84d4c1339c3","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#link_to_record calls 'args[0]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":274,"end":278}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"9c260b01665e0112359316982892abc8","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#link_to_record calls 'args[1]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":275,"end":279}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a7c51a6ee108dcfc02da3e00218c7687","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#link_to_record calls 'args[2]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":276,"end":280}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1dff11061e2877b1a565a235121cfc86","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#next_previous_links calls 'params[:search]' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":121,"end":125}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"70852e9a4efb090a9656d26e88fb9def","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#next_previous_links calls 'params[:search][:path]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":125,"end":125}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a885871c0560cc2577f587dc9b4416c0","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#next_record_link calls 'html_options[:next_class]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":156,"end":158}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"16c7a23af1ad8205e46b652374cf87d9","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#next_record_link calls 'record.next_page' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":154,"end":154}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b65a0ff940d00a05c199761b1f15d970","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#next_record_link calls 'record.next_record' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":152,"end":155}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"43d7252158e0c01897bf4d96833f0b44","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#previous_record_link calls 'html_options[:prev_class]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":141,"end":143}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"43e55d3104028f1c0d5f19e9c6e942c7","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#previous_record_link calls 'record.previous_record' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":137,"end":140}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d5a5a4bf6158ac2dc25e1af1230f504c","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Controllers::Helpers#search calls 'Supplejack.search_klass' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":13,"end":13}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"895cf9e168e4ab80715003da343ceb83","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Controllers::Helpers#attribute refers to 'options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":40,"end":100}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"485258c744d78fa7512aa3c955f7ba51","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Controllers::Helpers#form_fields refers to 'search' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":190,"end":202}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"4d2b0ef6f3fcc739f5e794eab5f4c3f5","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Controllers::Helpers#generate_path refers to 'segments' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":291,"end":293}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"40517f4f7def1f575ca2e564959d590e","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Controllers::Helpers#link_to_record refers to 'args' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":274,"end":281}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"69d9d512fd05a545d4a8401b0caefc64","type":"issue","check_name":"LongParameterList","description":"Supplejack::Controllers::Helpers#link_to_add_filter has 5 parameters","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":247,"end":247}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c9eb9f2c1eb55dbcac6839887edbe295","type":"issue","check_name":"LongParameterList","description":"Supplejack::Controllers::Helpers#link_to_lock_filter has 5 parameters","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":255,"end":255}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"26c8b31138b2a64105f4629d58bc65e2","type":"issue","check_name":"LongParameterList","description":"Supplejack::Controllers::Helpers#link_to_remove_filter has 5 parameters","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":229,"end":229}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"bf2a4babde6fe9727349f6b0cac77509","type":"issue","check_name":"NestedIterators","description":"Supplejack::Controllers::Helpers#form_fields contains iterators nested 3 deep","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":210,"end":210}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class \u003c\u003c self\n def duck_names\n %i!tick trick track!.each do |surname|\n %i!duck!.each do |last_name|\n puts \"full name is #{surname} #{last_name}\"\n end\n end\n end\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [5]:Duck#duck_names contains iterators nested 2 deep (NestedIterators)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"edd6b2a7475661097dad52061eb69436","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Controllers::Helpers#attribute has approx 31 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":39,"end":39}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1f9a9cbe0187004afefce335e8844120","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Controllers::Helpers#form_fields has approx 19 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":184,"end":184}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3418363b0fb9746f1474c831a34b1ee6","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Controllers::Helpers#attribute has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":50,"end":70}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fcd09fb2a54d51aae84b266fc5536019","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Controllers::Helpers#form_fields has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack/controllers/helpers.rb","lines":{"begin":210,"end":210}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"780246e9bb00a817719ed14ed54ab492","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Facet#values calls '@values.sort_by' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/facet.rb","lines":{"begin":17,"end":19}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e8836da3939b2ddc00fe7cd9ebcea376","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Facet#values has the variable name 'k'","categories":["Complexity"],"location":{"path":"lib/supplejack/facet.rb","lines":{"begin":17,"end":17}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c55c92ab72c671e76809bc13a3c5e139","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Facet#values has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack/facet.rb","lines":{"begin":19,"end":19}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"91fd84544876779b97fac3539463c296","type":"issue","check_name":"Attribute","description":"Supplejack::Item#api_key is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/item.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f43754c30ac3755a9b33e9fcfddaa44c","type":"issue","check_name":"Attribute","description":"Supplejack::Item#errors is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/item.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"18cc3e2291ac654fe72a61c4ede61f41","type":"issue","check_name":"Attribute","description":"Supplejack::Item#position is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/item.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0fd6b17513c2925636f6f3d30a06b137","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::Item assumes too much for instance variable '@date'","categories":["Complexity"],"location":{"path":"lib/supplejack/item.rb","lines":{"begin":17,"end":17}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f529c0eb3ca8b6b6efe725460faa9089","type":"issue","check_name":"TooManyInstanceVariables","description":"Supplejack::Item has at least 5 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack/item.rb","lines":{"begin":17,"end":17}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"50611e1be5c0c791cb8010a86f2b7d3b","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::ItemRelation#initialize refers to 'user_set' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/item_relation.rb","lines":{"begin":20,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"89b4042d95539224c7a945394bd8c102","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::ItemRelation#find has the variable name 'i'","categories":["Complexity"],"location":{"path":"lib/supplejack/item_relation.rb","lines":{"begin":35,"end":35}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6e170d5ceeb832e385ad04d168683bee","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::LogSubscriber#colorize calls 'text.map' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":35,"end":36}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ce7f2226c78d5e34ffc3fef61c959b67","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::LogSubscriber#log_request calls 'MODES[:bold]' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":15,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"01c21bc02a2a12a34dae8f1e16bb74b1","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::LogSubscriber#log_request calls 'colorize(v, MODES[:bold])' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":15,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"5165bafb1ef2d6627cb8789f324d8869","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::LogSubscriber#log_request calls 'payload[:exception]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":20,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1614aa29ea084b9eb76159d543261fe5","type":"issue","check_name":"TooManyStatements","description":"Supplejack::LogSubscriber#log_request has approx 19 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f5c84113309b85ab1e7a5cc711ff5465","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::LogSubscriber#colorize has the variable name 'k'","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":36,"end":36}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"152a8d4918155006e912f8660bf2d7b3","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::LogSubscriber#colorize has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":36,"end":36}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d7dc291318c73bb08f995482b0e842a9","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::LogSubscriber#log_request has the variable name 'k'","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":15,"end":25}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"cbd43a74f3acece3f78020cb613f50b0","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::LogSubscriber#log_request has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack/log_subscriber.rb","lines":{"begin":15,"end":25}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"9ad5eec05954feaffd542cee230dc59d","type":"issue","check_name":"TooManyInstanceVariables","description":"Supplejack::ModerationRecord has at least 5 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack/moderation_record.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"32371f625fa79202434912138bdcb15f","type":"issue","check_name":"Attribute","description":"Supplejack::MoreLikeThisRecord#id is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0e1199db4f471b940a271794063e04cb","type":"issue","check_name":"Attribute","description":"Supplejack::MoreLikeThisRecord#params is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"37454f697c2a6f5393d716a1106038a3","type":"issue","check_name":"Attribute","description":"Supplejack::MoreLikeThisRecord#response is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c70e810129215571282bf552ccdcf653","type":"issue","check_name":"ControlParameter","description":"Supplejack::MoreLikeThisRecord#initialize is controlled by argument 'options'","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":20,"end":20}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ac8df4e1b91a048e811730cd4456a431","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::MoreLikeThisRecord#initialize calls '@params[:mlt_fields]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":22,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"661d14d105bc3cee8c3d6e1f124c5c32","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::MoreLikeThisRecord#records calls 'response['more_like_this']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":30,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e42c4c6fe31b2ab4264d75f0c82c26ee","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::MoreLikeThisRecord#records calls 'response['more_like_this']['results']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":30,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"96ea337593ce3d158790007d3b16adf9","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::MoreLikeThisRecord#records refers to 'response' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/more_like_this_record.rb","lines":{"begin":30,"end":32}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8627f27442ec1149e436f6e131157188","type":"issue","check_name":"Attribute","description":"Supplejack::PaginatedCollection#total_count is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/paginated_collection.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"40b7f339a755d76502968098d03472f1","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::PaginatedCollection has the variable name 'm'","categories":["Complexity"],"location":{"path":"lib/supplejack/paginated_collection.rb","lines":{"begin":5,"end":5}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"44b2ba2ab8e7188d19c3ea36dd332185","type":"issue","check_name":"Attribute","description":"Supplejack::Record#attributes is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8533042c2d90c1aa350955d2c4daf946","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Record#metadata calls 'field.to_s' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":75,"end":80}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8afe4dfc9904fa21a2f60a3bdbdedcc4","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Record::ClassMethods#find calls 'Supplejack.search_klass' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":141,"end":141}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a8ff0a86127fe786ffbc151ab4fe1016","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Record#initialize refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":28,"end":37}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"155babd51628f7f52b06423a22ec240a","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Record#metadata refers to 'field' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":75,"end":80}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"449f32d96372f480196a156b69004e9f","type":"issue","check_name":"ModuleInitialize","description":"Supplejack::Record has initialize method","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":6,"end":6}},"remediation_points":350000,"content":{"body":"A module is usually a mixin, so when an `#initialize` method is present it is\nhard to tell initialization order and parameters so having `#initialize`\nin a module is usually a bad idea.\n\n## Example\n\nThe `Foo` module below contains a method `initialize`. Although class `B` inherits from `A`, the inclusion of `Foo` stops `A#initialize` from being called.\n\n```Ruby\nclass A\n def initialize(a)\n @a = a\n end\nend\n\nmodule Foo\n def initialize(foo)\n @foo = foo\n end\nend\n\nclass B \u003c A\n include Foo\n\n def initialize(b)\n super('bar')\n @b = b\n end\nend\n```\n\nA simple solution is to rename `Foo#initialize` and call that method by name:\n\n```Ruby\nmodule Foo\n def setup_foo_module(foo)\n @foo = foo\n end\nend\n\nclass B \u003c A\n include Foo\n\n def initialize(b)\n super 'bar'\n setup_foo_module('foo')\n @b = b\n end\nend\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c86888cd594a91a96832da0546702b06","type":"issue","check_name":"NestedIterators","description":"Supplejack::Record#metadata contains iterators nested 3 deep","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":81,"end":81}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class \u003c\u003c self\n def duck_names\n %i!tick trick track!.each do |surname|\n %i!duck!.each do |last_name|\n puts \"full name is #{surname} #{last_name}\"\n end\n end\n end\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [5]:Duck#duck_names contains iterators nested 2 deep (NestedIterators)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"47e0fb68db033e49d8e90575e4e04818","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Record#metadata has approx 14 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":63,"end":63}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"96b59c00cac201dd77ba0c12207f3fef","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Record::ClassMethods#find has approx 18 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/record.rb","lines":{"begin":126,"end":126}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"840d3d4825e9a4e61e63b88ead28d4b4","type":"issue","check_name":"ControlParameter","description":"Supplejack::Request#full_url is controlled by argument 'format'","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":129,"end":129}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d6d7b36c937496f544d9354154f001c9","type":"issue","check_name":"DataClump","description":"Supplejack::Request takes parameters ['options', 'params', 'path'] to 5 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":7,"end":94}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n\u003e The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"eedd0ebad39742d5f84985410f3aa7b8","type":"issue","check_name":"DataClump","description":"Supplejack::Request takes parameters ['params', 'path'] to 7 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":7,"end":144}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n\u003e The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"81be1b5489dd641cd294c3a1d3b10c27","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Request#get calls 'Time.now' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":13,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ebeeb19e6463a7b1d0fd1548c6e8d034","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Request#get calls 'raise e' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":28,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"581f816aba8110e4a5df70c732aa3b73","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Request#get calls 'result['search']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":34,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"88ad050344533627300a38836feb7b24","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Request#log_request calls 'Time.now' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":151,"end":157}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"56df752e1c51672b6d6f4145a6dbfea8","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Request#timeout calls 'Supplejack.timeout' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":136,"end":136}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"525f7c09e83ba66a0941066ad29ebb29","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Request#timeout calls 'Supplejack.timeout.to_i' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":136,"end":136}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b8e238d66650b8a60c580960bbc4d62a","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Request#log_request refers to 'information' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":146,"end":154}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0d460d555a7ced4af599584bde61ddcc","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Request#get has approx 17 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":7,"end":7}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1272789b0a1cdc6bf47c4ce0f27fd94b","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Request#log_request has approx 11 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/request.rb","lines":{"begin":144,"end":144}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"4f6bd8edc3aa8d7fdb1679ce2dcca4e5","type":"issue","check_name":"Attribute","description":"Supplejack::Search#and is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"586a47b32cc91c5eead5767863bd88da","type":"issue","check_name":"Attribute","description":"Supplejack::Search#api_params is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"9f4496e038d69ea55adb99574bf46d46","type":"issue","check_name":"Attribute","description":"Supplejack::Search#direction is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6f73f5621e6bdc97095575e47d01e78a","type":"issue","check_name":"Attribute","description":"Supplejack::Search#filters is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"4cf576ecf4acc8883dbdf0425297b7dd","type":"issue","check_name":"Attribute","description":"Supplejack::Search#geo_bbox is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"5f1ceabc11bae7512f02cc0aafad98a0","type":"issue","check_name":"Attribute","description":"Supplejack::Search#or is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0eb592a8a7e1e156dbc8e244c3d70cf1","type":"issue","check_name":"Attribute","description":"Supplejack::Search#page is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3b68c16cdcbb12107a2f41209acb3cfc","type":"issue","check_name":"Attribute","description":"Supplejack::Search#pagination_limit is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ddf6e53dff8bb94a8eaf49af0a98f917","type":"issue","check_name":"Attribute","description":"Supplejack::Search#params is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3cbdec6bf95640f224593d63356c5b6a","type":"issue","check_name":"Attribute","description":"Supplejack::Search#per_page is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a8b7f67b111effe735f83312471c3025","type":"issue","check_name":"Attribute","description":"Supplejack::Search#record_klass is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"06801cf0e065fc3e2ba2d6017dd8a480","type":"issue","check_name":"Attribute","description":"Supplejack::Search#record_type is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3b48a75cff85a9c2e17f11e729f758f3","type":"issue","check_name":"Attribute","description":"Supplejack::Search#results is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"2736c73c8dc4ce8f90f50ed6ce402f78","type":"issue","check_name":"Attribute","description":"Supplejack::Search#sort is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"aa5adc0369df605f3321fb660de3cc11","type":"issue","check_name":"Attribute","description":"Supplejack::Search#text is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"25e8e3a7f34fc23021be3c622cf9206a","type":"issue","check_name":"Attribute","description":"Supplejack::Search#url_format is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"610cd8734194c2af098ae25425229166","type":"issue","check_name":"Attribute","description":"Supplejack::Search#without is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c35b2b9cf869184ad25d30511fd59124","type":"issue","check_name":"DataClump","description":"Supplejack::Search takes parameters ['facet_name', 'options'] to 3 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":233,"end":280}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n\u003e The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"4cef34f1d63e5e5f87919536249571d0","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#counts calls 'fetch_counts(query_parameters)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":177,"end":180}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"347aa7ac9a4857db114f08fd9fab8b8b","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#execute_request calls 'get(request_path, @api_params)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":304,"end":307}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"eaad2945acf2fc1fda9a18342a3ed788","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#facet_pivots calls '@response['search']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":114,"end":114}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"2e329a73e61fd5b37dbd19d8bfbd3b1e","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#facet_values calls 'fetch_facet_values(facet_name, options)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":284,"end":287}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"af6feaf309ec0590c650c577e6820e72","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#facet_values_params calls 'options[:facet_pivots]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":272,"end":272}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"25c1c84f5ad003a6fb80143d83949db6","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#facet_values_params calls 'options[:facets_per_page]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":271,"end":271}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e36e62066c72d8f8595533745b3a2d74","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#fetch_counts calls 'count_name.to_s' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":196,"end":196}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"bfa50dbd83ab5eaf5d33509dab13f172","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#initialize calls '@filters[attribute]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":48,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1fdb80154bfe0711db07f30748d2f6e9","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#merge_extra_filters calls 'self.and' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":364,"end":364}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"2ae41e393ca7872e1175fd3686ba1bd8","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#merge_extra_filters calls 'self.or' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":365,"end":365}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1651c76b0980ce998dbb5f5d97dfd646","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#method_missing calls 'Regexp.last_match(1)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":349,"end":350}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"eb118a0dcb4322da28060fe71e3cdc0d","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#results calls '@response['search']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":135,"end":136}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"7203313018fa198bdce3d122d7d68c62","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Search#results calls '@response['search']['results']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":135,"end":136}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d06b5d6c1f93ba8d54453f0f72ab5c48","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Search#filters refers to 'options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":62,"end":67}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"13726ab882cebc8fe3b00396db958f39","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::Search assumes too much for instance variable '@categories'","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"91e1ba4c29788e42fed34710b0bf3700","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::Search assumes too much for instance variable '@facet_values'","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"347f87f6c3f736a92f48320615c8052b","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::Search assumes too much for instance variable '@response'","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"4e155ac6b8f2f4cbb64acebe0b203d80","type":"issue","check_name":"NestedIterators","description":"Supplejack::Search#counts_params contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":213,"end":213}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class \u003c\u003c self\n def duck_names\n %i!tick trick track!.each do |surname|\n %i!duck!.each do |last_name|\n puts \"full name is #{surname} #{last_name}\"\n end\n end\n end\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [5]:Duck#duck_names contains iterators nested 2 deep (NestedIterators)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1d3bc7883fd7410d445785a497e68016","type":"issue","check_name":"NestedIterators","description":"Supplejack::Search#filters contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":69,"end":69}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class \u003c\u003c self\n def duck_names\n %i!tick trick track!.each do |surname|\n %i!duck!.each do |last_name|\n puts \"full name is #{surname} #{last_name}\"\n end\n end\n end\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [5]:Duck#duck_names contains iterators nested 2 deep (NestedIterators)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"065f090ded6305b4b4eea49258784264","type":"issue","check_name":"TooManyInstanceVariables","description":"Supplejack::Search has at least 19 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":8,"end":8}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0025a532647700d165be166b2b310d7e","type":"issue","check_name":"TooManyMethods","description":"Supplejack::Search has at least 23 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":8,"end":8}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e21ae050ebc0fb5ebb150b3011b66491","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Search#counts_params has approx 19 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":204,"end":204}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"293a4ff3c5a4edda486b9cd6a2385f02","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Search#facet_values_params has approx 13 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":260,"end":260}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6f2e3698da926d25a54a91c323015216","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Search#fetch_facet_values has approx 12 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":233,"end":233}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ad0755f436682a46828cb25257ff7529","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Search#filters has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":69,"end":69}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ad1dffa23d57f6430cd370efdbb65cdb","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Search#initialize has the variable name 'p'","categories":["Complexity"],"location":{"path":"lib/supplejack/search.rb","lines":{"begin":19,"end":19}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b997947db06d0485cd7cccc5e0335bc8","type":"issue","check_name":"BooleanParameter","description":"Supplejack::Story#as_json has boolean parameter 'include_contents'","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":284,"end":284}},"remediation_points":500000,"content":{"body":"`Boolean Parameter` is a special case of `Control Couple`, where a method parameter is defaulted to true or false. A _Boolean Parameter_ effectively permits a method's caller to decide which execution path to take. This is a case of bad cohesion. You're creating a dependency between methods that is not really necessary, thus increasing coupling.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def hit_the_switch(switch = true)\n if switch\n puts 'Hitting the switch'\n # do other things...\n else\n puts 'Not hitting the switch'\n # do other things...\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 3 warnings:\n [1]:Dummy#hit_the_switch has boolean parameter 'switch' (BooleanParameter)\n [2]:Dummy#hit_the_switch is controlled by argument switch (ControlParameter)\n```\n\nNote that both smells are reported, `Boolean Parameter` and `Control Parameter`.\n\n## Getting rid of the smell\n\nThis is highly dependent on your exact architecture, but looking at the example above what you could do is:\n\n* Move everything in the `if` branch into a separate method\n* Move everything in the `else` branch into a separate method\n* Get rid of the `hit_the_switch` method alltogether\n* Make the decision what method to call in the initial caller of `hit_the_switch`\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1860c03bffc03b40b607ca59fb0b9515","type":"issue","check_name":"BooleanParameter","description":"Supplejack::Story#to_json has boolean parameter 'include_contents'","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":288,"end":288}},"remediation_points":500000,"content":{"body":"`Boolean Parameter` is a special case of `Control Couple`, where a method parameter is defaulted to true or false. A _Boolean Parameter_ effectively permits a method's caller to decide which execution path to take. This is a case of bad cohesion. You're creating a dependency between methods that is not really necessary, thus increasing coupling.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def hit_the_switch(switch = true)\n if switch\n puts 'Hitting the switch'\n # do other things...\n else\n puts 'Not hitting the switch'\n # do other things...\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 3 warnings:\n [1]:Dummy#hit_the_switch has boolean parameter 'switch' (BooleanParameter)\n [2]:Dummy#hit_the_switch is controlled by argument switch (ControlParameter)\n```\n\nNote that both smells are reported, `Boolean Parameter` and `Control Parameter`.\n\n## Getting rid of the smell\n\nThis is highly dependent on your exact architecture, but looking at the example above what you could do is:\n\n* Move everything in the `if` branch into a separate method\n* Move everything in the `else` branch into a separate method\n* Get rid of the `hit_the_switch` method alltogether\n* Make the decision what method to call in the initial caller of `hit_the_switch`\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8f9ddb0c71261f57f92e552b80b28166","type":"issue","check_name":"ControlParameter","description":"Supplejack::Story#as_json is controlled by argument 'include_contents'","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":285,"end":285}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0c454b06cca594fd59f3e4aeca5c27b5","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Story#error? calls 'response['errors']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":295,"end":297}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e42b86b2277258f0b7033caac36ffa19","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Story#owned_by? calls 'user.try(:api_key)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":279,"end":281}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d2b04e5f29169efb745bae413415e730","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Story#save calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":58,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"dd01928dcf5a553deb226458461f4ca4","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::Story#self.all_public_stories calls 'response['sets']' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":239,"end":240}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"804106537e8cf2b64f92bab8220712ad","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Story#attributes= refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":178,"end":179}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6dc3298a7981ec96eaf1fd27bf9bb5c1","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::Story assumes too much for instance variable '@api_key'","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":4,"end":4}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"eaadb5c314e8052eaf15db6416f5574a","type":"issue","check_name":"TooManyMethods","description":"Supplejack::Story has at least 26 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/story.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fdf3ac9cd39f505f34f8b3066c12ecf1","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::StoryItem#attributes= refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/story_item.rb","lines":{"begin":37,"end":39}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ea43268a0c51583dfc336f4765760d93","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::StoryItemRelation assumes too much for instance variable '@items'","categories":["Complexity"],"location":{"path":"lib/supplejack/story_item_relation.rb","lines":{"begin":4,"end":4}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"86d0eb352bd63a289f9172edb346f95d","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::StoryItemRelation#build_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"lib/supplejack/story_item_relation.rb","lines":{"begin":61,"end":61}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ae246e4cbee52112944333f289dbd69c","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::StoryItemRelation#find has the variable name 'i'","categories":["Complexity"],"location":{"path":"lib/supplejack/story_item_relation.rb","lines":{"begin":34,"end":34}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"118edd219c4b6887c921bcbf67dc6473","type":"issue","check_name":"Attribute","description":"Supplejack::UrlFormats::ItemHash#h_locked is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"bf41455936ed808a6fc8f91d0e22c1c2","type":"issue","check_name":"Attribute","description":"Supplejack::UrlFormats::ItemHash#h_unlocked is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"379a30e66e835884fcf755f5e048c64b","type":"issue","check_name":"Attribute","description":"Supplejack::UrlFormats::ItemHash#i_locked is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c7757546474d26b5690f36abfd50bed8","type":"issue","check_name":"Attribute","description":"Supplejack::UrlFormats::ItemHash#i_unlocked is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"105e1b35b232fed355abe4f13cda70ab","type":"issue","check_name":"Attribute","description":"Supplejack::UrlFormats::ItemHash#params is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ad6eeac56f7124cea92fdb8ec8765607","type":"issue","check_name":"Attribute","description":"Supplejack::UrlFormats::ItemHash#search is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"56bb4b71b975fb77200a09282612edb1","type":"issue","check_name":"ControlParameter","description":"Supplejack::UrlFormats::ItemHash#filter_symbol is controlled by argument 'filter_type'","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":104,"end":103}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3944ff6826dd650310d96a28589ecb69","type":"issue","check_name":"ControlParameter","description":"Supplejack::UrlFormats::ItemHash#initialize is controlled by argument 'params'","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fcace6305e8fa1fa5a73a5dae7f4b042","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#options calls 'filter_options[:except]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":162,"end":200}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ad51de2440ad6d02e6fc0b86067b940e","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#options calls 'filter_options[:plus]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":190,"end":190}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"047ec6a79b7bec173139ddeef6ad2968","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#options calls 'search.page' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":200,"end":200}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"2c5a36b625f05dfd802df7142a17cce1","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'hash[:record_type]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":23,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f7bdb24d0c72324b814a919a91e24518","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:facet_pivots]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":29,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"9c5d06498ff54830aaea8c7d9765f9e6","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:facets]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":28,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3ab021e471bca8350d613081c59ffbf6","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:facets_per_page]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":30,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"5231113cef877fbb0edaa2fd52b765e7","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:geo_bbox]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":21,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"cba76357ab52176cc144ac1377da9d78","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:ignore_metrics]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":34,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c6db14288e02c420e19cdde872d30678","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:solr_query]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":33,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"cd900274c1202790fb06f97f199fefdb","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#to_api_hash calls 'params[:sort]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":37,"end":38}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"23d020e251c0b8aa17d51ee0a72996e7","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::ItemHash#without_filters calls '@without_filters[symbol]' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":85,"end":92}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"76e78660e1249b9fa28ada2d918802cc","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::UrlFormats::ItemHash#options refers to 'filters' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":168,"end":192}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a31c611a20b6708856492dbeca5ccf81","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::UrlFormats::ItemHash#text refers to 'text_values' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":117,"end":125}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f565fd30739b58c687db87b126030831","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::UrlFormats::ItemHash assumes too much for instance variable '@all_filters'","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"dbf0b66733f6dc501e1da6ee4a458a18","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::UrlFormats::ItemHash assumes too much for instance variable '@without_filters'","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d98de5c3faf2d95b11e92a23acb67d73","type":"issue","check_name":"NestedIterators","description":"Supplejack::UrlFormats::ItemHash#options contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":168,"end":172}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class \u003c\u003c self\n def duck_names\n %i!tick trick track!.each do |surname|\n %i!duck!.each do |last_name|\n puts \"full name is #{surname} #{last_name}\"\n end\n end\n end\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [5]:Duck#duck_names contains iterators nested 2 deep (NestedIterators)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"14b481388ba6e4046f0733f2af11f259","type":"issue","check_name":"TooManyInstanceVariables","description":"Supplejack::UrlFormats::ItemHash has at least 7 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"36b9ae335f34066d63d18d1543e606a9","type":"issue","check_name":"TooManyStatements","description":"Supplejack::UrlFormats::ItemHash#options has approx 24 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":160,"end":160}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d8ece0aa38ff2470959f8aeacdb3a5b1","type":"issue","check_name":"TooManyStatements","description":"Supplejack::UrlFormats::ItemHash#to_api_hash has approx 21 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":17,"end":17}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b9cb91209f5551ce2c39f4f992b7ebad","type":"issue","check_name":"UtilityFunction","description":"Supplejack::UrlFormats::ItemHash#requires_deep_merge? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":206,"end":206}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1057750062428f303999226ab1eb2e03","type":"issue","check_name":"UtilityFunction","description":"Supplejack::UrlFormats::ItemHash#text_field? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/item_hash.rb","lines":{"begin":76,"end":76}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c3a30b0cda546e12b49605b8e3fd4adc","type":"issue","check_name":"Attribute","description":"Supplejack::User#regenerate_api_key is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/user.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3b92786e86ac99e8f17ec12836a03a74","type":"issue","check_name":"Attribute","description":"Supplejack::User#use_own_api_key is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack/user.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"86d2f0653ac8c153126f150c8a3df420","type":"issue","check_name":"TooManyInstanceVariables","description":"Supplejack::User has at least 6 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack/user.rb","lines":{"begin":18,"end":18}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8d038aeaaf05807da65b23ec740beb1e","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSet#api_records calls 'record_hash[:record_id]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":73,"end":73}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fd82cd64822f54cc447352d5277a9b88","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSet#api_records calls 'self.records' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":70,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fd4f6d2de6ac73b5b73f7dfe074e59db","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSet#attributes= calls 'attributes[:ordered_records]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":177,"end":177}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0f4f3c38123c6e2e4b5ad232a3e847ad","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSet#owned_by? calls 'user.try(:api_key)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":271,"end":273}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"eb2f3ad3431d1577f2034b001e9a40d3","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSet#save calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":149,"end":152}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fe177db1fe826ae2ee7fedd0b16b75c9","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSet#self.featured_sets calls 'get(path)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":321,"end":324}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"5c96f22370187c22bbd7642147830118","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::UserSet assumes too much for instance variable '@api_key'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":19,"end":19}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6fca591488bf2702ab3f03a17064f135","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::UserSet assumes too much for instance variable '@priority'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":19,"end":19}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"66e12ab9ba34954372d92b440f96fc4a","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::UserSet assumes too much for instance variable '@tag_list'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":19,"end":19}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1d30a6c3e9586f003b2ce860b1d80e7a","type":"issue","check_name":"RepeatedConditional","description":"Supplejack::UserSet tests 'Supplejack.enable_caching' at least 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":154,"end":319}},"remediation_points":400000,"content":{"body":"`Repeated Conditional` is a special case of `Simulated Polymorphism`. Basically it means you are checking the same value throughout a single class and take decisions based on this.\n\n## Example\n\nGiven\n\n```Ruby\nclass RepeatedConditionals\n attr_accessor :switch\n\n def repeat_1\n puts \"Repeat 1!\" if switch\n end\n\n def repeat_2\n puts \"Repeat 2!\" if switch\n end\n\n def repeat_3\n puts \"Repeat 3!\" if switch\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 4 warnings:\n [5, 9, 13]:RepeatedConditionals tests switch at least 3 times (RepeatedConditional)\n```\n\nIf you get this warning then you are probably not using the right abstraction or even more probable, missing an additional abstraction.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"71ed5843d572d06057f6899efbef583a","type":"issue","check_name":"TooManyMethods","description":"Supplejack::UserSet has at least 24 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":19,"end":19}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a79b05435bb9853f5efd171526684be1","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::UserSet#record? has the variable name 'i'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":129,"end":129}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c49f71e4661ae35583eee59507c704d0","type":"issue","check_name":"UtilityFunction","description":"Supplejack::UserSet#ordered_records_from_array doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set.rb","lines":{"begin":200,"end":200}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"837f890460e0825353e539f34f3fdb72","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSetRelation#order calls 'attribute == :updated_at' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set_relation.rb","lines":{"begin":113,"end":115}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3e11e95ade8c68f1910e5ca341dd9460","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSetRelation#sets_response calls 'get(path, params)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set_relation.rb","lines":{"begin":57,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8c8f42306dc838598fc5bee9308c922e","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserSetRelation#sets_response calls 'user.api_key' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set_relation.rb","lines":{"begin":50,"end":52}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"59f043f6bda6da0e2dea9fbd3aa268e4","type":"issue","check_name":"InstanceVariableAssumption","description":"Supplejack::UserSetRelation assumes too much for instance variable '@sets'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_set_relation.rb","lines":{"begin":14,"end":14}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"2a4ead058fdf976b3ff1f1efe8e31540","type":"issue","check_name":"BooleanParameter","description":"Supplejack::UserStoryRelation#fetch has boolean parameter 'force'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_story_relation.rb","lines":{"begin":21,"end":21}},"remediation_points":500000,"content":{"body":"`Boolean Parameter` is a special case of `Control Couple`, where a method parameter is defaulted to true or false. A _Boolean Parameter_ effectively permits a method's caller to decide which execution path to take. This is a case of bad cohesion. You're creating a dependency between methods that is not really necessary, thus increasing coupling.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def hit_the_switch(switch = true)\n if switch\n puts 'Hitting the switch'\n # do other things...\n else\n puts 'Not hitting the switch'\n # do other things...\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 3 warnings:\n [1]:Dummy#hit_the_switch has boolean parameter 'switch' (BooleanParameter)\n [2]:Dummy#hit_the_switch is controlled by argument switch (ControlParameter)\n```\n\nNote that both smells are reported, `Boolean Parameter` and `Control Parameter`.\n\n## Getting rid of the smell\n\nThis is highly dependent on your exact architecture, but looking at the example above what you could do is:\n\n* Move everything in the `if` branch into a separate method\n* Move everything in the `else` branch into a separate method\n* Get rid of the `hit_the_switch` method alltogether\n* Make the decision what method to call in the initial caller of `hit_the_switch`\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8c46fcac981111e87251a6bb794163c4","type":"issue","check_name":"BooleanParameter","description":"Supplejack::UserStoryRelation#to_json has boolean parameter 'include_contents'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_story_relation.rb","lines":{"begin":98,"end":98}},"remediation_points":500000,"content":{"body":"`Boolean Parameter` is a special case of `Control Couple`, where a method parameter is defaulted to true or false. A _Boolean Parameter_ effectively permits a method's caller to decide which execution path to take. This is a case of bad cohesion. You're creating a dependency between methods that is not really necessary, thus increasing coupling.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def hit_the_switch(switch = true)\n if switch\n puts 'Hitting the switch'\n # do other things...\n else\n puts 'Not hitting the switch'\n # do other things...\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 3 warnings:\n [1]:Dummy#hit_the_switch has boolean parameter 'switch' (BooleanParameter)\n [2]:Dummy#hit_the_switch is controlled by argument switch (ControlParameter)\n```\n\nNote that both smells are reported, `Boolean Parameter` and `Control Parameter`.\n\n## Getting rid of the smell\n\nThis is highly dependent on your exact architecture, but looking at the example above what you could do is:\n\n* Move everything in the `if` branch into a separate method\n* Move everything in the `else` branch into a separate method\n* Get rid of the `hit_the_switch` method alltogether\n* Make the decision what method to call in the initial caller of `hit_the_switch`\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"28b271360a0ee2c2ef1f4d36b57b7838","type":"issue","check_name":"ControlParameter","description":"Supplejack::UserStoryRelation#fetch is controlled by argument 'force'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_story_relation.rb","lines":{"begin":24,"end":24}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e0fd1df9674ec34677b13a914af79dcd","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserStoryRelation#fetch calls 'fetch_stories.call' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_story_relation.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"acb98ae92563b03e6a68efe4bcd61010","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UserStoryRelation#fetch_api_stories calls 'get(path, params)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack/user_story_relation.rb","lines":{"begin":125,"end":128}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"80d19f994afde7023248704ddc77d2a8","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::UserStoryRelation#fetch has the variable name 's'","categories":["Complexity"],"location":{"path":"lib/supplejack/user_story_relation.rb","lines":{"begin":22,"end":22}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"aa9e1c2e6527c548b7ed72179266f970","type":"issue","check_name":"DataClump","description":"Supplejack::Util takes parameters ['left', 'right'] to 3 methods","categories":["Complexity"],"location":{"path":"lib/supplejack/util.rb","lines":{"begin":46,"end":88}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n\u003e The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"2461165156ffefe54e0bb6b662038bb7","type":"issue","check_name":"TooManyStatements","description":"Supplejack::Util#deep_merge_into has approx 12 statements","categories":["Complexity"],"location":{"path":"lib/supplejack/util.rb","lines":{"begin":88,"end":88}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a1fad09693bb21a018578244550d30bf","type":"issue","check_name":"UncommunicativeVariableName","description":"Supplejack::Util#deep_merge_into has the variable name 'k'","categories":["Complexity"],"location":{"path":"lib/supplejack/util.rb","lines":{"begin":104,"end":104}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"}]