-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodeclimate_diff_baseline.json
180 lines (180 loc) · 196 KB
/
codeclimate_diff_baseline.json
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
[{"engine_name":"structure","fingerprint":"0c84bc628b4503165a0932dc313cfdf6","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 `value` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":34,"end":51}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"53456631f0150f8858b659952d36c397","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `AttributeValue` has 21 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/attribute_value.rb","lines":{"begin":5,"end":111}},"other_locations":[],"remediation_points":1300000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"523924132eb75286ed310a294ba7cc4e","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 `set_attribute_values` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":111,"end":129}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"7252e0b1c3b16070417c05b29db0c251","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Base` has 26 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":5,"end":171}},"other_locations":[],"remediation_points":1800000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"400f522bbfe624405fcbdcc74f62ca94","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 `resource` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/enrichments/enrichment.rb","lines":{"begin":71,"end":82}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"6dbef00088fe34e3a95c3cb7201bd9e9","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 `parse_date` has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/modifiers/date_parser.rb","lines":{"begin":21,"end":45}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"ae5aa7f5c10f39293237b7cc6a77c381","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `initialize` has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/oai/client.rb","lines":{"begin":9,"end":46}},"other_locations":[],"remediation_points":750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"145322092044bb0882e0f2e14455715a","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 32 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/oai/client.rb","lines":{"begin":9,"end":46}},"other_locations":[],"remediation_points":768000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"3cae67abf28a94a0d523840d9b4183f5","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 `each` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/oai/paginated_collection.rb","lines":{"begin":18,"end":31}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"cb58626b9d7edb6323e43635b1714b91","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 `each` has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":62,"end":83}},"other_locations":[],"remediation_points":1050000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"f7f4e66ef18212367fc3bbdf5dd4c163","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `next_tokenised_url` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":105,"end":117}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"dbe8b63cd0de71c7b3b421ebc41951c9","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 `yield_from_records` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":212,"end":227}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"a859f0ef8bd843a19f1e0db116a45bd6","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `get` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":10,"end":10}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"1047e22ed61ff2d3bdfa31c3613ed4ba","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `initialize` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":21,"end":21}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"fdcc7c6468a2d1496fdd0bc22c536df4","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 `acquire_lock` has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":70,"end":86}},"other_locations":[],"remediation_points":1150000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"5dfcac7ca1dfc9ed20c2eec695405359","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 `each` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/sitemap/paginated_collection.rb","lines":{"begin":15,"end":28}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"0688ac5b5db9b773b5442cf792e2bc49","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 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/validations/format.rb","lines":{"begin":6,"end":17}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"f0a2cedba50a1824708c9d67e2b83c5e","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 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/validations/size.rb","lines":{"begin":7,"end":23}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"75ebe86f45932efd989d8f8747e75807","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 `records` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":27,"end":36}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"04d5ae8ae9469d05f8360ae41df4abda","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `initialize` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":62,"end":71}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"43a031bf79700bce1f44c311cdb6e330","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_each_file` has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/xml_helpers/xml_document_methods.rb","lines":{"begin":38,"end":54}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"b93b6f92da9970afb6f9baf80ef769be","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 `value` has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/supplejack_common/xml_helpers/xpath_option.rb","lines":{"begin":17,"end":39}},"other_locations":[],"remediation_points":550000,"severity":"minor","type":"issue"},
{"name":"ruby.parse.succeeded","type":"measurement","value":62,"engine_name":"structure"},
{"engine_name":"duplication","fingerprint":"70449b0d450d4742070cce07ace76e9a","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":67,"end":72}},"remediation_points":190000,"other_locations":[{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":82,"end":87}}],"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":"70449b0d450d4742070cce07ace76e9a","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":82,"end":87}},"remediation_points":190000,"other_locations":[{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":67,"end":72}}],"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":"reek","fingerprint":"b24328edbcfb9f84d4ac294637f21bea","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::AttributeBuilder#value calls 'self.errors' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":44,"end":45}},"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":"2f5153a4610b567c08fbe09d22c4d530","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#compact_whitespace doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":107,"end":107}},"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":"e680c07a4b7a97a48d638d9160553513","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#join_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":71,"end":71}},"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":"b87be8037b13d7cd1b91fb0c5cb9e93f","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#mapping_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.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":"3c1fcc89ec7e4c255ee4385ce5c25c35","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#parse_date_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":97,"end":97}},"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":"e0e83017dee8a183414b5c8aa77f4ad3","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#split_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":66,"end":66}},"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":"da8f694a3b394a877b523ce42db1acca","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#strip_html_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":76,"end":76}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f63c92f9cb58e6dd0b4e9eaad7cb735c","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#strip_whitespace_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":80,"end":80}},"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":"357f84559f523c69e6cc03fc26dbce38","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::AttributeBuilder#truncate_option doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_builder.rb","lines":{"begin":84,"end":84}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3777e4b8e03a588aa2504653d1089468","type":"issue","check_name":"TooManyMethods","description":"SupplejackCommon::AttributeValue has at least 20 methods","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_value.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"7906510fcdcb6d7ad9ef5d62947d5429","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::AttributeValue#includes? has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_value.rb","lines":{"begin":37,"end":37}},"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":"413940c9456372646ca9da8b513cb14b","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::AttributeValue#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_value.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":"bdfc3b2f5eaeccb0a7bb101766846c49","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::AttributeValue#self.deep_clone has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/attribute_value.rb","lines":{"begin":15,"end":15}},"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":"23f6298f2cb91f6decabc0c6ea8a0e2b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Base#attribute_definitions calls '_attribute_definitions[identifier]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":57,"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":"99af372a83e8603ce0f2e558577b0885","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Base#enrichment_definitions calls '_enrichment_definitions[identifier]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":62,"end":63}},"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":"36bc558d8fd0392b1a502fa647fc2e41","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Base#rejected? calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":139,"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":"548f959a78a7f07a87d276032f216f62","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Base#rejected? calls 'self.class.rejection_rules' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":139,"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":"faedf91ea210697ec305d9520e500460","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Base#set_attribute_values calls 'builder.errors' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":120,"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":"91cbe84fa0b63eeb914c35f69243667f","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Base#set_attribute_values calls 'self.class' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":112,"end":116}},"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":"3881fab4a542f52d027b9822bbc06818","type":"issue","check_name":"TooManyMethods","description":"SupplejackCommon::Base has at least 26 methods","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"08538cd92741d42ff7f6354bc50a58f9","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Base#rejected? has the variable name 'r'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/base.rb","lines":{"begin":140,"end":140}},"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":"4b0998865cb81f005a7902190f30e349","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::DSL::ClassMethods#attribute is controlled by argument 'options'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":69,"end":69}},"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":"adb0dcb0ab6669a992400b3d1d14e418","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::DSL::ClassMethods#enrichment is controlled by argument 'options'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":84,"end":84}},"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":"9762586adf1cf4ca26b52a48a6e939c1","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::DSL::ClassMethods#paginate is controlled by argument 'options'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":63,"end":63}},"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":"fe7f75ee419dab71cc46876d6045d0c8","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::DSL::ClassMethods#attribute calls '_attribute_definitions[identifier]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":68,"end":71}},"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":"908019ff68421ffaebbcad3d56a39763","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::DSL::ClassMethods#base_url calls '_base_urls[identifier]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":48,"end":49}},"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":"791f1fda97566e5bf088eb5401db9d68","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::DSL::ClassMethods#enrichment calls '_enrichment_definitions[identifier]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":83,"end":86}},"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":"7b28f462234b5c67414e5f1dd9f724c2","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::DSL::ClassMethods#reject_if calls '_rejection_rules[identifier]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":94,"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":"fb700215180b04a6e9afbde07b0fd8f7","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::DSL::ClassMethods#throttle calls 'self._throttle' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":103,"end":104}},"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":"4f3be09bb34a891cec245ad148163703","type":"issue","check_name":"UnusedParameters","description":"SupplejackCommon::DSL::ClassMethods#source_id has unused parameter 'id'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/dsl.rb","lines":{"begin":45,"end":45}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c34a7273e6e5acf4015a01cd5b279acc","type":"issue","check_name":"Attribute","description":"SupplejackCommon::AbstractEnrichment#errors is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.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":"69c624bfe68f5395e51cb8f963b65cb1","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::AbstractEnrichment#initialize calls 'hash[key]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":16,"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":"50da8d9d801eb11d2a6d90e5de70c85c","type":"issue","check_name":"NestedIterators","description":"SupplejackCommon::AbstractEnrichment#initialize contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":15,"end":15}},"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":"052b8e72029bafb02afa6f011f3bbf98","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackCommon::AbstractEnrichment has at least 6 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b29b2b70815df4ee9ad8d4a7f416c8e4","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::AbstractEnrichment#primary has the variable name 'f'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":24,"end":24}},"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":"1b7fcc710f51cc58b2b87b6101b970e6","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::AbstractEnrichment#record_fragment has the variable name 'f'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":28,"end":28}},"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":"8dc8c3ef9b58ac3bae4d5bc63daf7817","type":"issue","check_name":"UnusedParameters","description":"SupplejackCommon::AbstractEnrichment#after has unused parameter 'source_id'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":47,"end":47}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"92c9641cb3a2d763564d389b8ae3e5b3","type":"issue","check_name":"UnusedParameters","description":"SupplejackCommon::AbstractEnrichment#before has unused parameter 'source_id'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/abstract_enrichment.rb","lines":{"begin":45,"end":45}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3729c1e5d273aac58b12b24d5f8a89ab","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_attribute_definitions is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"8804f0ee97eac4f4f36a1d0b508a9807","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_format is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"d80ebe693e427be5b7063554ae1187e9","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_http_headers is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"89751fc440f4b125505b6c35a0acebff","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_namespaces is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"61b247895e07c4837c58588e5eb86e95","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_proxy is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"aa1b4837548943f23d0399a0fa76c917","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_rejection_rules is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"3e30a3281017625565ac16f44d377881","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_required_attributes is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"8d41706469646aa1e3d0c7643e3f4b31","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Enrichment#_url is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.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":"940555c773f3807eaae0342470990f76","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::Enrichment#attribute is controlled by argument 'options'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.rb","lines":{"begin":65,"end":65}},"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":"6eb61b6b015918964494ba8dfe656b83","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Enrichment#resource calls 'parser_class._request_timeout' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.rb","lines":{"begin":79,"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":"9a4f6bb8a2a9f679f41289f757e685c8","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Enrichment#resource calls 'parser_class._throttle' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.rb","lines":{"begin":76,"end":76}},"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":"2e08bee3b4990378bc3129e36297e6e3","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Enrichment#set_attribute_values calls 'builder.errors' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.rb","lines":{"begin":91,"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":"0a74824c6ffad963a5e141bfa0b0081e","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackCommon::Enrichment assumes too much for instance variable '@parser_class'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/enrichments/enrichment.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"49f1c4080dc4c71576c3558871ed7858","type":"issue","check_name":"BooleanParameter","description":"SupplejackCommon::Json::Base#initialize has boolean parameter 'from_raw'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/json/base.rb","lines":{"begin":70,"end":70}},"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":"842be0a07e9d5098793e634731cc607b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Json::Base#records calls 'options[:counter]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/json/base.rb","lines":{"begin":56,"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":"9ce84f32b3550a1af8407181cd8da1fa","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Json::Base#records calls 'options[:job]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/json/base.rb","lines":{"begin":57,"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":"8341d19f131bc68a928346be72c7b91b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Json::Base#records calls 'options[:page]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/json/base.rb","lines":{"begin":55,"end":55}},"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":"18cc19b2e23139a2236b8289c94d9c8e","type":"issue","check_name":"FeatureEnvy","description":"SupplejackCommon::Json::Base#initialize refers to 'json' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/json/base.rb","lines":{"begin":71,"end":73}},"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":"ef1bab36b6333674d267cbd2a351abf0","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Json::Base#strategy_value has the variable name 'p'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/json/base.rb","lines":{"begin":98,"end":98}},"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":"5a1a37a234c907be683d2fc2ad235d8c","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Loader#environment is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/loader.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":"1bd0f31bf01d7988dc07b2e67ea7b5ba","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Loader#load_error is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/loader.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":"fd572d5a8479dc64307ec2e6b067431d","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Loader#parser is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/loader.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":"861a8ed861c96f53a131f0ba90ccbaf1","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Loader#create_tempfile has the variable name 'f'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/loader.rb","lines":{"begin":24,"end":24}},"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":"c32f1881b965069860131c68e07a9bd4","type":"issue","check_name":"UncommunicativeParameterName","description":"SupplejackCommon::Modifiers::DateParser#parse_date has the parameter name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/date_parser.rb","lines":{"begin":21,"end":21}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Parameter Name` is a parameter 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":"65ec428167bcfed4931a63a1ed29c018","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers::DateParser#modify has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/date_parser.rb","lines":{"begin":18,"end":18}},"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":"c00bd63952e5c6933f8d8faa593afb4b","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Modifiers::DateParser#normalized doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/date_parser.rb","lines":{"begin":47,"end":47}},"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":"74cab9d49215e00e10727f9625bb129a","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers::FinderWith#modify has the variable name 'c'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/finder_with.rb","lines":{"begin":16,"end":16}},"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":"1271d4360e3a915b666efddd77026060","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers::FinderWithout#modify has the variable name 'c'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/finder_without.rb","lines":{"begin":15,"end":15}},"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":"9284fd5cabd8879b06d1458a01eab5b6","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers::HtmlStripper#modify has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/html_stripper.rb","lines":{"begin":13,"end":13}},"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":"f89205445899b015f21b3079490751e0","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Modifiers::HtmlStripper#validate_encoding doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/html_stripper.rb","lines":{"begin":23,"end":23}},"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":"d90922bc3ea297908a8eecf2922085ce","type":"issue","check_name":"NestedIterators","description":"SupplejackCommon::Modifiers::Mapper#modify contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/mapper.rb","lines":{"begin":15,"end":15}},"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":"44e95b9e013b9b8cf0baec298b9422a2","type":"issue","check_name":"FeatureEnvy","description":"SupplejackCommon::Modifiers::WhitespaceCompactor#modify refers to 'v' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/whitespace_compactor.rb","lines":{"begin":14,"end":14}},"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":"243b8009d5a89e9e15c776f91f88b98b","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers::WhitespaceCompactor#modify has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/whitespace_compactor.rb","lines":{"begin":13,"end":13}},"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":"9b0057b3042fac78b7dd0f0fbc8e5376","type":"issue","check_name":"FeatureEnvy","description":"SupplejackCommon::Modifiers::WhitespaceStripper#modify refers to 'v' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/whitespace_stripper.rb","lines":{"begin":14,"end":14}},"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":"e230e484fe3520c5a9f18b7ada6e2e50","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers::WhitespaceStripper#modify has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers/whitespace_stripper.rb","lines":{"begin":13,"end":13}},"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":"c0d95f1aea278cd13b46eca369d274ac","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Modifiers#compose calls 'options[:separator]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers.rb","lines":{"begin":28,"end":39}},"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":"9080cbf1ac2c43bc87c7c08329c27785","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Modifiers#compose has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers.rb","lines":{"begin":31,"end":31}},"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":"9a4bbf43957b21125022d314e6ff709d","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Modifiers#compose doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers.rb","lines":{"begin":26,"end":26}},"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":"23dc049b09826a04fff180f5d674d6f5","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Modifiers#concept_lookup doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/modifiers.rb","lines":{"begin":42,"end":42}},"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":"aa3486a6486939bd3d1221b1ddf78d51","type":"issue","check_name":"BooleanParameter","description":"SupplejackCommon::Oai::Base#initialize has boolean parameter 'from_raw'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/oai/base.rb","lines":{"begin":63,"end":63}},"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":"ff5970d6e111a88390371bb3f6aae6c7","type":"issue","check_name":"Attribute","description":"OAI::Record#element is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/oai/client/record.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":"66e9b3705cd4ecbcc0ed576f1f38ef69","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackCommon::Oai::PaginatedCollection has at least 5 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack_common/oai/paginated_collection.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1e2c88510f6780eb9534c23183d6ce9f","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::PaginatedCollection#joiner is controlled by argument 'url'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":209,"end":209}},"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":"9725f1a504d094b9377f104f09b65be9","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#each calls 'klass.fetch_records(next_url(base_url))' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":65,"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":"24028b328331dd338fc51b0d012f26d4","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#each calls 'next_url(base_url)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":65,"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":"8b055cd11fc488471da903ec2558f022","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#each calls 'options[:limit]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":70,"end":75}},"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":"0e529cef842b1b362054794886436c9e","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#each calls 'yield_from_records(\u0026block)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":67,"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":"3a702ee4daa94b5e5a3d2014990f0b88","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#initialize calls 'options[:limit]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":51,"end":53}},"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":"c2895016c75a6119e20b0cb36f9d7d75","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#next_paginated_url calls 'joiner(url)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":121,"end":123}},"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":"1cae19716edf675b5a35fdfa0d9aeafb","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#next_scroll_url calls 'joiner(url)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":130,"end":134}},"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":"2cffc75ef165f889f10ec1e8d4d2134e","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#next_scroll_url calls 'klass._document' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":130,"end":136}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"d68595eccfcc8a04b4dc706eb1f70d17","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#next_tokenised_url calls 'joiner(url)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":107,"end":112}},"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":"a8b19acbf521aad8f7f640f444d7c822","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::PaginatedCollection#yield_from_records calls 'options[:limit]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":223,"end":223}},"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":"60cf5f235cb46561445b6ae1a1dcd66a","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackCommon::PaginatedCollection assumes too much for instance variable '@records'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":6,"end":6}},"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":"06636e3f500bfba348693a2fe9a51581","type":"issue","check_name":"MissingSafeMethod","description":"SupplejackCommon::PaginatedCollection has missing safe method 'increment_page_counter!'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":173,"end":173}},"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":"f4c500bec966e0ed3ba7b39a9e211b49","type":"issue","check_name":"RepeatedConditional","description":"SupplejackCommon::PaginatedCollection tests '@block' at least 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":100,"end":120}},"remediation_points":400000,"content":{"body":"`Repeated Conditional` is a special case of `Simulated Polymorphism`. Basically it means you are checking the same value throughout a single class and take decisions based on this.\n\n## Example\n\nGiven\n\n```Ruby\nclass RepeatedConditionals\n attr_accessor :switch\n\n def repeat_1\n puts \"Repeat 1!\" if switch\n end\n\n def repeat_2\n puts \"Repeat 2!\" if switch\n end\n\n def repeat_3\n puts \"Repeat 3!\" if switch\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 4 warnings:\n [5, 9, 13]:RepeatedConditionals tests switch at least 3 times (RepeatedConditional)\n```\n\nIf you get this warning then you are probably not using the right abstraction or even more probable, missing an additional abstraction.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1c54c81bcb309f984fa41f13ab896499","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackCommon::PaginatedCollection has at least 19 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":6,"end":6}},"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":"f0c95ae27b426a0594cf21d3c56c7c7c","type":"issue","check_name":"TooManyMethods","description":"SupplejackCommon::PaginatedCollection has at least 19 methods","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b49aa41cbdd34d04144d6bb9290c571c","type":"issue","check_name":"TooManyStatements","description":"SupplejackCommon::PaginatedCollection#each has approx 11 statements","categories":["Complexity"],"location":{"path":"lib/supplejack_common/paginated_collection.rb","lines":{"begin":62,"end":62}},"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":"1bc38ccaaa14427029158c1f828f7133","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Request#headers is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":19,"end":19}},"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":"6d8ab757a187cd543eb5251338d2fb15","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Request#proxy is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":19,"end":19}},"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":"a24515151433215363ea40419972629a","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Request#request_timeout is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":19,"end":19}},"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":"9581ed5bf1ed18e720d140f0105bc13f","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Request#throttling_options is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":19,"end":19}},"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":"bdeba7fe3aaec949f818e4ec0c1bf54f","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Request#url is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":19,"end":19}},"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":"5eb5c20ae82055679a3cdbea519ff5c8","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::Request#initialize is controlled by argument 'request_timeout'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":28,"end":28}},"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":"b96e74eae0b7cfe719ec003e192da05b","type":"issue","check_name":"DataClump","description":"SupplejackCommon::Request takes parameters ['headers', 'options', 'request_timeout', 'url'] to 3 methods","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":10,"end":21}},"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":"d8e992763648516b63739c5b8a23f5d5","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Request#acquire_lock calls 'Sidekiq.logger' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":75,"end":82}},"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":"e5e25a2e02b45e257022ef8ca9411405","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Request#acquire_lock calls 'SupplejackCommon.redis' 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.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":"6c7bc2f320a4a5be27cadf562e8e8529","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Request#acquire_lock calls 'SupplejackCommon.redis.pexpire(redis_lock_key, delay)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":73,"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":"a6a0b2690f774913427814d76e8fd1fc","type":"issue","check_name":"LongParameterList","description":"SupplejackCommon::Request#get has 5 parameters","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.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":"f09b6ab90279da9b51d96218d30261b5","type":"issue","check_name":"RepeatedConditional","description":"SupplejackCommon::Request tests 'defined?(Sidekiq)' at least 4 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":75,"end":117}},"remediation_points":400000,"content":{"body":"`Repeated Conditional` is a special case of `Simulated Polymorphism`. Basically it means you are checking the same value throughout a single class and take decisions based on this.\n\n## Example\n\nGiven\n\n```Ruby\nclass RepeatedConditionals\n attr_accessor :switch\n\n def repeat_1\n puts \"Repeat 1!\" if switch\n end\n\n def repeat_2\n puts \"Repeat 2!\" if switch\n end\n\n def repeat_3\n puts \"Repeat 3!\" if switch\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 4 warnings:\n [5, 9, 13]:RepeatedConditionals tests switch at least 3 times (RepeatedConditional)\n```\n\nIf you get this warning then you are probably not using the right abstraction or even more probable, missing an additional abstraction.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"3e563c4e996d0be88a0b21e265ee3ff2","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackCommon::Request has at least 5 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack_common/request.rb","lines":{"begin":8,"end":8}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"413227fc73701697613bdd481935856f","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackCommon::Resource has at least 6 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack_common/resource.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a32c46307ced689a0050c89b3f1c3491","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::FileResource#strategy_value calls 'options[:field]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/resources/file_resource.rb","lines":{"begin":74,"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":"a9e7955aa4f96602d7ebfb54debd267e","type":"issue","check_name":"FeatureEnvy","description":"SupplejackCommon::FileResource#strategy_value refers to 'options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/resources/file_resource.rb","lines":{"begin":74,"end":74}},"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":"9461783d40f1fd7324f1ce7fd5e8b7d3","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackCommon::FileResource assumes too much for instance variable '@attributes'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/resources/file_resource.rb","lines":{"begin":7,"end":7}},"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":"0787fc6e5803660e15b6ebb5f83c0da9","type":"issue","check_name":"FeatureEnvy","description":"SupplejackCommon::JsonResource#strategy_value refers to 'path' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/resources/json_resource.rb","lines":{"begin":12,"end":15}},"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":"dd44a37d26f6dd83a5e308cfbe8e9632","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::JsonResource#strategy_value has the variable name 'p'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/resources/json_resource.rb","lines":{"begin":15,"end":15}},"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":"8e135dbc588d433550007741e622de76","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Rss::Base#original_xml is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/rss/base.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":"c12059b0e4527a4877b9e526501e7bfe","type":"issue","check_name":"BooleanParameter","description":"SupplejackCommon::Rss::Base#initialize has boolean parameter 'from_raw'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/rss/base.rb","lines":{"begin":34,"end":34}},"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":"c498505539235b0bee96d5cbf4631c5b","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackCommon::Sitemap::PaginatedCollection assumes too much for instance variable '@entries'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/sitemap/paginated_collection.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"b45e07b02cf93cc0fcc36b701603aa3e","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackCommon::Sitemap::PaginatedCollection assumes too much for instance variable '@klass'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/sitemap/paginated_collection.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f60519ce54cdad851885263b855f6f21","type":"issue","check_name":"NestedIterators","description":"SupplejackCommon::Sitemap::PaginatedCollection#each contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack_common/sitemap/paginated_collection.rb","lines":{"begin":18,"end":18}},"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":"8b63a96aa20d6251b25433081f25c30f","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Utils#add_namespaces has the variable name 'k'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/utils.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":"6fceca4064157c7f83a373855454a110","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackCommon::Utils#add_namespaces has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/utils.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":"a55c05a8bbe621d1987853ea3d93a73e","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Utils#add_html_tag doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/utils.rb","lines":{"begin":26,"end":26}},"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":"28ad7d15f6f932ae2bdeae40bbc4b047","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Utils#add_namespaces doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/utils.rb","lines":{"begin":33,"end":33}},"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":"39d8540efe63158228ec76ad6e3349f4","type":"issue","check_name":"UtilityFunction","description":"SupplejackCommon::Utils#array doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/utils.rb","lines":{"begin":13,"end":13}},"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":"6db0874ea837a9ab3a004830a003e9b2","type":"issue","check_name":"UncommunicativeVariableName","description":"ActiveModel::Validations::ExclusionValidator#validate_each has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/validations/exclusion.rb","lines":{"begin":11,"end":11}},"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":"a103f75e20960bd49026bf4e27681a09","type":"issue","check_name":"UncommunicativeVariableName","description":"ActiveModel::Validations::FormatValidator#validate_each has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/validations/format.rb","lines":{"begin":11,"end":11}},"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":"7ac0e1f20bec9b82a1366d7ec759506e","type":"issue","check_name":"UncommunicativeVariableName","description":"ActiveModel::Validations::InclusionValidator#validate_each has the variable name 'v'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/validations/inclusion.rb","lines":{"begin":11,"end":11}},"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":"98e49f8d39c4a6ac8c294a92c50dad1b","type":"issue","check_name":"DuplicateMethodCall","description":"ActiveModel::Validations::SizeValidator#validate_each calls 'MESSAGES[key]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/validations/size.rb","lines":{"begin":18,"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":"84adb037a8ddaf861f39218cf4d6cfbb","type":"issue","check_name":"Attribute","description":"SupplejackCommon::Xml::Base#original_xml is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":60,"end":60}},"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":"2cc318147d0943ba7da23e9ce74cfa0b","type":"issue","check_name":"BooleanParameter","description":"SupplejackCommon::Xml::Base#initialize has boolean parameter 'from_raw'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":62,"end":62}},"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":"ffefe37974391968b61035468c771b86","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::Xml::Base#initialize is controlled by argument 'from_raw'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":63,"end":63}},"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":"17931e8816dfe5ebe60c06e4e4c2dd31","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#document calls 'format == :html' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":90,"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":"d398f61985823689f590a4ab38927531","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#format calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":74,"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":"1c5079018d2b433029f63ecf91e6be04","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#format calls 'self.class._record_format' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":74,"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":"a24bd2d689be44aaddef5b8a996aa000","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#records calls 'options[:counter]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.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":"63af76dfa68b99000c91513f6644d636","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#records calls 'options[:job]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":31,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"398b34a590e80ad0dfe65b124025684e","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#records calls 'options[:page]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.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":"4483c38f6e57de2f6e1c41aa7bb7cb66","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#url calls 'self.class' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":79,"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":"aff9cc0172d8d1b0f51d96e61db4716b","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::Xml::Base#url calls 'self.class.basic_auth_credentials' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml/base.rb","lines":{"begin":79,"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":"7d30e4e693f2c2c0e9a8a450e8d5ad28","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XmlDataMethods#full_raw_data calls 'self.class' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_data_methods.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":"88fd6ef148c2ae8766d7ef008ced5533","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XmlDataMethods#full_raw_data calls 'self.class._namespaces' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_data_methods.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":"698d55400b2a2f110c5fcca1a887aff9","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XmlDocumentMethods::ClassMethods#xml_records calls 'document.xpath(pagination_options[:total_selector])' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_document_methods.rb","lines":{"begin":23,"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":"68d35eed8bae61c1c0ed5b24e07e557a","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XmlDocumentMethods::ClassMethods#xml_records calls 'pagination_options[:total_selector]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_document_methods.rb","lines":{"begin":22,"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":"444787ffc89ba25d01adf4912a0bb037","type":"issue","check_name":"FeatureEnvy","description":"SupplejackCommon::XmlDocumentMethods::ClassMethods#with_each_file refers to 'url' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_document_methods.rb","lines":{"begin":39,"end":44}},"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":"560ad2201e269360585f863d4ef015e6","type":"issue","check_name":"NestedIterators","description":"SupplejackCommon::XmlDocumentMethods::ClassMethods#xml_records contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_document_methods.rb","lines":{"begin":20,"end":20}},"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":"16409b62f63d38f8cfb8f738046eb118","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XmlDslMethods::ClassMethods#namespaces calls 'self._namespaces' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xml_dsl_methods.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":"b85076300a3dd911fd7aa06222a81fdf","type":"issue","check_name":"ControlParameter","description":"SupplejackCommon::XpathOption#initialize is controlled by argument 'namespace_definitions'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xpath_option.rb","lines":{"begin":13,"end":13}},"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":"9147f279bb9262a15c139b2cfff738dc","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XpathOption#nodes calls 'options[:xpath]' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xpath_option.rb","lines":{"begin":44,"end":45}},"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":"d2e0d7e4259929062efd36beaacc5cd7","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackCommon::XpathOption#value calls 'nodes.is_a?(Array)' 2 times","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xpath_option.rb","lines":{"begin":22,"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":"809a487846c5a4b1aed84e71574402b7","type":"issue","check_name":"InstanceVariableAssumption","description":"SupplejackCommon::XpathOption assumes too much for instance variable '@nodes'","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xpath_option.rb","lines":{"begin":7,"end":7}},"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":"b78b98b3775f30509d0606b484ea8dff","type":"issue","check_name":"TooManyInstanceVariables","description":"SupplejackCommon::XpathOption has at least 5 instance variables","categories":["Complexity"],"location":{"path":"lib/supplejack_common/xml_helpers/xpath_option.rb","lines":{"begin":7,"end":7}},"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":"e21ac1e46249f1ee9faa202f3e34e6cc","type":"issue","check_name":"Attribute","description":"SupplejackCommon#caching_enabled is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common.rb","lines":{"begin":44,"end":44}},"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":"078f5e583e5cc33462cb3449ee2c4759","type":"issue","check_name":"Attribute","description":"SupplejackCommon#parser_base_path is a writable attribute","categories":["Complexity"],"location":{"path":"lib/supplejack_common.rb","lines":{"begin":45,"end":45}},"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"}]