-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcodeclimate_diff_baseline.json
More file actions
257 lines (257 loc) · 332 KB
/
codeclimate_diff_baseline.json
File metadata and controls
257 lines (257 loc) · 332 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
[{"engine_name":"structure","fingerprint":"9df6e523b1b6d9f42c1420a532649a6e","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_multiple` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":40,"end":53}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"c5b92e15c6bfb49c63413b8032bfc730","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_next_and_previous_records` has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":60,"end":104}},"other_locations":[],"remediation_points":2750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"c3ff73e6660787b6a2ae653991e084b3","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `find_next_and_previous_records` has 32 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":60,"end":104}},"other_locations":[],"remediation_points":768000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"d3d0c26ce8df1a568861c24701a68570","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 `build_sunspot_schema` has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":42,"end":69}},"other_locations":[],"remediation_points":1150000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"451cec51beb6f2e1ed46fb9af1b2d55f","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 `unset_null_fields` has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/support/harvestable.rb","lines":{"begin":13,"end":29}},"other_locations":[],"remediation_points":950000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"4d9c19f154af6a14d58016b35bbed1c4","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 `custom_find` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":36,"end":64}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"b537dccbe3256557f0a1d3af9cfdb8b7","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 `build_sunspot_schema` has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":66,"end":86}},"other_locations":[],"remediation_points":750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"30f3ac29a9ecdb66e6ef1ff6a2fce6c5","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 `build_model_fields` has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/supplejack_api/support/storable.rb","lines":{"begin":24,"end":39}},"other_locations":[],"remediation_points":1650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"d4f962fec185e4bfd460d31aebb711cb","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 `cast_param` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":9,"end":16}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"4a6bca3a537036bdf6dba5ff0e35c601","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 `new_fragment_attributes` has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":58,"end":87}},"other_locations":[],"remediation_points":1050000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"9a0ac64ce978c6f03f13af9736edc64f","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 `recurse_conditions` has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":31,"end":54}},"other_locations":[],"remediation_points":850000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"2c8e636859e7f964bfda58ccea50ba7f","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_values` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":59,"end":84}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"44592ab836aad8d4a7471e42c5e88d37","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 `with_query_for_facet_exclusion` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/solr_queries/query_builder/exclude_filters_from_facets.rb","lines":{"begin":43,"end":61}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"137753dc8ea90a919155e4390e5ea55f","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 `call` has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/solr_queries/query_builder/facet_row.rb","lines":{"begin":21,"end":44}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"80e768137b8319d6f771cc52288cd31c","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 `call` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/solr_queries/query_builder/facets.rb","lines":{"begin":23,"end":42}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"562a8eb5f5b290adc5e94af58e3a0da5","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 `perform` has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/supplejack_api/store_user_activity_worker.rb","lines":{"begin":9,"end":35}},"other_locations":[],"remediation_points":750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"57cbeca9889ba320ddc18bdea0ffb962","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 `time` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":49,"end":61}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"201ffa305ca83fba210b5d4af40be6be","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 `validate_each` has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/url_validator.rb","lines":{"begin":4,"end":19}},"other_locations":[],"remediation_points":750000,"severity":"minor","type":"issue"},
{"name":"ruby.parse.succeeded","type":"measurement","value":116,"engine_name":"structure"},
{"name":"ruby.parse.parse_error","type":"measurement","value":18,"engine_name":"structure"},
{"engine_name":"duplication","fingerprint":"0d205c2393b3d3b763aca483a9a02498","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/serializers/supplejack_api/concept_serializer.rb","lines":{"begin":33,"end":47}},"remediation_points":430000,"other_locations":[{"path":"app/serializers/supplejack_api/record_serializer.rb","lines":{"begin":13,"end":27}}],"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 39**.\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":"6adcf10fecf18c82f85db35e69b583f3","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/serializers/supplejack_api/record_serializer.rb","lines":{"begin":13,"end":27}},"remediation_points":430000,"other_locations":[{"path":"app/serializers/supplejack_api/concept_serializer.rb","lines":{"begin":33,"end":47}}],"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 39**.\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":"bed2401dcdd1b1741617ec596094123f","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":9,"end":15}},"remediation_points":250000,"other_locations":[{"path":"app/solr_queries/query_builder/base.rb","lines":{"begin":15,"end":21}}],"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 30**.\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":"62e6c33b19136c5abdac21539458e27e","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/solr_queries/query_builder/base.rb","lines":{"begin":15,"end":21}},"remediation_points":250000,"other_locations":[{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":9,"end":15}}],"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 30**.\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":"f52f7698e06cca4d1a24332d32c2c7d2","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/workers/supplejack_api/index_source_worker.rb","lines":{"begin":28,"end":37}},"remediation_points":570000,"other_locations":[{"path":"app/workers/supplejack_api/index_source_worker.rb","lines":{"begin":41,"end":50}}],"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 46**.\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":"f52f7698e06cca4d1a24332d32c2c7d2","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/workers/supplejack_api/index_source_worker.rb","lines":{"begin":41,"end":50}},"remediation_points":570000,"other_locations":[{"path":"app/workers/supplejack_api/index_source_worker.rb","lines":{"begin":28,"end":37}}],"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 46**.\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":"63985a9e5a71cef66c4eccdecd40ebd5","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/controllers/supplejack_api/harvester/partners_controller.rb","lines":{"begin":6,"end":14}},"remediation_points":190000,"other_locations":[{"path":"app/controllers/supplejack_api/harvester/sources_controller.rb","lines":{"begin":6,"end":15}}],"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 27**.\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":"d3a0e7ee8c77bac06a96f8485ad1baaf","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/controllers/supplejack_api/harvester/sources_controller.rb","lines":{"begin":6,"end":15}},"remediation_points":190000,"other_locations":[{"path":"app/controllers/supplejack_api/harvester/partners_controller.rb","lines":{"begin":6,"end":14}}],"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 27**.\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":"edf7f2f83a8557cfad2f8ae155143249","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":79,"end":81}},"remediation_points":190000,"other_locations":[{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":93,"end":95}}],"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 27**.\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":"edf7f2f83a8557cfad2f8ae155143249","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":93,"end":95}},"remediation_points":190000,"other_locations":[{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":79,"end":81}}],"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 27**.\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":"0bd6547bd5de28d4c57cb99285b807a3","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/supplejack_api/faceted_metrics.rb","lines":{"begin":25,"end":27}},"remediation_points":170000,"other_locations":[{"path":"app/models/supplejack_api/faceted_metrics.rb","lines":{"begin":34,"end":36}}],"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 26**.\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":"0bd6547bd5de28d4c57cb99285b807a3","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/supplejack_api/faceted_metrics.rb","lines":{"begin":34,"end":36}},"remediation_points":170000,"other_locations":[{"path":"app/models/supplejack_api/faceted_metrics.rb","lines":{"begin":25,"end":27}}],"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 26**.\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":"a4866929b97e68283caf513023587544","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack_api/index_processor.rb","lines":{"begin":17,"end":21}},"remediation_points":170000,"other_locations":[{"path":"lib/supplejack_api/index_processor.rb","lines":{"begin":25,"end":29}}],"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 26**.\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":"a4866929b97e68283caf513023587544","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack_api/index_processor.rb","lines":{"begin":25,"end":29}},"remediation_points":170000,"other_locations":[{"path":"lib/supplejack_api/index_processor.rb","lines":{"begin":17,"end":21}}],"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 26**.\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":"9542bfaa0a6a17e8b69054f62deb6a81","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::ConceptsController#index calls 'request.format' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/concepts_controller.rb","lines":{"begin":20,"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":"ba18ea9ca1cb27ebb165f79326c47d55","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::ConceptsController#index calls 'request.format.to_sym' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/concepts_controller.rb","lines":{"begin":20,"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":"17c483afd6b68ab385a4dfc17d5a9583","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::ConceptsController#show calls 'params[:id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/concepts_controller.rb","lines":{"begin":30,"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":"69c70ecf06021c9dae64c5ba0dd6a35c","type":"issue","check_name":"MissingSafeMethod","description":"SupplejackApi::Harvester::BaseController has missing safe method 'authenticate_harvester!'","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/base_controller.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A candidate method for the `Missing Safe Method` smell are methods whose names end with an exclamation mark.\n\nAn exclamation mark in method names means (the explanation below is taken from [here](http://dablog.rubypal.com/2007/8/15/bang-methods-or-danger-will-rubyist) ):\n\n\u003e\u003e\nThe ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name.\nSo, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.\n\nSuch a method is called `Missing Safe Method` if and only if her non-bang version does not exist and this method is reported as a smell.\n\n## Example\n\nGiven\n\n```Ruby\nclass C\n def foo; end\n def foo!; end\n def bar!; end\nend\n```\n\nReek would report `bar!` as `Missing Safe Method` smell but not `foo!`.\n\nReek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:\n\n\n```Ruby\nclass Parent\n def foo; end\nend\n\nmodule Dangerous\n def foo!; end\nend\n\nclass Son \u003c Parent\n include Dangerous\nend\n\nclass Daughter \u003c Parent\nend\n```\n\nIn this example, Reek would not report the `Missing Safe Method` smell for the method `foo` of the `Dangerous` module.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e7474ac8233b0c538cab172c1259dded","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::ConceptsController#create calls 'params[:concept]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/concepts_controller.rb","lines":{"begin":15,"end":17}},"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":"6d2aa13372f92c96064a22f6d38f052a","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::ConceptsController#update calls 'params[:concept]' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/concepts_controller.rb","lines":{"begin":26,"end":27}},"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":"ef29e88b73db45a5dc77026cf3d5fcea","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::ConceptsController#update calls 'params[:concept][:status]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/concepts_controller.rb","lines":{"begin":26,"end":27}},"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":"5862f974d1ba11d973426d8ad71dec9b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::FragmentsController#create calls '@record.record_id' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/fragments_controller.rb","lines":{"begin":9,"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":"74375eb5b12fc184fdc91e0b9364e9eb","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::FragmentsController#destroy calls 'params[:id]' 5 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/fragments_controller.rb","lines":{"begin":24,"end":37}},"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":"97f15d147e22242a8ef4a68390a8c4f8","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::PartnersController#create calls 'partner_params[:_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/partners_controller.rb","lines":{"begin":7,"end":8}},"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":"3ac5065d21cda0f8a1671b0e2dbfadf2","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::SourcesController#create calls 'source_params[:_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/sources_controller.rb","lines":{"begin":7,"end":8}},"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":"dd9bd2783bc986b4a9a9aa12a1f153da","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::SourcesController#index calls 'params[:limit]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/sources_controller.rb","lines":{"begin":20,"end":20}},"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":"010d78741d7322425c6f29e301447a84","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Harvester::SourcesController#index calls 'params[:order_by]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/harvester/sources_controller.rb","lines":{"begin":19,"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":"44ff2337dee750cdbb710564b11a35b3","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#default_serializer_options calls '@search.options' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":92,"end":93}},"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":"929c04911de510fa4e35fbe7b8d7b383","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#default_serializer_options calls '@search.options.fields' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":92,"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":"5241e1d356669f76b1684919ee1e65a5","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#default_serializer_options calls '@search.options.group_list' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":93,"end":93}},"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":"5bce6e0949ba376972c5088da3be5fdb","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#index calls 'request.original_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":25,"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":"101b8ebb5b75666e2db130cbf2f479e7","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#index calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":23,"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":"ce6b0321d2bc5f2b1867e298744a8458","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#index calls 'self.class.search_serializer_class' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":23,"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":"6fdeb3339f520c6edbd562ada2fd5af1","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#set_concept_param calls 'params[:and]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":113,"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":"682a6b4ee39e727fa88524dadffebb78","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#set_concept_param calls 'params[:concept_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":112,"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":"8d21c0b87421fdc35920772eb17849ad","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#show calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":51,"end":56}},"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":"f43dec0c204c564b8da72fa15580c6f8","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::RecordsController#show calls 'self.class.record_serializer_class' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":51,"end":56}},"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":"e777d63f8ff2dfb8ade9ca51e48af297","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::RecordsController#index has approx 11 statements","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/records_controller.rb","lines":{"begin":16,"end":16}},"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":"92d01095e80bf212e539b5683ac7942a","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StatusController#mongod_up? calls 'Support::StatusLogger.logger' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/status_controller.rb","lines":{"begin":58,"end":62}},"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":"bd17465b2a8b6eb403b396eaef34e937","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StatusController#mongod_up? calls 'session.command(ping: 1)' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/status_controller.rb","lines":{"begin":56,"end":58}},"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":"d9e886da60d3b2e25d65590864042328","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StatusController#show calls 'head :internal_server_error' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/status_controller.rb","lines":{"begin":27,"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":"7eb5714ee56da8728ab27f2c08856df3","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StatusController#solr_up? calls 'Hash.from_xml(resource)' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/status_controller.rb","lines":{"begin":44,"end":46}},"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":"9bf17aac79d677ffb618ae43cb401850","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StatusController#solr_up? calls 'Hash.from_xml(resource)['response']' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/status_controller.rb","lines":{"begin":44,"end":46}},"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":"af35bfe0ace625e34b2b11f64fe274c4","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StatusController#solr_up? calls 'Support::StatusLogger.logger' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/supplejack_api/status_controller.rb","lines":{"begin":46,"end":50}},"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":"dabacf90c469fe1141759d8179b56795","type":"issue","check_name":"ClassVariable","description":"SupplejackApi::ApiConcept::ConceptFragment declares the class variable '@@mutable_fields'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/api_concept/concept_fragment.rb","lines":{"begin":17,"end":17}},"remediation_points":350000,"content":{"body":"Class variables form part of the global runtime state, and as such make it easy for one part of the system to accidentally or inadvertently depend on another part of the system. So the system becomes more prone to problems where changing something over here breaks something over there. In particular, class variables can make it hard to set up tests (because the context of the test includes all global state).\n\nFor a detailed explanation, check out [this article](http://4thmouse.com/index.php/2011/03/20/why-class-variables-in-ruby-are-a-bad-idea/)\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n @@class_variable = :whatever\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Dummy declares the class variable @@class_variable (ClassVariable)\n```\n\n## Getting rid of the smell\n\nYou can use class-instance variable to mitigate the problem (as also suggested in the linked article above):\n\n```Ruby\nclass Dummy\n @class_variable = :whatever\nend\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8dc8753ee2f608bf563d676a8ddfe374","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concept#self.build_context calls 'ConceptSchema.model_fields' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":16,"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":"f354ca40d2511e556f7d75764d3805d2","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concept#self.build_context calls 'ConceptSchema.model_fields[field]' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":16,"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":"42a3fdef4b1d68b90f696e9ded25fb42","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concept#self.build_context calls 'ConceptSchema.model_fields[field].try(:namespace)' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":16,"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":"17129ff09c6dbfb222a25deadd249788","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concept#self.build_context calls 'ConceptSchema.namespaces' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":20,"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":"a69592ec47d90ea9d17ab307f1e40d19","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concept#self.build_context calls 'field.namespace' 3 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":21,"end":24}},"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":"b9662927ba52898cabaa83d1cfd34b6c","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concept#self.build_context calls 'fields.each' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":15,"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":"bbad1a214673227959cf3b8132191a78","type":"issue","check_name":"NestedIterators","description":"SupplejackApi::Concept#self.build_context contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":21,"end":22}},"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":"c85e47c8a430552a55abb5029388012b","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::Concept#self.build_context has approx 18 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept.rb","lines":{"begin":11,"end":11}},"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":"84e40874a47633ca85374504b42119a2","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::ConceptSearch#field_list has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept_search.rb","lines":{"begin":32,"end":33}},"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":"0f9199d716738481817d0b46ae16eabe","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::ConceptSearch#group_list has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concept_search.rb","lines":{"begin":43,"end":44}},"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":"d9edc9f47dd54c8e3a24015043842a02","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Concerns::QueryableByDate::ClassMethods#created_on refers to 'date' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/queryable_by_date.rb","lines":{"begin":16,"end":16}},"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":"13a532c838119e7e3df9e5372a4fec91","type":"issue","check_name":"Attribute","description":"SupplejackApi::Concerns::Record#next_page is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":7,"end":7}},"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":"998d4b6b74868ca43dc10ec5bdde0388","type":"issue","check_name":"Attribute","description":"SupplejackApi::Concerns::Record#next_record is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":7,"end":7}},"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":"4e1155bd1d497a7e1f7cdbce968d9914","type":"issue","check_name":"Attribute","description":"SupplejackApi::Concerns::Record#previous_page is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":7,"end":7}},"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":"93a946859cc84f1f69e3dfdb27fdf5c7","type":"issue","check_name":"Attribute","description":"SupplejackApi::Concerns::Record#previous_record is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":7,"end":7}},"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":"f5fbaecee2e8c926167e35b816f0df3a","type":"issue","check_name":"Attribute","description":"SupplejackApi::Concerns::Record#should_index_flag is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.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":"c9f824dd4f78bbf93c9af483e24c1156","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records calls 'search.hits' 5 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":66,"end":98}},"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":"32bc693984120fe8ddb85775cfdc3b34","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records calls 'search.options' 9 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":70,"end":95}},"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":"1d6a4e0bcacff76ac6e092b3003f295d","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records calls 'search.options.page + 1' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":93,"end":95}},"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":"19ddb35131b69f0c4c50a8d270ad1ffc","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records calls 'search.options.page - 1' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":79,"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":"73abf1e5022dc02f451837eb6c8c9b1d","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records calls 'search.options.page' 8 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":72,"end":95}},"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":"ddcce2c652c886c984c0715736b57470","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#self.find_multiple calls 'id.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":43,"end":44}},"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":"431273f339c05bd20911a00ddafe73f6","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#self.find_multiple calls 'id.to_s.length' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":43,"end":44}},"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":"634990ee5a1d227690db226521303bb6","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#self.find_multiple calls 'ids.find_all' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":43,"end":44}},"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":"e575ac2fef5f341abb15fcf39760078f","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Record#self.find_multiple calls 'record.record_id' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":51,"end":51}},"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":"f0bfd33a77d7930c7a673ea7b9f6e0ad","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records refers to 'search' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":64,"end":98}},"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":"6ddf94cdcfa6d078685d18113d1c819b","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records has approx 23 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.rb","lines":{"begin":60,"end":60}},"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":"6527a5f036dcbf58e88c0bf62938431d","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Concerns::Record#find_next_and_previous_records has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/record.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":"d2b29194df054ceb0721e5908511f4e9","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::Taggable#tag_list= calls 'tags_string.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/concerns/taggable.rb","lines":{"begin":17,"end":18}},"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":"234944d9b3445cc59ac765ae98a7a5e3","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::FacetedMetrics#replace_periods calls 'key_replacer('.', \"\\u2024\")' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/faceted_metrics.rb","lines":{"begin":26,"end":27}},"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":"834b848b8fd46e138da62cdfd950f490","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::FacetedMetrics#replace_unicode_periods calls 'key_replacer(\"\\u2024\", '.')' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/faceted_metrics.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":"c6eef8c83aa89a4d09cf129382b6640a","type":"issue","check_name":"DataClump","description":"SupplejackApi::SchemaDefinition::ClassMethods takes parameters ['name', 'options'] to 6 methods","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":32,"end":76}},"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":"a525bfcd16437586c6687fee9f0f94e5","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::ClassMethods#field calls 'self.fields' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":33,"end":37}},"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":"78bb5b614059d0478f7a695e1868c39b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::ClassMethods#group calls 'self.groups' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":45,"end":50}},"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":"dcef3f20383e30f718108c91012447f9","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::ClassMethods#model_field calls 'self.model_fields' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":77,"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":"073e3fca519a8f65a9a466359fbafe87","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::ClassMethods#mongo_index calls 'self.mongo_indexes' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":70,"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":"469368be4c333c4c14c7dd9b395d713d","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::ClassMethods#namespace calls 'self.namespaces' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":63,"end":66}},"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":"c54cdf2bbd80f4fb1d76a554a1267375","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::ClassMethods#role calls 'self.roles' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":54,"end":59}},"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":"52d7c1bc1dd88e00bca6eb34bf6b0ec0","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::Field#namespace_field calls '@options[:namespace_field]' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":121,"end":121}},"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":"14af833675187a19d4d5920246ded205","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SchemaDefinition::Group#include_groups_from calls '@options[:includes]' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":130,"end":132}},"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":"1fdddd91021fa86fc9e0bfa74951d193","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::SchemaDefinition::Group#include_groups_from has the variable name 'g'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/schema_definition.rb","lines":{"begin":132,"end":132}},"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":"e1a3b136118925a22c0eb19d4dc390e8","type":"issue","check_name":"Attribute","description":"SupplejackApi::Search#errors is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":5,"end":5}},"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":"9b24a2ca39e58925bfb2ef40d7c80917","type":"issue","check_name":"Attribute","description":"SupplejackApi::Search#options is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":5,"end":5}},"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":"a7fcf5aa417101ccc288b109ed239216","type":"issue","check_name":"Attribute","description":"SupplejackApi::Search#scope is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":5,"end":5}},"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":"19a9a8b3fe67ae61c7bdf9a9c4ee110a","type":"issue","check_name":"Attribute","description":"SupplejackApi::Search#solr_request_params is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":5,"end":5}},"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":"7668b4d96c2c2407a74822b0b481e4d0","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Search#execute_solr_search calls 'self.errors' 3 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":57,"end":61}},"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":"5f053e1ffde93d556ebc6df10d1be369","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Search#initialize calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":12,"end":12}},"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":"06810e33e099ba27c198e08e7dbe446c","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Search#self.role_collection_restrictions calls 'schema_class.roles' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":72,"end":74}},"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":"0a098be0d02f8b5aa8e463eb9f90cd6b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Search#self.role_collection_restrictions calls 'schema_class.roles[role]' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":72,"end":74}},"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":"6cc99a46d8131b32144fb844c37ac7a7","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Search#self.role_collection_restrictions calls 'schema_class.roles[role].record_restrictions' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":72,"end":74}},"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":"7159a4f71b9af3b6cd984282f7c460af","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Search#valid? calls 'self.errors' 3 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":25,"end":37}},"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":"b370ae88490da422c855c7f9ecc69dc3","type":"issue","check_name":"NestedIterators","description":"SupplejackApi::Search#facets_hash contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":112,"end":112}},"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":"4504cfa73dff569d438928edbcea40ff","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::Search#search_builder has approx 19 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/search.rb","lines":{"begin":78,"end":78}},"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":"65f0c6894b262e6f60be78631a6f4a0a","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::SiteActivity#self.generate_activity calls 'user_activity.send(field)' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/site_activity.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":"e8cac57ea814bf558e4e20f101706966","type":"issue","check_name":"NestedIterators","description":"SupplejackApi::SiteActivity#self.generate_activity contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/site_activity.rb","lines":{"begin":29,"end":29}},"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":"0c06c6a82ba99536d0dbf456afc51e5b","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::SiteActivity#self.generate_activity has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/site_activity.rb","lines":{"begin":22,"end":22}},"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":"d2b099e9a79195315ca6f8359d7f0743","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Source#query_solr refers to 'params' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/source.rb","lines":{"begin":41,"end":43}},"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":"14d588d7cdf54ba25bd88f1e1004b7c7","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Concept::Searchable::ClassMethods#build_sunspot_schema calls 'field.name' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":61,"end":66}},"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":"34687e2c1607c29f87bceb9bd7eb2395","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Concept::Searchable::ClassMethods#build_sunspot_schema calls 'field.search_boost' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":65,"end":65}},"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":"e4a00d0a231e423b6df54d829b994501","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Concept::Searchable::ClassMethods#build_sunspot_schema calls 'field.search_value' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":48,"end":50}},"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":"44aa7538d217b394bceb25b89f2f7663","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Concept::Searchable::ClassMethods#build_sunspot_schema calls 'field.solr_name' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":54,"end":54}},"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":"a74d75ab7ed487ae7ea31b2b31935119","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Support::Concept::Searchable::ClassMethods#build_sunspot_schema refers to 'field' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":45,"end":66}},"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":"1496ffc77145a1af1592b7ba6df7b05e","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::Support::Concept::Searchable::ClassMethods#build_sunspot_schema has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/searchable.rb","lines":{"begin":42,"end":42}},"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":"578daad6e533ac9809d50dbe44076604","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::Support::Concept::Storable#context doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/concept/storable.rb","lines":{"begin":48,"end":48}},"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":"d489631af74dbbbf794a1f460a779930","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Harvestable#unset_null_fields calls 'raw_json['fragments']' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/harvestable.rb","lines":{"begin":19,"end":20}},"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":"30bd73f655eb226e2d252b90c3987b14","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Harvestable#unset_null_fields calls 'value.nil?' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/harvestable.rb","lines":{"begin":17,"end":24}},"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":"78c66194bb63cb3b076b891e11746fee","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Support::Harvestable::ClassMethods#find_or_initialize_by_identifier refers to 'identifier' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/harvestable.rb","lines":{"begin":34,"end":34}},"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":"b91c58b7018e3e77e94b91d66f3149e1","type":"issue","check_name":"NestedIterators","description":"SupplejackApi::Support::Harvestable#unset_null_fields contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/harvestable.rb","lines":{"begin":23,"end":23}},"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":"034490bff8e6e2ee840bfc6045da544f","type":"issue","check_name":"DataClump","description":"SupplejackApi::Support::Searchable::ClassMethods takes parameters ['builder', 'field', 'options', 'value_block'] to 3 methods","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":88,"end":102}},"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":"496b2d6bb613874a8f78e9b736b7d949","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Searchable::ClassMethods#add_fulltext_to calls 'field.search_boost' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.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":"c242400aae971c0c9155cab6a0779b10","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Searchable::ClassMethods#build_sunspot_schema calls 'field.search_value' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":72,"end":74}},"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":"91bd12d9ea7df7351a60ee93160fca56","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Searchable::ClassMethods#build_sunspot_schema calls 'field.solr_name' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":78,"end":78}},"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":"3a9dc19e2e7cdeab1e62dc7e2dfb7f98","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::Support::Searchable::ClassMethods#custom_find has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":36,"end":36}},"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":"5f061ca84b91b0f696dc22bda1375d62","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::Support::Searchable::ClassMethods#add_filter_to doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":88,"end":88}},"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":"36ffa4fc08586a2a04ff49ed0fe0af21","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::Support::Searchable::ClassMethods#add_fulltext_to doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":96,"end":96}},"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":"043672c23d00246c03215330865d39e6","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::Support::Searchable::ClassMethods#add_mlt_to doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/searchable.rb","lines":{"begin":102,"end":102}},"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":"8edcc3d3e9b4f403c8a626341f167d86","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Storable#self.build_model_fields calls 'RecordSchema.model_fields' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/storable.rb","lines":{"begin":25,"end":27}},"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":"f5cf1fe85feb34f6e00d3f0f46b8f35c","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Storable#self.build_model_fields calls 'index.field_options' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/storable.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":"6e8b386ba102334e4ec6ccc00c6d359f","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Storable#self.build_model_fields calls 'index.index_fields' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/storable.rb","lines":{"begin":32,"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":"1185fce5ea091cf75dbcc234beecc2c5","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Storable#self.build_model_fields calls 'index.index_options' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/storable.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":"60aae0c7cbad09b6cf3aec6cd99e7e1a","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Storable#self.build_model_fields calls 'index.validation' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/storable.rb","lines":{"begin":37,"end":37}},"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":"7de6a5f2da5d9f8037581ea2ed05680f","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Support::Storable#self.build_model_fields calls 'name.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/support/storable.rb","lines":{"begin":29,"end":37}},"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":"4c421185b83d5d2833a3a82cd3e782fe","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#increment_daily_requests calls 'self.daily_requests' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":78,"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":"7de7866ad6fa822f809add0c6a246be7","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#requests_per_day calls 'days.days' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.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":"27806732fc3429539b04e3ea60450d99","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#requests_per_day calls 'today - days.days' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.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":"fb7ff7a029ed487a17c270375a4e9b81","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#update_daily_activity calls 'request.params' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":99,"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":"98cf798ce24d91081949a39a70d07a6c","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#update_daily_activity calls 'self.daily_activity' 4 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":110,"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":"7a6db1d4d8ad5d9fe3fef2558be66729","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#update_daily_activity calls 'self.daily_activity[controller]' 3 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":111,"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":"c3a6a921f5efc023d98b306f328479ce","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::User#update_tracked_fields calls 'self.sign_in_count' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":93,"end":94}},"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":"2cac4555bc2b57e207c945c69001149a","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::User#update_daily_activity has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":97,"end":97}},"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":"738e99544ae018580a3db9a4e443120d","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::User#split_on_at_symbol doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/user.rb","lines":{"begin":152,"end":152}},"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":"91c3c4beff8669864abe3b27bc21d31b","type":"issue","check_name":"LongParameterList","description":"SupplejackApi::Concerns::FacetsParams#init_facets has 5 parameters","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/facets_params.rb","lines":{"begin":10,"end":10}},"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":"56075efb45a9ee3798c90ed83d18a3ef","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Concerns::FacetsParams#facets_param has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/facets_params.rb","lines":{"begin":21,"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":"85d8849eeb4bbdd5eba08b182daa3f25","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Concerns::FieldsParams#query_fields_param refers to 'query_fields' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/fields_params.rb","lines":{"begin":36,"end":38}},"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":"b520bef4630988d3f4e4fa7e539ec255","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Concerns::FieldsParams#fields_param has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/fields_params.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":"b17b4ebdc8372befb237e66b7e77c04f","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Concerns::FieldsParams#group_list_param has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/fields_params.rb","lines":{"begin":27,"end":27}},"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":"3303316c87f33c81a4d26315509771de","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::HelpersParams#integer_param calls 'self.class' 4 times","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":25,"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":"00bc7e5edac0a078f399264a2a12af33","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::HelpersParams#integer_param calls 'self.class.max_values' 4 times","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":25,"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":"472a50df46778dac6f3371697b3ce975","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Concerns::HelpersParams#integer_param calls 'self.class.max_values[param]' 4 times","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":25,"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":"48600fdb16bd9a852b51349c76c45576","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::Concerns::HelpersParams#cast_param doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/helpers_params.rb","lines":{"begin":9,"end":9}},"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":"ce1590207e1de2d7517b413ce77d3aa0","type":"issue","check_name":"NestedIterators","description":"SupplejackApi::Concerns::WithoutParams#init_without contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/concerns/without_params.rb","lines":{"begin":13,"end":13}},"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":"06f0f1e3c1eda58bffd6f0d0796f1bab","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackApi::MltParams assumes too much for instance variable '@params'","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/mlt_params.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":"35e49f902a50182195148a6bf1370eb5","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackApi::MltParams has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/mlt_params.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":"be1dd07133dae251975fde7a38db6bfb","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#and_condition is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"31ffb2e78e42025af866d1e1fcff7660","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#debug is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.rb","lines":{"begin":17,"end":17}},"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":"374c8dc1f577dce8eed61030db331bdf","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#exclude_filters_from_facets is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"3a6ee7678e7470490cc0367b17c3e259","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#geo_bbox is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"7f16e1246e2b4a27235caa156a2ad7ca","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#model_class is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.rb","lines":{"begin":7,"end":7}},"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":"2b2673aa1a98beb7e2653a8639b49d1f","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#or_condition is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"1f8e541d502794c32217e27d8b9e92f7","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#record_type is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"4082e348c66360e90cd99050cde0cd74","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#schema_class is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"a2d42120b1bc6db862210a54b0f52278","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#solr_query is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.rb","lines":{"begin":16,"end":16}},"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":"0b692020abbe8acbffbc70afe0518b2b","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#suggest is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.rb","lines":{"begin":14,"end":14}},"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":"825f1eb282b9f019c3f97a3b79abc158","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#text is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.rb","lines":{"begin":15,"end":15}},"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":"849ef0688139a50d6ff7b4c93e641573","type":"issue","check_name":"Attribute","description":"SupplejackApi::SearchParams#without is a writable attribute","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"cc97cb8f5a76bbcd40a3672e678bb27d","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackApi::SearchParams assumes too much for instance variable '@params'","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"42f6a7d00ec1d32a9e42c21cbf77d7b0","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackApi::SearchParams has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/params/supplejack_api/search_params.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":"c48ca2985be36a35a40c3741982d5ab9","type":"issue","check_name":"BooleanParameter","description":"BatchIndexRecords#initialize has boolean parameter 'build_session'","categories":["Complexity"],"location":{"path":"app/services/batch_index_records.rb","lines":{"begin":7,"end":7}},"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":"3d4de08edd6d954821f6a784e168c4f8","type":"issue","check_name":"BooleanParameter","description":"BatchIndexRecords#initialize has boolean parameter 'commit'","categories":["Complexity"],"location":{"path":"app/services/batch_index_records.rb","lines":{"begin":7,"end":7}},"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":"799cb51ea3f95f99057c86ee8c91ff1d","type":"issue","check_name":"ControlParameter","description":"BatchIndexRecords#initialize is controlled by argument 'build_session'","categories":["Complexity"],"location":{"path":"app/services/batch_index_records.rb","lines":{"begin":8,"end":8}},"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":"85a9cc17f98d3eed3e712e181745d890","type":"issue","check_name":"DuplicateMethodCall","description":"BatchIndexRecords#index_individual_record calls 'record.record_id' 3 times","categories":["Complexity"],"location":{"path":"app/services/batch_index_records.rb","lines":{"begin":36,"end":41}},"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":"afc62b43ee7d1a7de925908d7e70a70b","type":"issue","check_name":"DuplicateMethodCall","description":"BatchRemoveRecordsFromIndex#retry_remove_records calls 'Rails.logger' 3 times","categories":["Complexity"],"location":{"path":"app/services/batch_remove_records_from_index.rb","lines":{"begin":26,"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":"4aeca3c91f90820f14b90bb84895f136","type":"issue","check_name":"DuplicateMethodCall","description":"BatchRemoveRecordsFromIndex#retry_remove_records calls 'Time.current' 2 times","categories":["Complexity"],"location":{"path":"app/services/batch_remove_records_from_index.rb","lines":{"begin":30,"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":"d56066b8026cf4a49c21a18f88633858","type":"issue","check_name":"DuplicateMethodCall","description":"BatchRemoveRecordsFromIndex#retry_remove_records calls 'record.set(index_updated: true, index_updated_at: Time.current)' 2 times","categories":["Complexity"],"location":{"path":"app/services/batch_remove_records_from_index.rb","lines":{"begin":30,"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":"c1e85efed2a0fe4d57af0e0755951aaa","type":"issue","check_name":"DuplicateMethodCall","description":"DetermineAvailableFields#call calls 'RecordSchema.groups' 2 times","categories":["Complexity"],"location":{"path":"app/services/determine_available_fields.rb","lines":{"begin":12,"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":"df438af76b201d499bc4c44b59acfb55","type":"issue","check_name":"DuplicateMethodCall","description":"DetermineAvailableFields#call calls 'options[:fields]' 3 times","categories":["Complexity"],"location":{"path":"app/services/determine_available_fields.rb","lines":{"begin":15,"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":"3182ef8f9bc9527fd792505f4bce3803","type":"issue","check_name":"DuplicateMethodCall","description":"DetermineAvailableFields#call calls 'options[:groups]' 3 times","categories":["Complexity"],"location":{"path":"app/services/determine_available_fields.rb","lines":{"begin":12,"end":16}},"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":"1e508303e5806bba6245ab47d3d5c905","type":"issue","check_name":"UncommunicativeVariableName","description":"MetricsApi::Presenters::Record has the variable name '@m'","categories":["Complexity"],"location":{"path":"app/services/metrics_api/presenters/record.rb","lines":{"begin":7,"end":7}},"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":"5050fd346228781f3591fb8316fa0463","type":"issue","check_name":"UncommunicativeVariableName","description":"MetricsApi::Presenters::TopRecords has the variable name '@m'","categories":["Complexity"],"location":{"path":"app/services/metrics_api/presenters/top_records.rb","lines":{"begin":8,"end":8}},"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":"62fe8bb98e51efba5d3d8d5ca06c791b","type":"issue","check_name":"UncommunicativeVariableName","description":"MetricsApi::Presenters::View has the variable name '@m'","categories":["Complexity"],"location":{"path":"app/services/metrics_api/presenters/view.rb","lines":{"begin":8,"end":8}},"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":"157a1006fe5c5dc3c0404f6e46cb3d2d","type":"issue","check_name":"InstanceVariableAssumption","description":"PerformMergePatch assumes too much for instance variable '@validation_result'","categories":["Complexity"],"location":{"path":"app/services/perform_merge_patch.rb","lines":{"begin":24,"end":24}},"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":"2e48f4ebe38cb0750470999c58a52d16","type":"issue","check_name":"UncommunicativeVariableName","description":"PerformMergePatch#call has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/services/perform_merge_patch.rb","lines":{"begin":49,"end":49}},"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":"a032a5bb12be8f85f4f40a96f864ff99","type":"issue","check_name":"UncommunicativeVariableName","description":"PerformMergePatch#call has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/services/perform_merge_patch.rb","lines":{"begin":49,"end":49}},"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":"16ffb7751bd387153916f5a10f727965","type":"issue","check_name":"Attribute","description":"UpdateRecordFromHarvest#mongo_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":5,"end":5}},"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":"d81afcdfa48b20c35670875bb842bf39","type":"issue","check_name":"Attribute","description":"UpdateRecordFromHarvest#payload is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":5,"end":5}},"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":"96eb28c952c54d5c47e2add20cfca6d3","type":"issue","check_name":"Attribute","description":"UpdateRecordFromHarvest#preview is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":5,"end":5}},"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":"29705d33a92891b8aeeb095dc7e29ceb","type":"issue","check_name":"Attribute","description":"UpdateRecordFromHarvest#required_fragments is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":5,"end":5}},"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":"b27560a327ac7548fb53e1926c6db34d","type":"issue","check_name":"BooleanParameter","description":"UpdateRecordFromHarvest#initialize has boolean parameter 'preview'","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":7,"end":7}},"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":"cd3fa506445510779bb62a87dee9f04a","type":"issue","check_name":"DuplicateMethodCall","description":"UpdateRecordFromHarvest#customize_record calls 'payload['record_type']' 2 times","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":42,"end":42}},"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":"f4ca81edcbe35d3dec9cd5c7149ae2e6","type":"issue","check_name":"DuplicateMethodCall","description":"UpdateRecordFromHarvest#new_fragment_attributes calls 'schema_fields.key?(field_name)' 2 times","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":62,"end":74}},"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":"b118316ebf0faab8aa2d88e7bf97a16d","type":"issue","check_name":"DuplicateMethodCall","description":"UpdateRecordFromHarvest#select_fragment calls 'payload['priority']' 2 times","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":90,"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":"253bfefac0c9b3e734f368779e184aa6","type":"issue","check_name":"InstanceVariableAssumption","description":"UpdateRecordFromHarvest assumes too much for instance variable '@record'","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.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":"21fb0bc61f50ade9acab8560372eaaba","type":"issue","check_name":"TooManyInstanceVariables","description":"UpdateRecordFromHarvest has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.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":"c231628d4025e4b41b00fc12b9ae7d44","type":"issue","check_name":"TooManyStatements","description":"UpdateRecordFromHarvest#new_fragment_attributes has approx 12 statements","categories":["Complexity"],"location":{"path":"app/services/update_record_from_harvest.rb","lines":{"begin":58,"end":58}},"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":"b9b1a4e1e343c1452e7541486d67d263","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::AndOrFilters#filter_values calls 'with(key)' 3 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":72,"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":"98e3ce0ec673a3513a157f687755f59b","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::AndOrFilters#recurse_conditions calls 'Utils.call_block(self, \u0026filter_values(key, conditions, current_operator))' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":48,"end":50}},"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":"b9e79a4910263d77d166f73b43eb073b","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::AndOrFilters#recurse_conditions calls 'conditions.each' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":36,"end":42}},"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":"f807aee89464e41b0a076147a2002436","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::AndOrFilters#recurse_conditions calls 'filter_values(key, conditions, current_operator)' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":48,"end":50}},"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":"7f4db2fe26470a4e0ed46e8bd1c90cbe","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::AndOrFilters#recurse_conditions calls 'key.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/and_or_filters.rb","lines":{"begin":33,"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":"9d4fb54e442e19aa0bb57622447c9e30","type":"issue","check_name":"UtilityFunction","description":"QueryBuilder::Base#cast_param doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/base.rb","lines":{"begin":15,"end":15}},"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":"1e5566f7613457f052d16e5b96143fc9","type":"issue","check_name":"FeatureEnvy","description":"QueryBuilder::Defaults#call refers to 'params' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/defaults.rb","lines":{"begin":10,"end":13}},"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":"420506193468565b1219fd51276bfa54","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::ExcludeFiltersFromFacets#call calls 'facet_name.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/exclude_filters_from_facets.rb","lines":{"begin":33,"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":"30702e5c741fdeaa751472b8a9513038","type":"issue","check_name":"FeatureEnvy","description":"QueryBuilder::ExcludeFiltersFromFacets#or_and_options refers to 'or_and_options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/exclude_filters_from_facets.rb","lines":{"begin":71,"end":76}},"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":"837e511ea1329ec5e30899a044e2238b","type":"issue","check_name":"TooManyInstanceVariables","description":"QueryBuilder::ExcludeFiltersFromFacets has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/exclude_filters_from_facets.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":"10706a508d3f12e424baf387ccf331f6","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::FacetRow#call calls 'filter.to_sym' 3 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/facet_row.rb","lines":{"begin":31,"end":37}},"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":"9da70ef6443b1e8d482cd62963d44a6e","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::FacetRow#call calls 'this.cast_param(filter, value)' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/facet_row.rb","lines":{"begin":33,"end":37}},"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":"1a1d44747cc75dabf170b9e8782ca5bf","type":"issue","check_name":"NestedIterators","description":"QueryBuilder::FacetRow#call contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/facet_row.rb","lines":{"begin":29,"end":29}},"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":"e353eccc03b859e49101677b7f713b79","type":"issue","check_name":"TooManyStatements","description":"QueryBuilder::FacetRow#call has approx 11 statements","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/facet_row.rb","lines":{"begin":21,"end":21}},"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":"d4ca326a6a357308ea9d1e45f6e3f76f","type":"issue","check_name":"NestedIterators","description":"QueryBuilder::Facets#call contains iterators nested 3 deep","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/facets.rb","lines":{"begin":36,"end":36}},"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":"b91dbfe8f717342e2977c88f98e820ba","type":"issue","check_name":"TooManyStatements","description":"QueryBuilder::Facets#call has approx 11 statements","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/facets.rb","lines":{"begin":23,"end":23}},"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":"b2d275d705c6fe4029e070fa768010b9","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::Ordering#order_by_attribute calls '@schema_class.fields' 2 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/ordering.rb","lines":{"begin":31,"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":"45ad046ed9c1098b3db231d1fdbf5068","type":"issue","check_name":"DuplicateMethodCall","description":"QueryBuilder::Ordering#order_by_attribute calls 'value.name' 3 times","categories":["Complexity"],"location":{"path":"app/solr_queries/query_builder/ordering.rb","lines":{"begin":32,"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":"2776762cea5fdc29dfd921e8a2cb5d12","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::MoreLikeThisSearch#query has approx 13 statements","categories":["Complexity"],"location":{"path":"app/solr_queries/supplejack_api/more_like_this_search.rb","lines":{"begin":19,"end":19}},"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":"fb5cd8600cf118d779bb2cfa458243ca","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::FlushOldRecordsWorker#perform calls 'Rails.logger' 2 times","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/flush_old_records_worker.rb","lines":{"begin":29,"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":"e77fbfb6273e4d476bcdce551c62d898","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::FlushOldRecordsWorker#perform refers to 'cursor' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/flush_old_records_worker.rb","lines":{"begin":24,"end":27}},"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":"4be4f4f968a07d1c6578ab52cfaf11ad","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::FlushOldRecordsWorker#perform refers to 'start' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/flush_old_records_worker.rb","lines":{"begin":26,"end":30}},"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":"ef9fd5a773271fa8046a7e74dd38a728","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::FlushOldRecordsWorker#flush_records doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/flush_old_records_worker.rb","lines":{"begin":36,"end":36}},"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":"0245d52dec94f947681c7603ff252c08","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::IndexSourceWorker#index_records doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/index_source_worker.rb","lines":{"begin":28,"end":28}},"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":"068c647965350a383bedcf744923d97e","type":"issue","check_name":"UtilityFunction","description":"SupplejackApi::IndexSourceWorker#remove_from_index_records doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/index_source_worker.rb","lines":{"begin":41,"end":41}},"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":"dad0312b72b87b3731f298535ed6670e","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StoreUserActivityWorker#perform calls 'Rails.logger' 7 times","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/store_user_activity_worker.rb","lines":{"begin":10,"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":"dd727f478651f84239e060da3d75340a","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::StoreUserActivityWorker#perform calls 'user.inspect' 2 times","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/store_user_activity_worker.rb","lines":{"begin":17,"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":"d75eeda08ed6ec8a7c4232a999fc74f2","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::StoreUserActivityWorker#perform refers to 'user' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/store_user_activity_worker.rb","lines":{"begin":16,"end":25}},"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":"24b8a60bdfd0028fc41ecba6262afc40","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::StoreUserActivityWorker#perform has approx 19 statements","categories":["Complexity"],"location":{"path":"app/workers/supplejack_api/store_user_activity_worker.rb","lines":{"begin":9,"end":9}},"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":"a088be2ae9eeed982cdb6949340c8ce2","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Generators::InstallGenerator#documentation refers to 'string' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/generators/supplejack_api/install_generator.rb","lines":{"begin":74,"end":90}},"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":"5e6ab0a3db4b22c66b1e15c7ceb9a662","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Generators::InstallGenerator#update_gemfile refers to 'string' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/generators/supplejack_api/install_generator.rb","lines":{"begin":53,"end":59}},"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":"de2b07a2538a91e97033797cf5b40ec8","type":"issue","check_name":"TooManyStatements","description":"SupplejackApi::Generators::InstallGenerator#documentation has approx 17 statements","categories":["Complexity"],"location":{"path":"lib/generators/supplejack_api/install_generator.rb","lines":{"begin":71,"end":71}},"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":"95a5c1d58bc7ccbe5d0341e5ed2400b6","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Sortable::Query::ClassMethods#sortable calls 'options[:order]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/admin/sortable.rb","lines":{"begin":25,"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":"a1bf90a99e6b5df2c894128fa7fb8027","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Sortable::Query::ClassMethods#sortable calls 'options[:page]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/admin/sortable.rb","lines":{"begin":21,"end":26}},"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":"f8805369e48486dcfe719c4bb2ff20cd","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Sortable::Query::ClassMethods#sortable calls 'options[:per_page]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/admin/sortable.rb","lines":{"begin":22,"end":26}},"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":"94d07788616e8d4cf644352995bc9b20","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::Sortable::Query::ClassMethods#sortable refers to 'options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_api/admin/sortable.rb","lines":{"begin":20,"end":26}},"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":"fc3e0cfb5cfb277100bd1986e72e2ad8","type":"issue","check_name":"ControlParameter","description":"SupplejackApi#self.setup is controlled by argument 'block'","categories":["Complexity"],"location":{"path":"lib/supplejack_api/engine.rb","lines":{"begin":44,"end":44}},"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":"0547d50fef6db045985570470c85ee48","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Engine has the variable name 'c'","categories":["Complexity"],"location":{"path":"lib/supplejack_api/engine.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":"24336b5a5c2380d5d327477e5b38cfd6","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Engine has the variable name 'g'","categories":["Complexity"],"location":{"path":"lib/supplejack_api/engine.rb","lines":{"begin":26,"end":26}},"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":"743f137ea2996828b5abfc20556cc361","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::RecordRedisQueue#pop_record_ids refers to 'conn' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_api/record_redis_queue.rb","lines":{"begin":20,"end":26}},"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":"b83dc02f2aeb2f9147e47167e57f4f00","type":"issue","check_name":"ControlParameter","description":"Utils#unsafe? is controlled by argument 'version'","categories":["Complexity"],"location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":26,"end":26}},"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":"13adf3905ad8c916af04e5ad9f093c6d","type":"issue","check_name":"DuplicateMethodCall","description":"Utils#time calls 'Time.zone' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":54,"end":57}},"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":"b79171b46d6fb264ea9a92e3e81e6b62","type":"issue","check_name":"DuplicateMethodCall","description":"Utils#time calls 'Time.zone.at(number.to_i)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":54,"end":57}},"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":"87d1958ee8ff7edcceee8bca09ee028a","type":"issue","check_name":"DuplicateMethodCall","description":"Utils#time calls 'Time.zone.at(number.to_i).utc' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":54,"end":57}},"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":"3e88f40fc45c05e3011e135915a7caad","type":"issue","check_name":"DuplicateMethodCall","description":"Utils#time calls 'number.to_i' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":54,"end":57}},"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":"4c6523f34279a240276f36e7177b6e72","type":"issue","check_name":"DuplicateMethodCall","description":"Utils#unsafe? calls 'text.to_s' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_api/utils.rb","lines":{"begin":27,"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":"0a7a1e9717efafa9d930a175e0ff4094","type":"issue","check_name":"UncommunicativeVariableName","description":"UrlValidator#validate_each has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/url_validator.rb","lines":{"begin":10,"end":10}},"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":"4f0887b054d48769f4b1feefdf4a3d5a","type":"issue","check_name":"UtilityFunction","description":"UrlValidator#validate_url doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/url_validator.rb","lines":{"begin":21,"end":21}},"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"}]