-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcodeclimate_diff_baseline.json
More file actions
140 lines (140 loc) · 185 KB
/
codeclimate_diff_baseline.json
File metadata and controls
140 lines (140 loc) · 185 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[{"engine_name":"structure","fingerprint":"87d5fefb4e4371ff3920ef4d995c7b97","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 `parser` has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/abstract_job.rb","lines":{"begin":72,"end":86}},"other_locations":[],"remediation_points":550000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"aa129f1dcda47146c8fdd8968010d069","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 15 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/harvest_job.rb","lines":{"begin":48,"end":83}},"other_locations":[],"remediation_points":1150000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"9ef2bf4bfb6020e1d79b4dd84cbb5865","categories":["Complexity"],"check_name":"complex_logic","content":{"body":""},"description":"Consider simplifying this complex logical expression.","location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":9,"end":16}},"other_locations":[],"remediation_points":600000,"severity":"major","type":"issue"},
{"engine_name":"structure","fingerprint":"6d8d777e89ad4fbabb230fac9c1a442b","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 `create_concept?` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":7,"end":35}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"5db8fdf0f13427ec01a28f1e34b0b349","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `perform` has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":27,"end":65}},"other_locations":[],"remediation_points":1750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"cbae39d4881e04f9b53ffc44079bb1ac","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 `fetch_records` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":80,"end":93}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"95dbc0684f49f62db5e31c8171af46c3","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 `process_record` has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":96,"end":140}},"other_locations":[],"remediation_points":950000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"8356215833dc3c7cdf89c0d4477dc066","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `perform` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":27,"end":65}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"93084682a41f4c0f59737d8ecb3aa8da","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `process_record` has 36 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":96,"end":140}},"other_locations":[],"remediation_points":864000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"791cb84ad9f373c22a463da66f8139ec","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `perform` has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":21,"end":38}},"other_locations":[],"remediation_points":750000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"3e245923948c9369cf755a8ab3ee617c","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 `process_record` has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":40,"end":70}},"other_locations":[],"remediation_points":1450000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"c4d850b245f20d37fd055c66906070b6","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `perform` has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":27,"end":58}},"other_locations":[],"remediation_points":950000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"777113e96e8381798bed563f20febc10","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 `link_check` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":84,"end":99}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"c6dff7468f8fb2aa3ac3e37d1c7b5c8a","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `perform` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":27,"end":58}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"d81be2d459dedfed8b5bf477f2d0c487","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `perform` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/preview_worker.rb","lines":{"begin":27,"end":44}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"a4f6871a09bc6ff37ce25f8eae358a5f","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 `strip_ids` has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/preview_worker.rb","lines":{"begin":47,"end":61}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"d8bd3af7343a0b951a391bf88772c8ee","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 `enrich_record` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.","location":{"path":"app/workers/preview_worker.rb","lines":{"begin":99,"end":126}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"0276018d0ef4224f68aa1dd99586d9f8","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/cron_generator.rb","lines":{"begin":5,"end":10}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},
{"engine_name":"structure","fingerprint":"266a215dae0a460ba06f21b6a4a10d94","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 `offset` has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/cron_generator.rb","lines":{"begin":12,"end":19}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},
{"name":"ruby.parse.succeeded","type":"measurement","value":65,"engine_name":"structure"},
{"engine_name":"duplication","fingerprint":"e7f932f38fcddd1e367b6153b8b757df","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"tmp/parsers/json/nga_taonga_supplejack.rb","lines":{"begin":47,"end":57}},"remediation_points":330000,"other_locations":[{"path":"tmp/parsers/json/nga_taonga_supplejack.rb","lines":{"begin":60,"end":70}}],"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 34**.\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":"e7f932f38fcddd1e367b6153b8b757df","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"tmp/parsers/json/nga_taonga_supplejack.rb","lines":{"begin":60,"end":70}},"remediation_points":330000,"other_locations":[{"path":"tmp/parsers/json/nga_taonga_supplejack.rb","lines":{"begin":47,"end":57}}],"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 34**.\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":"6afb9c1bbaecafe55d2e8e1913ea1af9","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":135,"end":144}},"remediation_points":170000,"other_locations":[{"path":"app/models/abstract_job.rb","lines":{"begin":146,"end":155}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 26**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"duplication","fingerprint":"6afb9c1bbaecafe55d2e8e1913ea1af9","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":146,"end":155}},"remediation_points":170000,"other_locations":[{"path":"app/models/abstract_job.rb","lines":{"begin":135,"end":144}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n\u003e Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 26**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"48d888eeec2b670c02a35e24352076ba","type":"issue","check_name":"MissingSafeMethod","description":"ApplicationController has missing safe method 'authenticate_user!'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":7,"end":7}},"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":"822d9adc00156e27a17f5493d723da16","type":"issue","check_name":"DuplicateMethodCall","description":"AbstractJob#calculate_throughput calls 'duration.to_f' 2 times","categories":["Complexity"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":173,"end":174}},"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":"24128370786606846d1659afa6caad49","type":"issue","check_name":"MissingSafeMethod","description":"AbstractJob has missing safe method 'clear_old_states!'","categories":["Complexity"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":221,"end":221}},"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":"b9f324453f38430bc3a3764b82589a41","type":"issue","check_name":"MissingSafeMethod","description":"AbstractJob has missing safe method 'increment_processed_count!'","categories":["Complexity"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":212,"end":212}},"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":"06d18ae8e5ea6dda00b458b5f1b6f39e","type":"issue","check_name":"MissingSafeMethod","description":"AbstractJob has missing safe method 'increment_records_count!'","categories":["Complexity"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":207,"end":207}},"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":"27d92e5672c315f35c2da91d50263eda","type":"issue","check_name":"TooManyMethods","description":"AbstractJob has at least 17 methods","categories":["Complexity"],"location":{"path":"app/models/abstract_job.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1b0294ac01ee59c744ff48c96953f8e5","type":"issue","check_name":"DuplicateMethodCall","description":"CollectionStatistics#add_record_item calls 'send(\"#{status}_records\")' 2 times","categories":["Complexity"],"location":{"path":"app/models/collection_statistics.rb","lines":{"begin":40,"end":42}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"9baa45af661ffc415495b8d0c2087f15","type":"issue","check_name":"MissingSafeMethod","description":"CollectionStatistics has missing safe method 'add_record!'","categories":["Complexity"],"location":{"path":"app/models/collection_statistics.rb","lines":{"begin":31,"end":31}},"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":"43c0def223cb07b249602e719fe38e0c","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#enqueue_enrichment_jobs calls 'e.message' 3 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":30,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"7899192f7b947930114076409b29acf4","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#flush_old_records calls 'e.message' 3 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":41,"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":"5bbe35c2acf202ed80a8a90601a143b4","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#records calls 'e.message' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":80,"end":81}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8a7166b6ac541cd389689760c55d3281","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#records calls 'limit.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":52,"end":52}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e75ccb06e3a8f130139b97dcc0f97051","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#records calls 'parser.last_harvested_at' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":54,"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":"93f817e19a0c8f10218c9b07ef2dbfc0","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#records calls 'self.states' 5 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":63,"end":67}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"df0f21ad98a2216adbcbdc48cb600d66","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestJob#records calls 'self.states.last' 4 times","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":64,"end":67}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"5b23aecf5e211f905440d40fce5ea366","type":"issue","check_name":"FeatureEnvy","description":"HarvestJob#flush_old_records refers to 'e' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":40,"end":45}},"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":"d36689240de7445aff7a8c7f868a015c","type":"issue","check_name":"MissingSafeMethod","description":"HarvestJob has missing safe method 'finish!'","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":85,"end":85}},"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":"c21ea867eb96980dee36099002e94741","type":"issue","check_name":"TooManyStatements","description":"HarvestJob#records has approx 19 statements","categories":["Complexity"],"location":{"path":"app/models/harvest_job.rb","lines":{"begin":48,"end":48}},"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":"de019947e6f3c2d46bc91c8957d12208","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestSchedule#self.one_offs_to_be_run calls 'Time.zone' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_schedule.rb","lines":{"begin":45,"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":"8b8c686365784222103d8acaacf07aea","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestSchedule#self.one_offs_to_be_run calls 'Time.zone.now' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_schedule.rb","lines":{"begin":45,"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":"1ae46ee018043d878e6b369eb272d382","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestSchedule#self.recurrents_to_be_run calls 'Time.zone' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_schedule.rb","lines":{"begin":53,"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":"42f5f994a7c31fb0a98273147575de27","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestSchedule#self.recurrents_to_be_run calls 'Time.zone.now' 2 times","categories":["Complexity"],"location":{"path":"app/models/harvest_schedule.rb","lines":{"begin":53,"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":"feb13f7e9f8e10c70fb8b27085bffeef","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#create_concept? calls 'Sidekiq.logger' 3 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":8,"end":14}},"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":"e5723c39fd5bd51f31bac2251afd54d3","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#create_concept? calls 'args.inspect' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":8,"end":14}},"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":"6a22bbffa4972577518487230ad96778","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#create_concept? calls 'args[:match_concepts]' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":11,"end":26}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"64efdb1b83ce60633b8a07da6569f266","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#create_concept? calls 'lookup(args)' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":28,"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":"60dba6b00b4bec2ee112bcc41aa448e6","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#lookup calls 'args[:dateOfBirth]' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":42,"end":43}},"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":"a16e6b56fc656ac47a6d34367a401840","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#lookup calls 'args[:dateOfDeath]' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.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":"49c419d8824714e934d6cb7f2b6b41e8","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#lookup calls 'args[:familyName]' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":41,"end":50}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c2321bf3d64ec6a7e18705ba09b4c8df","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#lookup calls 'args[:givenName]' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":40,"end":50}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e1c49dba7820f258dffe348cbfd6ddcf","type":"issue","check_name":"DuplicateMethodCall","description":"Matcher::ConceptMatcher#lookup calls 'args[:source_id]' 2 times","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":48,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"4f75321c29e34ee85365a07e17ac3dd9","type":"issue","check_name":"FeatureEnvy","description":"Matcher::ConceptMatcher#create_concept? refers to 'args' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":8,"end":26}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e0501a7b0191a7094bdf20bdaa207259","type":"issue","check_name":"TooManyStatements","description":"Matcher::ConceptMatcher#create_concept? has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/matcher/concept_matcher.rb","lines":{"begin":7,"end":7}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"57565c4a7f86c88e527f7c62891f5d8f","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Enrichable#primary has the variable name 'a'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/enrichable.rb","lines":{"begin":9,"end":9}},"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":"af36c04dc620904c49b83c1016142bcd","type":"issue","check_name":"UncommunicativeVariableName","description":"SupplejackApi::Enrichable#sorted_fragments has the variable name 's'","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/enrichable.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":"6130514a1116828f8e197050eb135c57","type":"issue","check_name":"Attribute","description":"SupplejackApi::EnrichmentRecordCollection#pagination is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/enrichment_record_collection.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":"b7b6cff758351ada910ed461775cbfa4","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::EnrichmentRecordCollection#initialize calls 'elements.blank?' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/enrichment_record_collection.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":"6fd48ff550f0e8e69bbcc3398b9bd43b","type":"issue","check_name":"FeatureEnvy","description":"SupplejackApi::EnrichmentRecordCollection#initialize refers to 'elements' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/enrichment_record_collection.rb","lines":{"begin":12,"end":13}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"1200772d6df2b6ebfaf1ae24ac9e7a81","type":"issue","check_name":"DuplicateMethodCall","description":"SupplejackApi::Record#self.find calls 'Rails.logger' 2 times","categories":["Complexity"],"location":{"path":"app/models/supplejack_api/record.rb","lines":{"begin":11,"end":12}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"96f4caf7e63545acbdeb590921a09b85","type":"issue","check_name":"DuplicateMethodCall","description":"AbstractWorker#process_response calls 'job.retried_records' 2 times","categories":["Complexity"],"location":{"path":"app/workers/abstract_worker.rb","lines":{"begin":38,"end":40}},"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":"d95168e48a0b8de89f397c4f302726c4","type":"issue","check_name":"DuplicateMethodCall","description":"AbstractWorker#process_response calls 'response['record_id']' 2 times","categories":["Complexity"],"location":{"path":"app/workers/abstract_worker.rb","lines":{"begin":38,"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":"073bf874202b59e358d39f8c5b4363ff","type":"issue","check_name":"DuplicateMethodCall","description":"ApiUpdateWorker#perform calls 'ENV['HARVESTER_API_KEY']' 2 times","categories":["Complexity"],"location":{"path":"app/workers/api_update_worker.rb","lines":{"begin":33,"end":35}},"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":"5a84bc2e6362d11e554358fc934445cd","type":"issue","check_name":"UtilityFunction","description":"ValidatesResource#validate_response_codes doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/concerns/validates_resource.rb","lines":{"begin":27,"end":27}},"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":"7b63178d977885699ad4703546c07777","type":"issue","check_name":"UtilityFunction","description":"ValidatesResource#validate_xpath doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/concerns/validates_resource.rb","lines":{"begin":38,"end":38}},"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":"3962b5443e2d43796c5f971b52c3fefe","type":"issue","check_name":"UtilityFunction","description":"EnqueueSourceChecksWorker#perform doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/enqueue_source_checks_worker.rb","lines":{"begin":8,"end":8}},"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":"b2b5a62c281615ba59c0e015c22a9d9a","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#fetch_records calls 'job.harvest_job' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":82,"end":83}},"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":"967bb70b7b994f0840e83a0b7efa7d6a","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#fetch_records calls 'job.record_id' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":81,"end":91}},"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":"e43366b0adb99a14e6c1ba1c2de60ac7","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#last_page_records? calls 'records.pagination' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":77,"end":77}},"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":"b10981b9699f11d7f0101dbf0df5d7a5","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#more_records? calls 'records.pagination' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":71,"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":"a65e4ff905f567b86aeedbcba2d6964b","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#perform calls 'job.enrichment' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":33,"end":62}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"38f1836fb37ba6f7f30c3793672a0cea","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#perform calls 'job.finish!' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":42,"end":64}},"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":"709b80d62f5dcf5f735284951b0ba881","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#perform calls 'job.states' 4 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":35,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"bd4ff00990781693d175b1cd69ea1806","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#perform calls 'records.pagination' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":53,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6a00e3dd844c4f97722a2fd0592cfdf4","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#perform calls 'records.pagination['page']' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":53,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"cd62943f4bd8881a9e26d1de2c783b7a","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#post_to_api calls 'job.id' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":162,"end":169}},"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":"d4fe8594d3d13ee1bad67960f0fc5ccd","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#post_to_api calls 'job.id.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":162,"end":169}},"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":"06e02b6c5bb5f6135a082f85b16e1ca3","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#process_record calls '@parser.id' 4 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":112,"end":137}},"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":"50eff1ecc5a422debdb68f7c036b5fc6","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#process_record calls 'ElasticAPM.report(e)' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":126,"end":135}},"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":"66224f4badff6820544ac8f8946d23bd","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#process_record calls 'e.backtrace' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":133,"end":138}},"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":"9122e6d0fcf913bcb7210095e9384494","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#process_record calls 'enrichment.errors' 3 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":104,"end":114}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f867ba332a92640185e602bf36d98560","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#process_record calls 'job.enrichment' 3 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":100,"end":137}},"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":"cd22aee37d767697a6b688017fe39450","type":"issue","check_name":"DuplicateMethodCall","description":"EnrichmentWorker#setup_parser calls 'job.environment' 2 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":146,"end":148}},"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":"e5463db8b5c8b8c64f7d575b0b6752f4","type":"issue","check_name":"FeatureEnvy","description":"EnrichmentWorker#last_page_records? refers to 'records' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":77,"end":77}},"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":"56ddca12fd28d0fa1a3b17148feddb12","type":"issue","check_name":"FeatureEnvy","description":"EnrichmentWorker#more_records? refers to 'records' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":71,"end":71}},"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":"6b3fab1c68530ad83a9d57336252744a","type":"issue","check_name":"InstanceVariableAssumption","description":"EnrichmentWorker assumes too much for instance variable '@parser'","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":4,"end":4}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e9e96b107d2124e4fe19a331b8d183a5","type":"issue","check_name":"InstanceVariableAssumption","description":"EnrichmentWorker assumes too much for instance variable '@parser_class'","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":4,"end":4}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"597106bd4bb38236723eb31696a3cc4d","type":"issue","check_name":"NestedIterators","description":"EnrichmentWorker#process_record contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":108,"end":108}},"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":"fac238e2c97d21d78835389a1260241b","type":"issue","check_name":"RepeatedConditional","description":"EnrichmentWorker tests 'job.preview?' at least 3 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":69,"end":90}},"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":"829dcea910ac8d739182897a58eee9cd","type":"issue","check_name":"RepeatedConditional","description":"EnrichmentWorker tests 'stop_harvest?' at least 3 times","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":46,"end":58}},"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":"59cbf063acca3c49f949df3392b5ef0c","type":"issue","check_name":"TooManyStatements","description":"EnrichmentWorker#perform has approx 18 statements","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":27,"end":27}},"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":"f4bd0ef1fd09179e64795de6bf7b63e8","type":"issue","check_name":"TooManyStatements","description":"EnrichmentWorker#process_record has approx 19 statements","categories":["Complexity"],"location":{"path":"app/workers/enrichment_worker.rb","lines":{"begin":96,"end":96}},"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":"27210a3ed3c3d9b6c191198eb60445e6","type":"issue","check_name":"BooleanParameter","description":"HarvestWorker#post_to_api has boolean parameter 'async'","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":72,"end":72}},"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":"1fca444d5eb70f712010117346392143","type":"issue","check_name":"ControlParameter","description":"HarvestWorker#post_to_api is controlled by argument 'async'","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":83,"end":83}},"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":"a9765ea054ae160770b2d2c1880e48d7","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#post_to_api calls 'attributes.delete(:data_type)' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":74,"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":"aa97dbfc92db25dc691ffdf5ece9b5d8","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#post_to_api calls 'job.id' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":84,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c485db5ce82c13b3d790d55e48fd2ea6","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#post_to_api calls 'job.id.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":84,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"236f7b1ff3b20b6979e63185a6871785","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#post_to_api calls 'job.required_enrichments' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":84,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"a2c3447b644750e9b8882c62ed4af2d8","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#post_to_api calls '{ data_type =\u003e attributes, required_fragments: job.required_enrichments }.as_json' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":84,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"121b109a0adf993af25312615ed270e7","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'Time.zone' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":55,"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":"6a3784f4f84c33956533d480a3090801","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'Time.zone.now' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":55,"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":"198812a796c78ae671945d24e9d00d4b","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'e.backtrace' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":58,"end":66}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"8fabf2ff33c833cad13b202522afd023","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'job.parser' 4 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":46,"end":66}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"70f16e6b1d631a428262f5ce0f109e9e","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'job.records_count' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":44,"end":52}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"59bf34bd88be61ff0df78a9efa506112","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'job.test?' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":43,"end":51}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"69d5d9ea95ed1637097838d5e14374be","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'record.attributes' 3 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":42,"end":46}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"690d92204b81f4b1d5a0a7cd8ffd7ea8","type":"issue","check_name":"DuplicateMethodCall","description":"HarvestWorker#process_record calls 'record.attributes[:internal_identifier]' 2 times","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":42,"end":43}},"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":"ab88d8bbb360919b90bee292a802938f","type":"issue","check_name":"FeatureEnvy","description":"HarvestWorker#delete_from_api refers to 'identifier' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":92,"end":92}},"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":"96f1b6d597d76fc4f7e037e24b6c9137","type":"issue","check_name":"FeatureEnvy","description":"HarvestWorker#process_record refers to 'job' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":43,"end":69}},"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":"7a01ec32d590169d892a32846b1a2a82","type":"issue","check_name":"InstanceVariableAssumption","description":"HarvestWorker assumes too much for instance variable '@source_id'","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.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":"c129be312c50a94f132cf577e2583b7e","type":"issue","check_name":"TooManyStatements","description":"HarvestWorker#process_record has approx 13 statements","categories":["Complexity"],"location":{"path":"app/workers/harvest_worker.rb","lines":{"begin":40,"end":40}},"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":"cc2a77342f7539c85295e7d7d9add049","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#link_check calls 'Sidekiq.logger' 2 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":91,"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":"1f6a00524e150104936cbae857ec9b1c","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#perform calls 'Sidekiq.logger' 4 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":31,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"c13ffdcf16cf7c687d065204d9a5034a","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#perform calls 'job.record_id' 7 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":31,"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":"565104f48312dcaf4079e546666b2470","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#perform calls 'job.source' 3 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":29,"end":42}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"0665bdf0e2bfdac5cdf2afd6e57475d9","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#perform calls 'job.source.id' 2 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":41,"end":42}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"6042d57f76c08028b5949c30c61b2677","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#perform calls 'job.source_id' 2 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":35,"end":36}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"aab8710da97650499693519b4e325167","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#perform calls 'job.url' 3 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":31,"end":44}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"5e41edef2a9aeeccc15a8bf86668b31a","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#suppress_record calls 'Sidekiq.logger' 3 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":105,"end":113}},"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":"9446e4d715ce9ef0759d04b186ff2df1","type":"issue","check_name":"DuplicateMethodCall","description":"LinkCheckWorker#suppress_record calls 'timings[strike]' 2 times","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":113,"end":114}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"37caa1e22c2e625acb104c09be572287","type":"issue","check_name":"FeatureEnvy","description":"LinkCheckWorker#suppress_record refers to 'strike' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":104,"end":114}},"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":"f22e0799fa12732159f59d981662977f","type":"issue","check_name":"InstanceVariableAssumption","description":"LinkCheckWorker assumes too much for instance variable '@job_id'","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":4,"end":4}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n @omg\n end\nend\n```\n\nThe way to address the smell warning is that you should create an `attr_reader` to use `@omg` in the subclass and not access `@omg` directly like this:\n\n```Ruby\nclass Parent\n attr_reader :omg\n\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\nDirectly accessing instance variables is considered a smell because it [breaks encapsulation](http://designisrefactoring.com/2015/03/29/organizing-data-self-encapsulation/) and makes it harder to reason about code.\n\nIf you don't want to expose those methods as public API just make them private like this:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\n\n private\n attr_reader :omg\nend\n\nclass Child \u003c Parent\n def foo\n omg\n end\nend\n```\n\n\n## Current Support in Reek\n\nAn instance variable must:\n\n* be set in the constructor\n* or be accessed through a method with lazy initialization / memoization.\n\nIf not, _Instance Variable Assumption_ will be reported.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"05673a0c257ed16ff15fa8e011f23677","type":"issue","check_name":"TooManyStatements","description":"LinkCheckWorker#perform has approx 14 statements","categories":["Complexity"],"location":{"path":"app/workers/link_check_worker.rb","lines":{"begin":27,"end":27}},"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":"d43313b17a33a9abd47065a9b4d4d9f1","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#perform calls 'job.harvest_failure' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":43,"end":43}},"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":"bf9913b275f416a0e9e67c9be3b1287f","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#process_record calls 'job.parser' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":87,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"fdc5833f2d7663837585961af6b5ee1d","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#process_record calls 'record.attributes' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":87,"end":90}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"e490322e60297217a4b6aacb7c773bdc","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#strip_ids calls 'value.class' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":52,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"02e58ef450803edaf71060e8a72297f0","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#update_preview_enrichment_failures calls 'enrichment_job.enrichment' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":133,"end":135}},"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":"380a2e296f502a0c602310c0b40fd550","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#update_preview_enrichment_failures calls 'enrichment_job.enrichment_failure' 4 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":130,"end":138}},"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":"ee2fc1d5dac7f858d506c6e662ae8bb8","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#validation_errors calls 'error.detail' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":73,"end":73}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"798e468605b65c1fae71f07686d6f67c","type":"issue","check_name":"DuplicateMethodCall","description":"PreviewWorker#validation_errors calls 'error.detail[:value]' 2 times","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":73,"end":73}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"ebadf3ee8781536be204aef4ecc52a55","type":"issue","check_name":"FeatureEnvy","description":"PreviewWorker#strip_ids refers to 'hash' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":48,"end":51}},"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":"3db257c2af149ebdc06554fa15f909fd","type":"issue","check_name":"NestedIterators","description":"PreviewWorker#strip_ids contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":55,"end":55}},"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":"5713c939ac5a38a50a65cbe04e845ff3","type":"issue","check_name":"TooManyStatements","description":"PreviewWorker#enrich_record has approx 18 statements","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":99,"end":99}},"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":"185c2bce67fd09e45064e3c29e1b84a7","type":"issue","check_name":"UncommunicativeVariableName","description":"PreviewWorker#perform has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/workers/preview_worker.rb","lines":{"begin":33,"end":33}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},
{"engine_name":"reek","fingerprint":"f93e13d310277fe36bd2e69fc28931f9","type":"issue","check_name":"UncommunicativeVariableName","description":"SourceCheckWorker#perform has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/workers/source_check_worker.rb","lines":{"begin":14,"end":14}},"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":"f43f81c2e98a544d6813812ae568d41d","type":"issue","check_name":"DuplicateMethodCall","description":"CronGenerator#month_day calls '1 + offset' 2 times","categories":["Complexity"],"location":{"path":"lib/cron_generator.rb","lines":{"begin":23,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}]