From 880a7c0c6e40cc1fb6d82403fe89e527f444d1bd Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 25 Nov 2022 15:42:40 +1300 Subject: [PATCH 01/29] feat: you can now choose a threshold for changed files. Past the threshhold, we analyze all files rather than each file one by one. You can also pass in the --all parameter to get this behaviour, regardless of threshold. --- Gemfile.lock | 2 +- README.md | 10 ++++++++-- exe/codeclimate_diff | 7 +++++-- lib/codeclimate_diff/runner.rb | 30 +++++++++++++++++++++++------- lib/codeclimate_diff/version.rb | 2 +- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 85bcf65..9c3d8f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.5) + codeclimate_diff (0.1.6) colorize json optparse diff --git a/README.md b/README.md index a59be7f..ceafdc1 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ NOTE: similar code will only work correctly if you run a diff on all the files i 4. Add a `.codecimate_diff.yml` configuration file ``` main_branch_name: master # defaults to main + threshold_to_run_on_all_files: 8 # when you reach a certain number of files changed, it becomes faster to analyze all files rather than analyze them one by one. ``` 5. Install the gem @@ -123,18 +124,23 @@ NOTE: similar code will only work correctly if you run a diff on all the files i 3. Check if you've added any issues (about 10 secs per code file changed on your branch): ```bash - # runs on all code files changed in your branch + # runs on each file changed in your branch (about 10 secs per code file changed on your branch) ./bin/codeclimate_diff OR - # filters the changed files in your branch futher + # filters the changed files in your branch futher by a grep pattern ./bin/codeclimate_diff --pattern places OR # only shows the new and fixed issues ./bin/codeclimate_diff --new-only + + OR + + # always analyzes all files rather than the changed files one by one, even if below the 'threshold_to_run_on_all_files' setting. + ./bin/codeclimate_diff --all ``` 4. Now you have time to fix the issues, horray! diff --git a/exe/codeclimate_diff b/exe/codeclimate_diff index 55f6e25..e232476 100755 --- a/exe/codeclimate_diff +++ b/exe/codeclimate_diff @@ -16,6 +16,9 @@ OptionParser.new do |opts| opts.on("-n", "--new-only", "It will only show what you have changed and not existing issues in files you have touched.") + opts.on("-a", "--all", + "It will always analyze all files, and not the changed files one by one, even if below the 'threshold_to_run_on_all_files' setting.") + opts.on("-pPATTERN", "--pattern=PATTERN", "Grep pattern to filter files. If provided, will filter the files changed on your branch further.") end.parse!(into: options) @@ -23,7 +26,7 @@ end.parse!(into: options) if options[:baseline] CodeclimateDiff::Runner.generate_baseline elsif options[:"new-only"] - CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], show_preexisting: false) + CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], always_analyze_all_files: options[:all], show_preexisting: false) else - CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], show_preexisting: true) + CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], always_analyze_all_files: options[:all], show_preexisting: true) end diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index 51648f4..652b0f0 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -16,19 +16,35 @@ def self.calculate_changed_filenames(pattern) files_changed_str.split("\n") end - def self.calculate_issues_in_changed_files(changed_filenames) + def self.calculate_issues_in_changed_files(changed_filenames, always_analyze_all_files) changed_file_issues = [] - changed_filenames.each do |filename| - next if filename == "codeclimate_diff.rb" # TODO: fix this file's code quality issues when we make a Gem! + threshold_to_run_on_all_files = CodeclimateDiff.configuration["threshold_to_run_on_all_files"] || 8 + analyze_all_files = always_analyze_all_files || changed_filenames.count > threshold_to_run_on_all_files + if analyze_all_files + message = always_analyze_all_files ? "Analyzing all files..." : "The number of changed files is greater than the threshold '#{threshold_to_run_on_all_files}', so analyzing all files..." + puts message - puts "Analysing '#{filename}'..." - result = CodeclimateWrapper.new.run_codeclimate(filename) + result = CodeclimateWrapper.new.run_codeclimate JSON.parse(result).each do |issue| next if issue["type"] != "issue" + next unless changed_filenames.include? issue["location"]["path"] changed_file_issues.append(issue) end + + else + changed_filenames.each do |filename| + next if filename == "codeclimate_diff.rb" # TODO: fix this file's code quality issues when we make a Gem! + + puts "Analysing '#{filename}'..." + result = CodeclimateWrapper.new.run_codeclimate(filename) + JSON.parse(result).each do |issue| + next if issue["type"] != "issue" + + changed_file_issues.append(issue) + end + end end changed_file_issues @@ -52,12 +68,12 @@ def self.generate_baseline puts "Done!" end - def self.run_diff_on_branch(pattern, show_preexisting: true) + def self.run_diff_on_branch(pattern, always_analyze_all_files: false, show_preexisting: true) CodeclimateWrapper.new.pull_latest_image changed_filenames = calculate_changed_filenames(pattern) - changed_file_issues = calculate_issues_in_changed_files(changed_filenames) + changed_file_issues = calculate_issues_in_changed_files(changed_filenames, always_analyze_all_files) preexisting_issues = calculate_preexisting_issues_in_changed_files(changed_filenames) diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index b5e94cc..b10fd7e 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.5" + VERSION = "0.1.6" end From 1ff9d8ef6987949c548ee872d8278520fbcb027c Mon Sep 17 00:00:00 2001 From: Izzi <100389760+isabel-anastasiadis-boost@users.noreply.github.com> Date: Fri, 25 Nov 2022 15:50:40 +1300 Subject: [PATCH 02/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ceafdc1..62b3108 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ It covers 3 kinds of code quality metrics (code smells, cyclomatic complexity, a NOTE: similar code will only work correctly if you run a diff on all the files in your branch. -## Installation +## Initial setup 1. Make sure docker is installed and running From 2af98d02a384dcd71a2386e41833a31dfff06a02 Mon Sep 17 00:00:00 2001 From: Izzi <100389760+isabel-anastasiadis-boost@users.noreply.github.com> Date: Fri, 25 Nov 2022 15:58:13 +1300 Subject: [PATCH 03/29] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 62b3108..cff8a17 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # CodeclimateDiff -This tool lets you see how your branch is affecting the code quality (what issues you've added, fixed, and what issues are outstanding in the files you've touched.) +This tool lets you see how changes in your branch will affect the code quality (what issues you've added, fixed, and what issues are outstanding in the files you've touched that could be fixed while you're in the area.) -It covers 3 kinds of code quality metrics (code smells, cyclomatic complexity, and similar code). - -NOTE: similar code will only work correctly if you run a diff on all the files in your branch. +It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under the hood, which pays attention to all the normal Code Climate configurations. ## Initial setup @@ -140,6 +138,7 @@ NOTE: similar code will only work correctly if you run a diff on all the files i OR # always analyzes all files rather than the changed files one by one, even if below the 'threshold_to_run_on_all_files' setting. + # NOTE: similar code issues will only work 100% correctly if you use this setting (otherwise it might miss a similarity with a file you didn't change and think you fixed it) ./bin/codeclimate_diff --all ``` @@ -178,7 +177,7 @@ With a few tweaks to your CI configuration, we can pull down the main build base 3. Create a personal access token with `read_api` access and save it in the `CODECLIMATE_DIFF_GITLAB_PERSONAL_ACCESS_TOKEN` env variable -Now when you run it on the changed files in your branch, it will refresh the baseline first! +Now when you run it on the changed files in your branch, it will download the latest baseline first! ## Development From 2c655900932d5a5583e21c5212644f1b14912c12 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 25 Nov 2022 17:09:19 +1300 Subject: [PATCH 04/29] feat: better error handling for baseline downloading --- Gemfile.lock | 2 +- lib/codeclimate_diff/downloader.rb | 21 ++++++++++++++++++--- lib/codeclimate_diff/version.rb | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9c3d8f3..8b29cdf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.6) + codeclimate_diff (0.1.7) colorize json optparse diff --git a/lib/codeclimate_diff/downloader.rb b/lib/codeclimate_diff/downloader.rb index f4483ff..afdef84 100644 --- a/lib/codeclimate_diff/downloader.rb +++ b/lib/codeclimate_diff/downloader.rb @@ -8,19 +8,34 @@ def self.refresh_baseline_if_configured return unless CodeclimateDiff.configuration["gitlab"] return unless CodeclimateDiff.configuration["gitlab"]["download_baseline_from_pipeline"] - puts "Downloading baseline file from gitlab" + personal_access_token = ENV.fetch("CODECLIMATE_DIFF_GITLAB_PERSONAL_ACCESS_TOKEN") + + if !personal_access_token + puts "Missing environment variable 'CODECLIMATE_DIFF_GITLAB_PERSONAL_ACCESS_TOKEN'. Using current baseline." + return + end + + puts "Downloading baseline file from gitlab..." branch_name = CodeclimateDiff.configuration["main_branch_name"] || "main" project_id = CodeclimateDiff.configuration["gitlab"]["project_id"] host = CodeclimateDiff.configuration["gitlab"]["host"] baseline_filename = CodeclimateDiff.configuration["gitlab"]["baseline_filename"] - personal_access_token = ENV.fetch("CODECLIMATE_DIFF_GITLAB_PERSONAL_ACCESS_TOKEN") # curl --output codeclimate_diff_baseline.json --header "PRIVATE-TOKEN: MYTOKEN" "https://gitlab.digitalnz.org/api/v4/projects/85/jobs/artifacts/main/raw/codeclimate_diff_baseline.json?job=code_quality" url = "#{host}/api/v4/projects/#{project_id}/jobs/artifacts/#{branch_name}/raw/#{baseline_filename}?job=code_quality" response = RestClient.get(url, { "PRIVATE-TOKEN": personal_access_token }) - File.write("codeclimate_diff_baseline.json", response.body) + + if response.code < 300 + File.write("codeclimate_diff_baseline.json", response.body) + puts "Successfully updated the baseline." + else + puts "Downloading baseline file failed with status code #{response.code}: #{response.body}" + puts "Using current baseline." + end + rescue StandardError => e puts e + puts "Using current baseline." end end end diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index b10fd7e..7bc22fa 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.6" + VERSION = "0.1.7" end From 8d4b1e9fdc18cb30fdc88dc3d293a7423a3e8d6b Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Tue, 6 Dec 2022 17:25:59 +1300 Subject: [PATCH 05/29] fix: if you don't exclude files that have been deleted, codeclimate does strange things! --- Gemfile.lock | 2 +- lib/codeclimate_diff/runner.rb | 1 + lib/codeclimate_diff/version.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8b29cdf..77b3428 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.7) + codeclimate_diff (0.1.8) colorize json optparse diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index 652b0f0..bd445a4 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -14,6 +14,7 @@ def self.calculate_changed_filenames(pattern) branch_name = CodeclimateDiff.configuration["main_branch_name"] || "main" files_changed_str = `git diff --name-only #{branch_name} | grep --invert-match spec/ | grep --extended-regexp '.js$|.rb$'#{extra_grep_filter}` files_changed_str.split("\n") + .filter { |filename| File.exist?(filename) } end def self.calculate_issues_in_changed_files(changed_filenames, always_analyze_all_files) diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index 7bc22fa..455215a 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.7" + VERSION = "0.1.8" end From dac6986fd147895c6a88b3aa30b3016f37e73b72 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 11:54:15 +1300 Subject: [PATCH 06/29] feat: incremented version number --- Gemfile.lock | 4 ++-- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 77b3428..3511f59 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.8) + codeclimate_diff (0.1.9) colorize json optparse @@ -27,7 +27,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) netrc (0.11.0) - optparse (0.2.0) + optparse (0.3.1) parallel (1.22.1) parser (3.1.2.1) ast (~> 2.4.1) diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index 455215a..03209d0 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.8" + VERSION = "0.1.9" end From 325ae10c366348e46ae4141c055a8426c0613c10 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 11:58:50 +1300 Subject: [PATCH 07/29] temp: reverting version number again --- Gemfile.lock | 2 +- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3511f59..892798f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.9) + codeclimate_diff (0.1.8) colorize json optparse diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index 03209d0..455215a 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.9" + VERSION = "0.1.8" end From 1f8043aabf37026bcb2ca72068286a38b282695d Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 12:08:01 +1300 Subject: [PATCH 08/29] feat: added a test --- .codeclimate.yml | 16 ++++++++++++++++ codeclimate_diff_baseline.json | 6 +----- spec/codeclimate_diff_spec.rb | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..f7134fb --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,16 @@ +--- +version: "2" +plugins: + rubocop: + enabled: true + channel: rubocop-1-36-0 + reek: + enabled: true + +checks: + method-complexity: + config: + threshold: 10 # defaults to 5. Cognitive complexity rather than cyclomatic complexity + +exclude_patterns: + - "**/spec/" \ No newline at end of file diff --git a/codeclimate_diff_baseline.json b/codeclimate_diff_baseline.json index 54a545d..2d86f79 100644 --- a/codeclimate_diff_baseline.json +++ b/codeclimate_diff_baseline.json @@ -1,5 +1 @@ -[{"engine_name":"structure","fingerprint":"3533a4842f04580cf9020d509188a831","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `print_category` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":128,"end":128}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"}, -{"engine_name":"structure","fingerprint":"5728cf2c2fd73a8a5fbf51a633ac90ed","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 `calculate_issues_in_changed_files` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":21,"end":37}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"}, -{"engine_name":"structure","fingerprint":"4e179b5b52e93b38c2fff38219cd8ac5","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 `print_result` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":159,"end":185}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"}, -{"engine_name":"structure","fingerprint":"9f9772c5d55a7542b71e2fbfe5c5ab52","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `sort_issues` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":74,"end":114}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"}, -{"name":"ruby.parse.succeeded","type":"measurement","value":2,"engine_name":"structure"}] +[{"engine_name":"structure","fingerprint":"e26cdfe5ebe0bbd1decb8031dbfa73c4","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `Events` has 90 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/analytics/events.js","lines":{"begin":7,"end":135}},"other_locations":[],"remediation_points":2160000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"7c6c647b42c5337cddd80072b1f8c632","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `TopicExplorer` has 45 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":7,"end":60}},"other_locations":[],"remediation_points":1080000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"5768629200e0fb6743f9263749587116","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `Accordion` has 111 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":5,"end":161}},"other_locations":[],"remediation_points":2664000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"efd1971d1f373917e949060cedfa7deb","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `setToggleSectionToggler` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":114,"end":145}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"59c485bf567222af904fb6f5fe106b67","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `SideNav` has 51 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/consyncful/side-nav.js","lines":{"begin":13,"end":80}},"other_locations":[],"remediation_points":1224000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"717712094ceefd3e046c0abceb9e301c","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `Sorting` has 65 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/items/sorting.js","lines":{"begin":7,"end":109}},"other_locations":[],"remediation_points":1560000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"e10f45680a25d71e7411ceef5ed7f25f","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `GlobalNav` has 64 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/others/global-nav.js","lines":{"begin":6,"end":110}},"other_locations":[],"remediation_points":1536000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"c1e1e39c5c8fb2af28e4733ed58b8062","categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `contents-filter.js` has 251 lines of code (exceeds 250 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":1,"end":408}},"other_locations":[],"remediation_points":1214400,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"63c0eb9785b6940f0aeefde4681c5b5c","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `ContentsFilter` has 242 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":13,"end":402}},"other_locations":[],"remediation_points":5808000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"690d16da023111613f3042bec7990599","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `defineGrids` has 56 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":53,"end":126}},"other_locations":[],"remediation_points":1344000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"cd89c0059a95e95ab878f281e2beae0f","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `TopicsFilter` has 171 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":13,"end":306}},"other_locations":[],"remediation_points":4104000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"6c48648d6db41c7c1a33bf0b64ad601e","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `initFilter` has 40 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":45,"end":112}},"other_locations":[],"remediation_points":960000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"c2b22ecb0fd6b3036ad2ffbc83f87f9c","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `RealMe` has 51 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/epic_realme_login/index.js","lines":{"begin":12,"end":114}},"other_locations":[],"remediation_points":1224000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"1db91e66ebcfd16dad02abc06d8b360d","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `_addMapMarkers` has 69 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/places.js","lines":{"begin":66,"end":153}},"other_locations":[],"remediation_points":1656000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"1cbee2fbf8a8783931e010e0a90f1f1e","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `initFilterToggleState` has 36 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":12,"end":69}},"other_locations":[],"remediation_points":864000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"435691e91eb8b254f0a7eeff633c443b","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `init` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/site_notices.js","lines":{"begin":2,"end":39}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"6db3444b96ca1632da43a8af0ef98af2","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `init` has 35 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/slideshow_gallery_block.js","lines":{"begin":4,"end":43}},"other_locations":[],"remediation_points":840000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"5e2c922311dde23f00a61ac282133e2f","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `exports` has 78 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"babel.config.js","lines":{"begin":1,"end":82}},"other_locations":[],"remediation_points":1872000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"ce8ca15c56d2ad68da08190f73698bfd","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 `update` has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":64,"end":101}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"954ae3d97cce9ec2a1049451fdbe3274","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `update` has 29 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":64,"end":101}},"other_locations":[],"remediation_points":696000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"d63945970dce3ed1ef2b7634b214a4e9","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `ApplicationController` has 28 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/controllers/application_controller.rb","lines":{"begin":5,"end":291}},"other_locations":[],"remediation_points":2000000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"965b9d07989da5e01ae06685b65b7f9f","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 `javascript_includes` has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":157}},"other_locations":[],"remediation_points":950000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"48b70739c3482749f4cee49a655204cd","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 `javascript_packs` has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/application_helper.rb","lines":{"begin":166,"end":198}},"other_locations":[],"remediation_points":1250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"617e828c243c627d2f466e2e2c32ab0a","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `javascript_includes` has 33 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":157}},"other_locations":[],"remediation_points":792000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"e20f0c4541be0dc02aa4675bec3e4224","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 `mobile_nav_parents` has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":54,"end":86}},"other_locations":[],"remediation_points":1250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"1dceee54c1fcaf7a9dc87432baa3a3d4","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 `mobile_nav_branches` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":111}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"3319204aec9dbc49edf58c25b54a5918","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 `image_links_for_contentful_slideshow_gallery` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":37,"end":52}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"dbaef396b485d139c811cff71cb9e2c0","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 `image_links_for_related_slideshow_gallery` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":60,"end":80}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"5ea9b1385b7bc0cbcaea606a712f42af","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `link_to_lock_filter` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":97,"end":97}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"64e7f1aec8efa0aa8cc536e6b8c19a50","categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `items_helper.rb` has 290 lines of code (exceeds 250 allowed). Consider refactoring.","location":{"path":"app/helpers/items_helper.rb","lines":{"begin":6,"end":402}},"other_locations":[],"remediation_points":1776000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0bf3c98b4150359360afedcafeaa3883","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `order_item_state_column` has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":8,"end":67}},"other_locations":[],"remediation_points":1550000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"543a25a22beedcf7abb03ec29c889183","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `order_item_state_column` has 40 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":8,"end":67}},"other_locations":[],"remediation_points":960000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"a76bcbd1dc1c35fa2fdc004b869be954","categories":["Complexity"],"check_name":"nested_control_flow","content":{"body":""},"description":"Avoid deeply nested control flow statements.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":50,"end":61}},"other_locations":[],"remediation_points":450000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"b63a1f4ba1c0e0dd24d98961cf21a77e","categories":["Complexity"],"check_name":"nested_control_flow","content":{"body":""},"description":"Avoid deeply nested control flow statements.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":64,"end":65}},"other_locations":[],"remediation_points":450000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"a1e546b437ad3c126f37b2a508ee9233","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `to_csv` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":10,"end":48}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"7e103432b017957fd6c64638a1100519","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `build_facets` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":9,"end":45}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"c7933bac83c70bb132c89859f44281a0","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `time_range` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":49,"end":62}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0a67072cfdfa4f00597f43527638fc1b","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `find_items` has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":18,"end":41}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"71f8d358012208b4465a6d8e4ea81813","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 `recording_type` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/event.rb","lines":{"begin":64,"end":86}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"87870ab394769cd4e5afd83f4c050186","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `structured_data` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/event.rb","lines":{"begin":166,"end":202}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"9bce25bdfce81902abc4e66a95a29d6f","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 `anchor_links` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":17,"end":28}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"172b42b02e9795287b91ce389dc78a19","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `build_branches` has 30 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":34,"end":67}},"other_locations":[],"remediation_points":720000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"4e32e355b879675f813baa315ccbd212","categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `user_tree.rb` has 270 lines of code (exceeds 250 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":3,"end":301}},"other_locations":[],"remediation_points":1488000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"cca13482c5ffc738c8f5b42756563339","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `build_branches` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":29,"end":51}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"eb7178c025aac0cadb484c3e8ebc3990","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Page` has 25 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/page.rb","lines":{"begin":4,"end":183}},"other_locations":[],"remediation_points":1700000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"d1ba73aca41aea33b4d335e4d506b906","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Item` has 57 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/item.rb","lines":{"begin":3,"end":293}},"other_locations":[],"remediation_points":4900000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"81b6ccaa862bb2d1a960c02431d38bc8","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `initialize` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/search.rb","lines":{"begin":9,"end":36}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"2170e787932f42f48ce913bbe65b0166","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Order` has 21 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/shop/order.rb","lines":{"begin":4,"end":209}},"other_locations":[],"remediation_points":1300000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"6da0c35415e5d14aba36e93a1d72ece2","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 `items` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/shop/session_array.rb","lines":{"begin":83,"end":107}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"38c70944748871353342ece68ebd7690","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `build_sites` has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/sitemap.rb","lines":{"begin":93,"end":124}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"41af59862ecbfd9367886e8a299d1433","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 27 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/slideshow_image.rb","lines":{"begin":32,"end":66}},"other_locations":[],"remediation_points":648000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"acd0e404b258deca77580e13dfd174a6","categories":["Complexity"],"check_name":"return_statements","content":{"body":""},"description":"Avoid too many `return` statements within this method.","location":{"path":"app/models/stories/story.rb","lines":{"begin":46,"end":46}},"other_locations":[],"remediation_points":300000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"a2ede3430ccf99c79aae533214ae8d80","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_thumbnail_url` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":55,"end":74}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0d7931e34187257da3a3d9f3a1845ad3","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 `search_by_current_user` has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/user.rb","lines":{"begin":67,"end":92}},"other_locations":[],"remediation_points":1550000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"f685bcbb6f822884dec234767db1861a","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `User` has 32 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/user.rb","lines":{"begin":3,"end":251}},"other_locations":[],"remediation_points":2400000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"66d7a4540187600642f4e36c72becf80","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 `dynamic_attribute` has a Cognitive Complexity of 38 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":234,"end":310}},"other_locations":[],"remediation_points":2950000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"7984a34c3e1675c5ad91a227abae33c3","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `ItemPresenter` has 27 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":3,"end":333}},"other_locations":[],"remediation_points":1900000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0d2ee5dd67436fb1efe9ac2cc611ed49","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `dynamic_attribute` has 63 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":234,"end":310}},"other_locations":[],"remediation_points":1512000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"8bc8d275e3eb4d4d42f14ca66a17d968","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `transform_if_applicable` has 28 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/renderers/embedded/audio.rb","lines":{"begin":9,"end":43}},"other_locations":[],"remediation_points":672000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"01974e93abef15c415a3cb3460740433","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 35 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/services/alma/payload.rb","lines":{"begin":14,"end":50}},"other_locations":[],"remediation_points":840000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"bbeb1641d734d908a379f61b4726fc3e","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 `relativize_site_urls` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":133,"end":148}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"c93f8f82805b66302530942327f05a29","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 `import_accounts` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":40,"end":58}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"f9453f7c4af89b8d8d4bf1b49cf5bf7d","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/services/directories/object_map.rb","lines":{"begin":66,"end":105}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"2056229cc02588a90bad66da5a5810cf","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 `scan_for_viruses` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":20,"end":44}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"085badcc814316130deb76d244996bbe","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 `matches?` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":19,"end":35}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"duplication","fingerprint":"118c3e50a78e96c6e2aaaa16f878ef88","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":43,"end":53}},"remediation_points":2130000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":63,"end":73}}],"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> 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 106**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"94e2e1f5d26ab3fb7d96d63867ed73d4","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":63,"end":73}},"remediation_points":2130000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":43,"end":53}}],"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> 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 106**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"bc3e0cce5ba38b312d46377064dc31c0","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":33,"end":41}},"remediation_points":2070000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":53,"end":61}}],"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> 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 104**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"660c2b98661670636cf871a15a08c1f6","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":53,"end":61}},"remediation_points":2070000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":33,"end":41}}],"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> 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 104**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"432f741c05d1ed7fea57c58d76f9806e","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/event_gallery.js","lines":{"begin":16,"end":35}},"remediation_points":3480000,"other_locations":[{"path":"app/javascript/packs/feature_card_gallery.js","lines":{"begin":16,"end":35}}],"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> 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 151**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"40dbb9449ee9ce588405c47231d0ecd9","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/feature_card_gallery.js","lines":{"begin":16,"end":35}},"remediation_points":3480000,"other_locations":[{"path":"app/javascript/packs/event_gallery.js","lines":{"begin":16,"end":35}}],"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> 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 151**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"4880a5b90833ecb9f90562db05fcc206","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":331,"end":339}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":140,"end":148}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"4c372fa25b0216c26d0f9b897e717cc2","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":140,"end":148}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":331,"end":339}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"dbf20f85cf240563e872ad44ca25f188","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":344,"end":364}},"remediation_points":2760000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":265,"end":285}}],"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> 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 127**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"be92862c4175cb05bf3ec5cdae9c19e6","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":265,"end":285}},"remediation_points":2760000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":344,"end":364}}],"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> 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 127**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"96a44ac8e8d5ceb31aa18dacda3c89c0","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/contentful/production-contentful-export.js","lines":{"begin":17,"end":23}},"remediation_points":720000,"other_locations":[{"path":"lib/contentful/staging-contentful-export.js","lines":{"begin":15,"end":21}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 59**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"aed72226589b83a8063cc1b3b08a840f","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/contentful/staging-contentful-export.js","lines":{"begin":15,"end":21}},"remediation_points":720000,"other_locations":[{"path":"lib/contentful/production-contentful-export.js","lines":{"begin":17,"end":23}}],"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> 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 59**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"6b55566cbb44f90bed287d6c4817783d","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}},{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"6237ec31b91c69d335aec49b0137ad10","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}},{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"cb31b7eb3658926fc9123749bd747c70","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"3ffbcd802ca831d2a1a05adda4eb3ed4","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"b13fddf181df4dfffee29e4de34acedf","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":36,"end":43}},"remediation_points":2040000,"other_locations":[{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":45,"end":52}}],"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> 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 103**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"b13fddf181df4dfffee29e4de34acedf","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":45,"end":52}},"remediation_points":2040000,"other_locations":[{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":36,"end":43}}],"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> 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 103**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"0e75930fa815e32df0ed13fbbec02812","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":5,"end":11}},"remediation_points":390000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":45,"end":51}}],"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> 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 48**.\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":"81aa6acad347f765a9f531ef2c646851","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":45,"end":51}},"remediation_points":390000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":5,"end":11}}],"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> 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 48**.\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":"1e6fdbb854f646b2de4a2f8f473a7b3d","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":93,"end":101}},"remediation_points":1620000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":71,"end":79}}],"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> 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 89**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"1d9aa176415e1362858673443c9a7286","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":71,"end":79}},"remediation_points":1620000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":93,"end":101}}],"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> 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 89**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"feab653a45a13d121450fa517f11f983","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/cart.js","lines":{"begin":7,"end":13}},"remediation_points":1290000,"other_locations":[{"path":"app/assets/javascripts/analytics/favourite.js","lines":{"begin":7,"end":13}}],"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> 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 78**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"ee42a91a9a20cb0df030e6937f50be60","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/favourite.js","lines":{"begin":7,"end":13}},"remediation_points":1290000,"other_locations":[{"path":"app/assets/javascripts/analytics/cart.js","lines":{"begin":7,"end":13}}],"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> 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 78**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"cdc8ce0248a7ce08763c7fc15bd05895","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":389,"end":399}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":293,"end":303}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"c15c029bfbd8491e1a8c5540249cc9a9","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":293,"end":303}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":389,"end":399}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1c97a0a7982d62b038ffa9756ef054f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":19,"end":29}},"remediation_points":1110000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":49,"end":59}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1c97a0a7982d62b038ffa9756ef054f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":49,"end":59}},"remediation_points":1110000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":19,"end":29}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"44cd3353aa1001402030cf481de11707","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":375,"end":381}},"remediation_points":900000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":254,"end":260}}],"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> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"2eeb2f03a4b975434cd9c64b2e249e34","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":254,"end":260}},"remediation_points":900000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":375,"end":381}}],"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> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"9f759e6058255cca9851ee6af1458579","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":64,"end":72}},"remediation_points":810000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":93,"end":101}}],"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> 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 62**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"9a03538e98ee30f47895bee62a608116","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":93,"end":101}},"remediation_points":810000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":64,"end":72}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 62**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1dbd2765fb40e7622b3a259b08109dd","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":24,"end":26}},"remediation_points":780000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":29,"end":31}}],"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> 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 61**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1dbd2765fb40e7622b3a259b08109dd","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":29,"end":31}},"remediation_points":780000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":24,"end":26}}],"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> 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 61**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"0d2b1304fcbad609b4e841803876b9c7","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":58,"end":60}},"remediation_points":750000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":66,"end":68}}],"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> 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 60**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"0d2b1304fcbad609b4e841803876b9c7","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":66,"end":68}},"remediation_points":750000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":58,"end":60}}],"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> 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 60**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":53,"end":57}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":59,"end":63}}],"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":59,"end":63}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":53,"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":97,"end":103}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":103,"end":109}}],"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":103,"end":109}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":97,"end":103}}],"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"de0f29bb319bb5f37f1944d0a056175e","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":39,"end":46}},"remediation_points":600000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":66,"end":73}}],"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> 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 55**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"de0f29bb319bb5f37f1944d0a056175e","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":66,"end":73}},"remediation_points":600000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":39,"end":46}}],"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> 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 55**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"cb31b7eb3658926fc9123749bd747c70","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":160,"end":164}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/search_filters.js","lines":{"begin":166,"end":170}}],"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> 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 53**.\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":"cb31b7eb3658926fc9123749bd747c70","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":166,"end":170}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/search_filters.js","lines":{"begin":160,"end":164}}],"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> 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 53**.\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":"e2b8bcecd30bb422edbb648dbf86e820","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/rauemi_a_ipurangi/pou.js","lines":{"begin":7,"end":12}},"remediation_points":480000,"other_locations":[{"path":"app/javascript/packs/rauemi_a_ipurangi/whare_tupuna.js","lines":{"begin":7,"end":12}}],"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> 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 51**.\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":"b16127e2caba752ecf33592a04f10276","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/rauemi_a_ipurangi/whare_tupuna.js","lines":{"begin":7,"end":12}},"remediation_points":480000,"other_locations":[{"path":"app/javascript/packs/rauemi_a_ipurangi/pou.js","lines":{"begin":7,"end":12}}],"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> 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 51**.\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":"84d604a35b4109fdca4f7ac74b8bffa6","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":126,"end":135}},"remediation_points":390000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","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> 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 48**.\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":"84d604a35b4109fdca4f7ac74b8bffa6","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":135,"end":144}},"remediation_points":390000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":126,"end":135}}],"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> 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 48**.\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":"094ac33ed3c45e50e74faf47c72a099f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":15,"end":17}},"remediation_points":300000,"other_locations":[{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":19,"end":21}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 45**.\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":"094ac33ed3c45e50e74faf47c72a099f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":19,"end":21}},"remediation_points":300000,"other_locations":[{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":15,"end":17}}],"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> 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 45**.\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":"a4b3edccfc2cdfc59a131bc3b310e371","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":4,"end":11}},"remediation_points":370000,"other_locations":[{"path":"app/models/sitemap.rb","lines":{"begin":173,"end":180}}],"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> 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 36**.\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":"49899c6fa765c1fde06bde63f4ff6465","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":173,"end":180}},"remediation_points":370000,"other_locations":[{"path":"app/helpers/stories_helper.rb","lines":{"begin":4,"end":11}}],"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> 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 36**.\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":"022789af5c2a5463d13695da848ac672","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"end":36}},"remediation_points":150000,"other_locations":[{"path":"app/helpers/orders_helper.rb","lines":{"begin":58,"end":60}}],"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> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},{"engine_name":"duplication","fingerprint":"022789af5c2a5463d13695da848ac672","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":58,"end":60}},"remediation_points":150000,"other_locations":[{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"end":36}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},{"engine_name":"duplication","fingerprint":"738a607e826825edc91822382649e324","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":14,"end":18}},"remediation_points":330000,"other_locations":[{"path":"app/models/stories/record.rb","lines":{"begin":21,"end":26}}],"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> 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":"bdadf4f9c4b9f02cba56dcf3a11af14a","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/stories/record.rb","lines":{"begin":21,"end":26}},"remediation_points":330000,"other_locations":[{"path":"app/models/schools/topics/record.rb","lines":{"begin":14,"end":18}}],"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> 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":"reek","fingerprint":"7e2f8f87f368bcd30550f1de246576bf","type":"issue","check_name":"UtilityFunction","description":"RauemiAIpurangi::RauemiSearchCommand#all_rauemi_ids doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/commands/rauemi_a_ipurangi/rauemi_search_command.rb","lines":{"begin":44,"end":44}},"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":"3899e53d0b440d28efccc557bdf372ea","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#add_filter_path_for calls 'facet.value' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":38,"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":"98976ff0211cb32954f09117f828ea35","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#build_search_option_exceptions calls 'exceptions << { year: search.year }' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":84,"end":86}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5f05b3b0721f0da7608843259f1f0642","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#build_search_option_exceptions calls 'facet.name' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":73,"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":"b2fc35250e20b3e21a1d3a55ee60b250","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#build_search_option_exceptions calls 'search.year' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":84,"end":86}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a5b2c3a4c9265b069ed351ae18954ad","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#clear_filter_path_for calls 'search.options' 3 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":53,"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":"cb228c728202334ac9d9a646e38ab485","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#clear_filter_path_for calls 'search.options[:text]' 3 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":53,"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":"9da748082de95070bffd126aa6fe0d19","type":"issue","check_name":"ManualDispatch","description":"Search::BaseFilterComponent#clear_filter_path_for manually dispatches method call","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":58,"end":58}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be4fb81e6020c74888b13111d43dd336","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#add_filter_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":35,"end":35}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be4fb81e6020c74888b13111d43dd336","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#build_search_option_exceptions performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":70,"end":70}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a569ccff1e3654e44eea8969cf6d03b","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#clear_filter_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":51,"end":51}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ca7335f46b6e43c08bba77c82e974843","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#current_filters_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":23,"end":23}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"711c266ab1bacb22177ada62ac229424","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#filter_count performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"18238e5a3005023ab8076e66dcf7b3c8","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#filter_is_active? performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":29,"end":29}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"501eb0e417857df87a3a770201bdf899","type":"issue","check_name":"RepeatedConditional","description":"Search::BaseFilterComponent tests 'facet.nil?' at least 4 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":29,"end":70}},"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":"fb3e260e39641817040941a76135b33d","type":"issue","check_name":"UncommunicativeVariableName","description":"Search::BaseFilterComponent#add_filter_path_for has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":44,"end":44}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4085b25f58265e26c1a6806511fefb1e","type":"issue","check_name":"UtilityFunction","description":"Search::BaseFilterComponent#current_filters_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":22,"end":22}},"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":"81f4fc54d9798a31b44a363003b369a6","type":"issue","check_name":"UtilityFunction","description":"Search::BaseFilterComponent#facet_id doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":63,"end":63}},"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":"219abb2a76d87438ea95645d5e892ca9","type":"issue","check_name":"NilCheck","description":"Search::Filters::CategoriesComponent#render? performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/filters/categories_component.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"caaa77025ecf768c8a71108b5c9d8810","type":"issue","check_name":"DuplicateMethodCall","description":"Search::FiltersComponent#reset_current_filters_path calls 'params[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/filters_component.rb","lines":{"begin":14,"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":"fc444bc239d5c00a6c26c0d11af01ce3","type":"issue","check_name":"BooleanParameter","description":"Search::GlobalSearchComponent#initialize has boolean parameter 'show_heading'","categories":["Complexity"],"location":{"path":"app/components/search/global_search_component.rb","lines":{"begin":6,"end":6}},"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":"14fa802e015c1064d0b8b1fb8de953c0","type":"issue","check_name":"NilCheck","description":"Search::Models::Facet#authority? performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/models/facet.rb","lines":{"begin":47,"end":47}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"56faff45a248bac152133d0cc645df60","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::AnalyticsController#create calls 'date_params[:end_date]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/any_questions/analytics_controller.rb","lines":{"begin":11,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c1c639b9d82435653e72d1ffb9953e77","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::AnalyticsController#create calls 'date_params[:start_date]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/any_questions/analytics_controller.rb","lines":{"begin":11,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d5cc8ad8576e6de088d3bdbaddfab36c","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'document.iv' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":39,"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":"17910fdbe61a493d69ecd29201c4a7f9","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'document.key' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":39,"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":"4070656881bc98871269392decfc8960","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'params[:content_type]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":34,"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":"06b5d04ce867e8d1c8700c53a906e8cf","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.headers' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":34,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1b942a527a00bedf25e66a3aa9ad6246","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.headers['Content-Disposition'] = 'attachment'' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":36,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4c1bce881cb82092f8e154e5089de9a7","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.headers['Content-Type'] = params[:content_type] || DEFAULT_SEND_FILE_TYPE' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":34,"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":"5a16897b5aa564c6bff7c88154dd3bb6","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.stream' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":40,"end":57}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ef94b9dcda6084ee04b01dd56b582c31","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.stream.write chunk' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":42,"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":"6746469504c2211b0c5ec2beeb112c5d","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#update calls 'file.rewind' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":78,"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":"180a9fa199c68a8f4e5c637b7bd04c6c","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#update calls 'request.body' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":73,"end":79}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3e1c6f3cd0c290392c1fae99ea9a561","type":"issue","check_name":"TooManyStatements","description":"Admin::Documents::DiskController#show has approx 15 statements","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":23,"end":23}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"0a72d79707787cadbe0289f351647d34","type":"issue","check_name":"TooManyStatements","description":"Admin::Documents::DiskController#update has approx 18 statements","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":64,"end":64}},"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, &error)\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, &error))[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":"8ade6bd74b4864c9bca50ea1042517d6","type":"issue","check_name":"UncommunicativeMethodName","description":"Admin::Documents::DiskController#render_404 has the name 'render_404'","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":105,"end":105}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"77f99cb9b80112795a9e236fbd248e18","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Epic::DocumentsController#manage_documents calls 'params[:file_name]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/epic/documents_controller.rb","lines":{"begin":11,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2faea1a8f52a81a08a965b94140ef4d8","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::ResearchPayments::PaymentsController#index calls 'params[:reftracker_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/research_payments/payments_controller.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":"e6ad9c0df2255e9c9cc752450a117564","type":"issue","check_name":"NilCheck","description":"Admin::ResearchPayments::PaymentsController#update performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/admin/research_payments/payments_controller.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8fa5a5aea57ab7f709c5818686b26195","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Shop::OrderDeliveriesController#create calls 'params[:accept_ids]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/shop/order_deliveries_controller.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fd35d1ee8a452f823277ac4283877ebc","type":"issue","check_name":"NilCheck","description":"Admin::Shop::OrdersController#toggle_order_status_session performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/admin/shop/orders_controller.rb","lines":{"begin":30,"end":30}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"95bbabf50faed6911f42b62c96cb0d22","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationController#login_return_to_allowed? calls 'session[:login_return_to]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":267,"end":272}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"62c3abacf06c0a0e888fe832287d132a","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationController#read_cookies_for calls 'cookies[key]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":190,"end":192}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9a9c952c9aeabbeb3a53f2ac6396a5b6","type":"issue","check_name":"FeatureEnvy","description":"ApplicationController#last_modified refers to 'timestamp' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":251,"end":253}},"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":"4818b3d25f413e01eb882e92e8e89da0","type":"issue","check_name":"FeatureEnvy","description":"ApplicationController#paginate_array refers to 'array' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":261,"end":263}},"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":"4a6c58e88ee0da9c06da1b4b9142fbec","type":"issue","check_name":"FeatureEnvy","description":"ApplicationController#perform_otp refers to 'user' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":277,"end":286}},"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":"24531d0df0af27207ff0091553040533","type":"issue","check_name":"ManualDispatch","description":"ApplicationController#last_modified manually dispatches method call","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":255,"end":255}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"955a02caf6915cef4ff26a13284462b6","type":"issue","check_name":"MissingSafeMethod","description":"ApplicationController has missing safe method 'register_sso_ls_cookie!'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":210,"end":210}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"b86f82788871284b31fdd9a0010cd03e","type":"issue","check_name":"MissingSafeMethod","description":"ApplicationController has missing safe method 'unregister_sso_ls_cookie!'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":214,"end":214}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"337817ecb78f4df47e967ab4a3362127","type":"issue","check_name":"NilCheck","description":"ApplicationController#current_user_favourite_ids performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":123,"end":123}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"caa5a737c61cb4c6a335503427e13948","type":"issue","check_name":"NilCheck","description":"ApplicationController#find_content_by_slug performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":154,"end":154}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ede49c8e28cb4f7366a1d05daad6b2b9","type":"issue","check_name":"NilCheck","description":"ApplicationController#last_modified performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":251,"end":251}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fc49f9571a0a43e7197e57e42e370332","type":"issue","check_name":"NilCheck","description":"ApplicationController#perform_otp performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":277,"end":277}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f64fd2cf796cb74edbb3963179b4b226","type":"issue","check_name":"NilCheck","description":"ApplicationController#sign_in_user performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":179,"end":179}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"14a4a803311b680b5baa62d7050a8bac","type":"issue","check_name":"TooManyInstanceVariables","description":"ApplicationController has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e1b5031cb644f3a24161c673f0ba4f65","type":"issue","check_name":"TooManyMethods","description":"ApplicationController has at least 28 methods","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"80475a4495192ecc4bb4d56ab83c2ecf","type":"issue","check_name":"UncommunicativeMethodName","description":"ApplicationController#render_404 has the name 'render_404'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":92,"end":92}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"3d821f8f6c3ad10a72b628ddf26cc67c","type":"issue","check_name":"UncommunicativeMethodName","description":"ApplicationController#render_500 has the name 'render_500'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":96,"end":96}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"6d879f42a64b5bf135066ab7b17f326c","type":"issue","check_name":"UtilityFunction","description":"ApplicationController#find_content_by_slug doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":153,"end":153}},"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":"f49e87a924b34997be8e51737ddc150a","type":"issue","check_name":"UtilityFunction","description":"ApplicationController#honeypot_fields doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":170,"end":170}},"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":"ec94401f5338712a5e2fe62f9eee2689","type":"issue","check_name":"UtilityFunction","description":"ApplicationController#unregister_sso_ls_cookie! doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":214,"end":214}},"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":"dfa2a004df734bd9509cbe73b21638fc","type":"issue","check_name":"NilCheck","description":"Blog::AuthorsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/authors_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"82b2ef75a9636840782d121b8f25ec69","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CategoriesController#show calls 'format.rss' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/categories_controller.rb","lines":{"begin":21,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b74e652f9f6e75c89fb41af52fd6b2ca","type":"issue","check_name":"NilCheck","description":"Blog::CategoriesController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/categories_controller.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bfbedc4c0a698985de18fb25c77a7642","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.blog_page' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":11,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"38dea928101bee996c362da5449f54e8","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.blog_page.slug' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":11,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa6790eb299616634938f2e9bf571540","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.errors' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e14d489be7d5aa6efebc2e3769f41c66","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.errors.full_messages' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8fea166d3c5218bf28616969a45e72a0","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls 'blog_posts_path(path: @blog_comment.blog_page.slug)' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":11,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e669b819e45532e28418d1d530a6a24b","type":"issue","check_name":"NilCheck","description":"Blog::PostsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/posts_controller.rb","lines":{"begin":23,"end":23}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6613c0eb26bf4c985f978a3ad887ed5b","type":"issue","check_name":"NilCheck","description":"Blog::TagsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/tags_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4ff1320b6a6b3d574302ad01eb64e2f5","type":"issue","check_name":"DuplicateMethodCall","description":"AuthenticateWithOtp#find_user calls 'session[:otp_user_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/authenticate_with_otp.rb","lines":{"begin":49,"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":"50c81fb3a82124a5fc4affc98464f12f","type":"issue","check_name":"NilCheck","description":"AuthenticateWithOtp#user_params performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/authenticate_with_otp.rb","lines":{"begin":43,"end":43}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"98948c24f6283087c0bdf67242104367","type":"issue","check_name":"BooleanParameter","description":"ItemSearchable#tab_counts has boolean parameter 'natlib_content'","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":42,"end":42}},"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":"0f647aa3d7fe9caf69c6f7ae0f0902c6","type":"issue","check_name":"ControlParameter","description":"ItemSearchable#search is controlled by argument 'special_params'","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":36,"end":36}},"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":"bd7cbae075b976255c2a7a1b3774eb9b","type":"issue","check_name":"ControlParameter","description":"ItemSearchable#tab_counts is controlled by argument 'natlib_content'","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":59,"end":59}},"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":"1230aabe80092f6c6bd175f8bd115640","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#assign_categories_from_facets calls '@facets.find' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":23,"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":"882fd16a0e24eb4cfb75b316862ef4a7","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#assign_categories_from_facets calls 'facet.name' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":23,"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":"99b33e8963dfd19e089fdcc4ba6f3efd","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#search calls 'params[:search]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.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":"74334deefbc41b66ca2bb74f77a3e517","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#search calls 'params[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":35,"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":"02cbaa7e51a2400cce9ce015bba2c227","type":"issue","check_name":"FeatureEnvy","description":"ItemSearchable#tab_counts refers to 'search' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":59,"end":60}},"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":"5cda65e7acf3daa71be0b3de3e81c1c6","type":"issue","check_name":"NilCheck","description":"ItemSearchable#assign_categories_from_facets performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"11a4f14cd37da473c4a84a4b2ad4bc1e","type":"issue","check_name":"NilCheck","description":"ItemSearchable#assign_high_resolution_images_facet performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b426f8d7692e35e6bcd441d01d53ac99","type":"issue","check_name":"TooManyStatements","description":"ItemSearchable#assign_categories_from_facets has approx 13 statements","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":20,"end":20}},"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, &error)\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, &error))[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":"2535ad36f8ef3c95199637c10ca7cafe","type":"issue","check_name":"UtilityFunction","description":"Routeable#default_url_options doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/concerns/routeable.rb","lines":{"begin":11,"end":11}},"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":"91790137062d3df0cc52a0fb7a897cf8","type":"issue","check_name":"DuplicateMethodCall","description":"Transactionable#store_transaction calls '@session[SESSION_KEY]' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":24,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b1a6f633e4c43b83b0587bc31f69cdd8","type":"issue","check_name":"DuplicateMethodCall","description":"Transactionable#transaction_exists? calls '@session[SESSION_KEY]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":18,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"95efac63a305ceff31471828dfa9b748","type":"issue","check_name":"NilCheck","description":"Transactionable#new_transaction performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7458643be6862b7842dbc477503f9e70","type":"issue","check_name":"NilCheck","description":"Transactionable#transaction_exists? performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":18,"end":18}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"61dfb72fdaf3e1afb704cca49e3b515e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::BasePagesController#show calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/base_pages_controller.rb","lines":{"begin":11,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"398393841da66f1b29313e2c1fd1c57a","type":"issue","check_name":"NilCheck","description":"Consyncful::BasePagesController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/base_pages_controller.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88df256aacc520b2a67b1a1aa8ec2287","type":"issue","check_name":"UtilityFunction","description":"Consyncful::BasePagesController#find_page_by_slug doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/base_pages_controller.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d90cda48f3b9db2db1e7e87e9961470","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventsController#assign_date calls 'DateTime.current' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/events_controller.rb","lines":{"begin":65,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b1d94ba1594f4853ab9387ae05b36d8a","type":"issue","check_name":"NilCheck","description":"Consyncful::EventsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/events_controller.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"181d570c11667b49f85c3f2ba438c706","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::EventsController has at least 10 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/events_controller.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fba7a20ebccb83f30a5e848caf6cbb31","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::HeTohuEventsController#assign_event_page calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/he_tohu_events_controller.rb","lines":{"begin":30,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4abc611bf7cf777f6db6289e5eeac2aa","type":"issue","check_name":"NilCheck","description":"Consyncful::HeTohuEventsController#assign_event_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/he_tohu_events_controller.rb","lines":{"begin":29,"end":29}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4abc611bf7cf777f6db6289e5eeac2aa","type":"issue","check_name":"NilCheck","description":"Consyncful::HeTohuEventsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/he_tohu_events_controller.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ca3740e72013f91988ee89c6b52cf10a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::PagesController#render_page calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":34,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"63c69af65d37cce3e793e9faca0e99f4","type":"issue","check_name":"NilCheck","description":"Consyncful::PagesController#find_image_data_by_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":50,"end":50}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c8dda99155cc685fc08505eb0aa34cd2","type":"issue","check_name":"NilCheck","description":"Consyncful::PagesController#home performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27e90e08e4fb7fffcf459a1d3918de10","type":"issue","check_name":"UtilityFunction","description":"Consyncful::PagesController#find_image_data_by_path doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":49,"end":49}},"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":"aadceadbc518faaa6776dfd3953674af","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SchoolsEventsController#assign_event_page calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/schools_events_controller.rb","lines":{"begin":27,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"41f6b3d6012b29b625f0663daf00a9b7","type":"issue","check_name":"NilCheck","description":"Consyncful::SchoolsEventsController#assign_event_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/schools_events_controller.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5eb58df8426b8fd2444d21b0c01a211","type":"issue","check_name":"NilCheck","description":"Consyncful::TuiaMataurangaPagesController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/tuia_matauranga_pages_controller.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be956a117b623368dd70b848ccc2be98","type":"issue","check_name":"DuplicateMethodCall","description":"Documents::EncryptedBlobsController#show calls 'params[:document_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/documents/encrypted_blobs_controller.rb","lines":{"begin":22,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a42d688ecaa1abc38364d22c1e2ca76e","type":"issue","check_name":"UncommunicativeMethodName","description":"Documents::EncryptedBlobsController#render_404 has the name 'render_404'","categories":["Complexity"],"location":{"path":"app/controllers/documents/encrypted_blobs_controller.rb","lines":{"begin":39,"end":39}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"4c3b36c17ad93e6dfba2eef2a4dba156","type":"issue","check_name":"DuplicateMethodCall","description":"Form::CataloguingInPublicationsController#create calls 'request.path' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/form/cataloguing_in_publications_controller.rb","lines":{"begin":12,"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":"f0c8383fade311c2d6b67bb887b36be8","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsController#search_params calls 'object_params[:i]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":46,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e5874b7ffb3b8b17dbe4196d31a81e8","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsController#search_params calls 'params[:search]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":42,"end":42}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4ef0a13e19e5343219f19bfdf3949393","type":"issue","check_name":"FeatureEnvy","description":"ItemsController#search_params refers to 'object_params' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":42,"end":47}},"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":"bdce5207e9ec63ce2b0965c15a60d300","type":"issue","check_name":"TooManyInstanceVariables","description":"ItemsController has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b2f6ee089f5b98d77c88cbf2603efe80","type":"issue","check_name":"NilCheck","description":"LibrariesController#assign_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/libraries_controller.rb","lines":{"begin":32,"end":32}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d04673f3f042eb3db60bc4e755b8b6a4","type":"issue","check_name":"ControlParameter","description":"NewsletterSignupsController#page_by_type is controlled by argument 'type'","categories":["Complexity"],"location":{"path":"app/controllers/newsletter_signups_controller.rb","lines":{"begin":29,"end":29}},"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":"428e56413e09458d4d1d2b388f62ccdd","type":"issue","check_name":"TooManyInstanceVariables","description":"NewsletterSignupsController has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/newsletter_signups_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b82f199451105b2297828ef10815433c","type":"issue","check_name":"UtilityFunction","description":"NewsletterSignupsController#page_by_type doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/newsletter_signups_controller.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b17747cdb4414cb77e54ba78d4732e66","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#build_geo_points calls 'tapuhi_geo.placename' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":34,"end":41}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8ca121b75e2b794f94705b75d8b11e31","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#index calls 'facet.name == 'place_authority_id'' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cc812276f89530c2a40a5f4b03175b4d","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#index calls 'facet.name' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9b56507a2fdfdde61ee0366d5b5818b3","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#index calls 'params[:geo_bbox]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":13,"end":13}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d247c77f951598c8b140ca22a232dc2e","type":"issue","check_name":"FeatureEnvy","description":"PlacesController#build_geo_points refers to 'tapuhi_geo' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":32,"end":41}},"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":"627554aab45237f2a1222823dff47a45","type":"issue","check_name":"NilCheck","description":"PlacesController#build_geo_points performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"23cc21860d1b373276e982ecc620f211","type":"issue","check_name":"TooManyInstanceVariables","description":"PlacesController has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6b499dbaf5f3860107755d55c2c8cc24","type":"issue","check_name":"TooManyStatements","description":"PlacesController#index has approx 12 statements","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"b642755d68431ef5edbd54015212251e","type":"issue","check_name":"NilCheck","description":"RauemiAIpurangi::PouController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/rauemi_a_ipurangi/pou_controller.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"faeaa6936b8ffd84e5d21a43ee7aa42d","type":"issue","check_name":"NilCheck","description":"RauemiAIpurangi::RauemiController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/rauemi_a_ipurangi/rauemi_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"96310a51ae721687edaa4762d0502461","type":"issue","check_name":"NilCheck","description":"RauemiAIpurangi::WhareTupunaController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/rauemi_a_ipurangi/whare_tupuna_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cfe705012bea3408fc8a05f336ecd745","type":"issue","check_name":"NilCheck","description":"ResearchPaymentsController#pay performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/research_payments_controller.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a7002507f60e7739cfb9af5a62e48e5","type":"issue","check_name":"NilCheck","description":"ResearchPaymentsController#success performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/research_payments_controller.rb","lines":{"begin":42,"end":42}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"32f1993dc33a76e4319e1935b41ff6ed","type":"issue","check_name":"TooManyStatements","description":"ResearchPaymentsController#callback has approx 11 statements","categories":["Complexity"],"location":{"path":"app/controllers/research_payments_controller.rb","lines":{"begin":16,"end":16}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"092a01c4bc4dca60a933006c4268bbba","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsController#show calls '@topic.name' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/schools/topics_controller.rb","lines":{"begin":18,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c277c4aa63f840feab83902c52868f62","type":"issue","check_name":"TooManyInstanceVariables","description":"Schools::TopicsController has at least 7 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/schools/topics_controller.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3c7b690dc3f748012264732255653913","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::CartItemsController#index calls 'params[:return_to]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/cart_items_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1899ed97baf3206940a5e42322318e2e","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrdersController#update_order_items_requester_ip calls 'request.env' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":91,"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":"971505342303ab51d93af685feb6943c","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrdersController#update_order_items_requester_ip calls 'request.env['HTTP_X_FORWARDED_FOR']' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":91,"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":"325bdfedeed4e3786014e78c722e2e4e","type":"issue","check_name":"FeatureEnvy","description":"Shop::OrdersController#unavailable_item_titles refers to 'titles' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":114,"end":115}},"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":"be5c82496a9716ec8422e4c6e0926761","type":"issue","check_name":"MissingSafeMethod","description":"Shop::OrdersController has missing safe method 'redirect_to_sign_in!'","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":98,"end":98}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"12ead608bcd8065c0a6974a89ef2258e","type":"issue","check_name":"NilCheck","description":"Shop::OrdersController#complete performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":52,"end":52}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"15ab8fe2ec9472f7c8986e06fa680b29","type":"issue","check_name":"NilCheck","description":"Shop::OrdersController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1bc6d933e60e53aafe35f33fbb6f2322","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::OrdersController has at least 7 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9e4ff3c2059781415c2a10c1966971d2","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::PurchaseController#callback calls 'shop_order_path(@order)' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/purchase_controller.rb","lines":{"begin":44,"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":"ba8465c91a7e489c185d21f618d0117c","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::PurchaseController#callback calls 't('shop.orders.payment_fail')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/purchase_controller.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":"e1cf4da71024807bcbce4a13b3914d65","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesController#show calls 'params[:slideshow_gallery_block_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/stories_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3266ed7226daaaad2590f4292061a2e","type":"issue","check_name":"DuplicateMethodCall","description":"TePunaDonationsController#callback calls 'params[:result]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":39,"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":"34fa67d5370dc6e99739e54027994fec","type":"issue","check_name":"DuplicateMethodCall","description":"TePunaDonationsController#callback calls 'redirect_to te_puna_donations_path, alert: t('te_puna_donations.payment_fail')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":62,"end":69}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9ae3b51a56654fb8c4846a35f7f08f39","type":"issue","check_name":"DuplicateMethodCall","description":"TePunaDonationsController#callback calls 't('te_puna_donations.payment_fail')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":62,"end":69}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff9eee782b7840dcbed8d06a04e458a9","type":"issue","check_name":"NilCheck","description":"TePunaDonationsController#callback performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":39,"end":39}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e39148d33c275e0eddd44bb9a3ba26f7","type":"issue","check_name":"TooManyStatements","description":"TePunaDonationsController#callback has approx 15 statements","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":38,"end":38}},"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, &error)\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, &error))[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":"c729a34508d1d0f4226ddae7af66e974","type":"issue","check_name":"DuplicateMethodCall","description":"TermsController#search calls 'params[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/terms_controller.rb","lines":{"begin":47,"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":"e6f1a74e6d774fe79bcd4a782b9cdf94","type":"issue","check_name":"NilCheck","description":"TermsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/terms_controller.rb","lines":{"begin":59,"end":59}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"afaf1f12f9a89f816fddfbdf0d8f3797","type":"issue","check_name":"TooManyInstanceVariables","description":"TermsController has at least 12 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/terms_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8402414cb0eec6a6882626f2c1804877","type":"issue","check_name":"DuplicateMethodCall","description":"Users::FavouritesController#show calls 'I18n.t('users.favourites.add_to_favourites_success_message_html')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/favourites_controller.rb","lines":{"begin":20,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1fdd758b07cf0697f2f6e5c8bc8ff72e","type":"issue","check_name":"DuplicateMethodCall","description":"Users::OmniauthCallbacksController#realme calls 'Rails.logger' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/omniauth_callbacks_controller.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d7fa6f1c108a2edd5eabd1a2c4f0adb6","type":"issue","check_name":"DuplicateMethodCall","description":"Users::OmniauthCallbacksController#realme calls 'request.env' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/omniauth_callbacks_controller.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"961f368e0087bdc80be5677733a2e8b3","type":"issue","check_name":"TooManyStatements","description":"Users::OmniauthCallbacksController#realme has approx 13 statements","categories":["Complexity"],"location":{"path":"app/controllers/users/omniauth_callbacks_controller.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"ed732c53959f086d84768302ac20fb6f","type":"issue","check_name":"FeatureEnvy","description":"Users::RegistrationsController#send_epic_authorisation_email refers to 'profile' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":46,"end":49}},"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":"414d63b9d8187cf5c9094747108bde69","type":"issue","check_name":"NilCheck","description":"Users::RegistrationsController#create performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1faf3bb42f1322f49c79bddcffc340d2","type":"issue","check_name":"NilCheck","description":"Users::RegistrationsController#send_epic_authorisation_email performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":41,"end":41}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e83fc7a07b7cb14a3f0028baa20e1d28","type":"issue","check_name":"UtilityFunction","description":"Users::RegistrationsController#update_resource doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":59,"end":59}},"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":"4db3af174be966f589a9155559b04214","type":"issue","check_name":"DuplicateMethodCall","description":"Users::SessionsController#allowed_origin? calls 'params[:origin]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/sessions_controller.rb","lines":{"begin":46,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1128c0792a9f29e19b0307ce992f050d","type":"issue","check_name":"NilCheck","description":"Users::SessionsController#create performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/users/sessions_controller.rb","lines":{"begin":26,"end":32}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e70983e5e6477e08356b73921e9cac9f","type":"issue","check_name":"BooleanParameter","description":"ApplicationHelper#javascript_includes has boolean parameter 'reading_rooms'","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":114}},"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":"71afcef4ecd94016f7ccfc2b6aa56209","type":"issue","check_name":"ControlParameter","description":"ApplicationHelper#javascript_includes is controlled by argument 'reading_rooms'","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":127,"end":127}},"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":"42f33839eb6917867e765266fd205c2b","type":"issue","check_name":"ControlParameter","description":"ApplicationHelper#present is controlled by argument 'presenter_class'","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":92,"end":92}},"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":"b68e76527d39f973a1cad53e643abf3d","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#active_tab calls 'options[:count]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":37,"end":37}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ee804dca2b49320543b6e8589520a5df","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#active_tab calls 'options[:html]' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":23,"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":"ae092bc07a2c3e065e7d5d47bca6f200","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_includes calls 'request.path' 13 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":120,"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":"2293923a815e2e15b7a47cedcb844432","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_includes calls 'request.path.starts_with?('/schools')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":129,"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":"c960ec2d6fe902c250c1a88d1b39ff88","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_packs calls 'javascript_pack_tag('slideshow_gallery_block')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":177,"end":183}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0e219c2c3793ad1abc8999352b2560a","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_packs calls 'widget.name' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":191,"end":193}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"33d80438d6c914f4d677344de120e1e7","type":"issue","check_name":"ManualDispatch","description":"ApplicationHelper#javascript_packs manually dispatches method call","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":179,"end":179}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88ed8a8eca711edd33c6972b6b4d12ba","type":"issue","check_name":"NilCheck","description":"ApplicationHelper#javascript_packs performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":173,"end":173}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9e66a09f4e89d0b5900cff1521f1608e","type":"issue","check_name":"NilCheck","description":"ApplicationHelper#site_title performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":62,"end":62}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ba8441dddadb4047cf4b0b99d0892cf6","type":"issue","check_name":"TooManyStatements","description":"ApplicationHelper#active_tab has approx 21 statements","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":6,"end":6}},"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, &error)\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, &error))[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":"8580449a7e43c7ea6efb5abdb56923cb","type":"issue","check_name":"TooManyStatements","description":"ApplicationHelper#javascript_includes has approx 15 statements","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":114}},"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, &error)\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, &error))[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":"8da4a0e04e072d669c5053f6060998d1","type":"issue","check_name":"TooManyStatements","description":"ApplicationHelper#javascript_packs has approx 19 statements","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":166,"end":166}},"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, &error)\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, &error))[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":"3a48070add59757871828d85e447abe7","type":"issue","check_name":"DuplicateMethodCall","description":"CartItemsHelper#item_price calls 'item.price' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/cart_items_helper.rb","lines":{"begin":10,"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":"94f95efc1db1c2b3da7e044c4895cb85","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs calls 'breadcrumb.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":28,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"37abb34586778aab3e756f69a376ebcd","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs calls 'tag.li' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":27,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2e3b7e1aa564b520085e0f2d7a81d2f0","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":19,"end":28}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"873f16ab54c47808041ee969ed82c031","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs has approx 11 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":18,"end":18}},"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, &error)\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, &error))[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":"8779a76a19d6555ab2b5a16cb4a11d0f","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_calendar_date calls 'day.day' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":59,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"74e56938e329f1fb425ed1193a7443a8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_calendar_date calls 'day.month' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":57,"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":"12747d93e2d9365794bb1ee62f534c5b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_calendar_date calls 'tag.div(class: css_classes)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.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":"996747534e5429755f02320a14f443fe","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_day' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":30,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01dd1c2429b56d44260396d267f12468","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_day.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":30,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"32706b66627d5315d7f6a4a4f749b30d","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_month' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":24,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"275263241ca9b24b901a0e6f4cc4e246","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":27,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"15453347f54bad2ae049f890e0fb51e3","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_year.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":27,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ce87772c56ea5a53eda9be4cc237a6b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'icon('fa-regular', 'arrow-right')' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":24,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"23e6b506029466833e9b2c153e59fc9b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'sanitize text' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":25,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88a7106498736d74eeb5223dbe7758e8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_day' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5667d0671bb1b29cc993ed7fd29688a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_day.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"38020a9f0d16a54befe01c93950f97e7","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_month' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":8,"end":9}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"49dd06664638ff2ea2cebb81fc1c7e63","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.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":"535cc7e7f696d2b7210ec90ece76c328","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_year.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.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":"b83382fc4d2a98ea168dd509acfdca21","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'icon('fa-regular', 'arrow-left')' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":8,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ef373c7ceb43665a62507d418a7e9ccb","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'sanitize text' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":9,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ca8e1f7c3655331c3bb63a5c8a305cf7","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches has boolean parameter 'nested'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":89}},"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":"b90cc985c50b1c4baa78e67e004e05b2","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree_branches has boolean parameter 'nested'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":126,"end":126}},"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":"3ccf731afec90ef2529cca8e8468cc57","type":"issue","check_name":"ControlParameter","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches is controlled by argument 'nested'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":93,"end":93}},"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":"80770cba39a7f6fa62d89c8ba08e0002","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.active' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":98,"end":102}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3e2a6745535fca385b02c63fd5bacd77","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.descendants' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":97,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1f272cea77784f7a5e3adcb9df6615f8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.href' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":99,"end":102}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac2bb4ebad47376320df1c85df664626","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.title' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":99,"end":102}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"814979ba6a1117fb9b1a1d89e85c6393","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents calls 'parent.active' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":68,"end":78}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3f03f9777f995feaf44604d0145c4e8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents calls 'parent.href' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":67,"end":80}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ddba1f855dfad0aa1d685c5e53cd7d22","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents calls 'parent.title' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":67,"end":80}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fda5a4d678b567693e5830294909126e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_root calls 'root_branch.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":47,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d41e2114fac5b061df11a56e9205dfa7","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_widget calls 'tag.span' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":23,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"395056eb2f889f7f2cc5f8035ddf9e3d","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_ids calls 'SecureRandom.hex(10)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":189,"end":190}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2a82026c27cbdd87e9bc6d81edc163b6","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li calls 'branch.descendants' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":177,"end":181}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a29d3c62739bd8b3962f141f3c6c51c","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li calls 'branch.href' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":171,"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":"019d2a38acfa85f06057a1a2e833c46e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li calls 'branch.title' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":172,"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":"07066ff5fe0e6f3ba24e893047d781d8","type":"issue","check_name":"LongParameterList","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches has 5 parameters","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0890e4217a7c949e9c0325283fee20e9","type":"issue","check_name":"LongParameterList","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree_branches has 5 parameters","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":126,"end":126}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0ab9ff287b38c87ef717121134ee245","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_root performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":42,"end":42}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0ab9ff287b38c87ef717121134ee245","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_widget performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2f7a4966d492fa3edef8d97fe3bfa822","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":171,"end":171}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b63f8cfc0ab6eae899df7242b9cdbd6c","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dca60c630d8a26137118590a94ea4416","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":114,"end":114}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d10358a5f2cebfe7d2f73e452c1e1771","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches has approx 14 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"672c49dac440c896eba98d65eba990b7","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents has approx 21 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":54,"end":54}},"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, &error)\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, &error))[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":"79880e78143a49616135c0e1c4ded369","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_widget has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":16,"end":16}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"2dbeadd89f8423bfa94c064816571c98","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":164,"end":164}},"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, &error)\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, &error))[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":"2bb59a9761ca4746e45eab652fe13857","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree_branches has approx 11 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":126,"end":126}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"342ffd165c6c45c3ec4abfbf88c5846a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulPagesHelper#formsite_prepopulate_json calls 'request.params' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_pages_helper.rb","lines":{"begin":57,"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":"67e5861b999acbf20c414cffab5de974","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulPagesHelper#formsite_prepopulate_json calls 'request.params[:course_id]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_pages_helper.rb","lines":{"begin":57,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8f2bf667f2d938c7c9a04e0db5887d34","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulPagesHelper#render_page_part_body performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_pages_helper.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c0b20ee8e3eeb644b56eebbf3a3ee99a","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery has boolean parameter 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":60,"end":60}},"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":"550ab424e71ac3d3ce134c8d73ae747e","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_slideshow_gallery_image_link has boolean parameter 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":54,"end":54}},"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":"8f88da208439b41869c8414418ae0dac","type":"issue","check_name":"ControlParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery is controlled by argument 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":65,"end":65}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9cbfc44e2c979332ac90550c83cf746e","type":"issue","check_name":"ControlParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path is controlled by argument 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.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":"18c3d5f186796012573886672a4814b3","type":"issue","check_name":"DataClump","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper takes parameters ['page', 'part'] to 3 methods","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":15,"end":37}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n> The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d80db47af69f41e7396b6f25a3cd8f75","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'page.image_exhibition?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":44,"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":"6b078bd09c6afce03228d8ea56b3fa22","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'slideshow_image.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":43,"end":44}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"23513087c6863bbdf809f3ce75fa019e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'slideshow_image.image_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":41,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"229dbef42ada07c5a10b5cf7800acba2","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'slideshow_image.title' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":44,"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":"8ce1e4590516c785b80d5e449a9a1c75","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery calls 'card.image' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":66,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"95c6a97ba61c9bcdd9ac1077afbadc74","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery calls 'card.image.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":66,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"407c5094f768c8d2d116b908fb4dcb84","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'page.image_exhibition?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":30,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b18d7aa38fda036147145b4468401f0a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'part.story' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":26,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fe31b3dcc31672a94547267fa302b043","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'record.content' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":27,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"91356d6b585b36f52ff6353f29d5c5a4","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'record.content.image_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":27,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6065fdddaa43bc7378bcf9789495c913","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'record.content.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":30,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9e6593d801803de91f12bb0c6c1f719","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path calls 'request.path' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":83,"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":"bc96acd28ecee82cee19c669e68943f9","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path calls 'request.path.split('/')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":83,"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":"0c954a3896112754ffe334fdd4f49817","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path calls 'request.path.split('/').tap(&:pop)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":83,"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":"58381281cf031c705ea8194f7161b9ae","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_image_current_page calls 'slideshow_gallery_block.slideshow_images' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b326f22ff9eca67f69d848b4027e643e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_image_current_page calls 'slideshow_gallery_block.slideshow_images.in_order' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c234ad4a9f09b8642bb0aa60fb004d9","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":38,"end":41}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a7c75d676fe107d00db8f5c7da0305c7","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":61,"end":61}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3fcb7ebe952d54f4f8d4c7bf0b5a2637","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":24,"end":27}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"33e8b20971aa455545366bf529e38b8e","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_slideshow_gallery_image_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":55,"end":55}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"318871790eefebacde3cef569a80bb8d","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_gallery_image_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bbd2858cf3d45387c59470d62e778f52","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_image_current_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":87,"end":87}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a220e8d9b0e4ba2b5f98e9f1f65defde","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery has approx 11 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":37,"end":37}},"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, &error)\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, &error))[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":"b8390938d73b304ab381cbde42ac3ddd","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":60,"end":60}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"0d7b1df34476d3acd51c92000073bce9","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowImagesHelper#slideshow_image_nav_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_images_helper.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d1fedeeb07cc04933ac4871d0b7306a9","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#filter_title calls 'value.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":23,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5fc4cbb948f94e2adde9ad6e847f0033","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#link_to_lock_filter calls 'search_options[:il]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":99,"end":100}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"32d9f4fdd5ae67a596cb9726a0d23619","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#year_filter_title calls 'Regexp.last_match(1)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":82,"end":82}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"468c0b56a650ea932255906f11d27e8f","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#year_filter_title calls 'Regexp.last_match(2)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":83,"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":"33f5aa741771339ae88b365134b0897f","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#year_filter_title calls 't('items.search.filters.any')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.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":"e0689d9b185f08207403f787026f9b39","type":"issue","check_name":"LongParameterList","description":"FacetsHelper#link_to_lock_filter has 5 parameters","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":97,"end":97}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a02e5a97bf13a1c7b0ed5547d6559e22","type":"issue","check_name":"TooManyStatements","description":"FacetsHelper#filter_title has approx 14 statements","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":10,"end":10}},"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, &error)\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, &error))[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":"b94fc795dd92490209996c1427c34cf0","type":"issue","check_name":"UncommunicativeVariableName","description":"FacetsHelper#link_to_lock_filter has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":98,"end":102}},"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":"9130bcf833dae7249c898fbb3eb55d1d","type":"issue","check_name":"UncommunicativeVariableName","description":"FacetsHelper#link_to_lock_filter has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":102,"end":102}},"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":"85f6f14f0c2c09926b24c67339e9fd6f","type":"issue","check_name":"DuplicateMethodCall","description":"FormsHelper#errors_for calls 'form.object' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":7,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"427368553300443a97135fcdaa8b95da","type":"issue","check_name":"DuplicateMethodCall","description":"FormsHelper#errors_for calls 'form.object.errors' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":7,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3dc5f14d197f26aba419fefd35acfa09","type":"issue","check_name":"DuplicateMethodCall","description":"FormsHelper#errors_for calls 'form.object.errors[field]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":7,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"722ca0bd7fd54dc8905f16b5c86fdfb0","type":"issue","check_name":"UnusedParameters","description":"FormsHelper#inline_error has unused parameter 'attribute'","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":4,"end":4}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be562515b68bbe5eb4996bd02fb4e8c2","type":"issue","check_name":"UnusedParameters","description":"FormsHelper#inline_error has unused parameter 'object'","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":4,"end":4}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"11a1f62a434e6de259fc83201fc05cda","type":"issue","check_name":"UnusedParameters","description":"FormsHelper#inline_error has unused parameter 'options'","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":4,"end":4}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2b3a38b6591e3212263619bafc426af5","type":"issue","check_name":"DuplicateMethodCall","description":"GlobalNavigationHelper#active_sub_nav_css calls 'request.path' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/global_navigation_helper.rb","lines":{"begin":28,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"79b15b5f5494d57f7dce0a295e467697","type":"issue","check_name":"DuplicateMethodCall","description":"ImagesHelper#lazy_image_tag calls 'options[:class]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":26,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d98862d5440ed5dcd944892927c01d6c","type":"issue","check_name":"DuplicateMethodCall","description":"ImagesHelper#unicon calls 'options[:class]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":48,"end":49}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"abe8b861b298dfd529b4cfeee1c9e143","type":"issue","check_name":"DuplicateMethodCall","description":"ImagesHelper#unicon calls 'tag.div(class: wrapper_class)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":60,"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":"8c7eed20df0b839a605905aca4eb3afe","type":"issue","check_name":"NilCheck","description":"ImagesHelper#lazy_image_tag performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":20,"end":20}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d87fd5f937c660526ca87f7bde1604bc","type":"issue","check_name":"TooManyStatements","description":"ImagesHelper#unicon has approx 16 statements","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":41,"end":41}},"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, &error)\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, &error))[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":"15716d15577a285e61e0dc90ffa82b16","type":"issue","check_name":"BooleanParameter","description":"ItemsHelper#reference has boolean parameter 'show_label'","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":190,"end":190}},"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":"a83d56d83ae9356b657d7b16e331028b","type":"issue","check_name":"ControlParameter","description":"ItemsHelper#reference is controlled by argument 'show_label'","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":193,"end":193}},"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":"eac6ab3af3d2c03c29485fe8c162bc7f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#build_thumbnail_src calls 'item.book_cover_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":38,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6332b190fa7a0d3e26fbdff8ec1ca5c9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'attribute(item, :copyright)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":169,"end":178}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d8baa1bc3fdb17f0d1489cc6f35de83","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.copyright' 7 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":164,"end":175}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aa7b3d552886334c03be8cb6d0ded208","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.copyright.first' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":172,"end":175}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e4b5983e6e65f6dd8cb6c435ef2f182e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.copyright.present?' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":164,"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":"aaef05fcd09ea67ecc56943b7bf77534","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.rights_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":170,"end":171}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"802b0a427926c07682a2db1be35150da","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'safe_join([t('items.details.copyright_html'), content])' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":173,"end":176}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a89c551bd459a6213945937432dd7081","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 't('items.details.copyright_html')' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":165,"end":176}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7f01a4a31768e60c0ae38b4ededdb4b2","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 'item.shelf_location' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":207,"end":207}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e22403f418a942ea6d4e598cc36f95ef","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 't('items.details.rights_text.credit_line')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":216,"end":218}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a00dace9e5126c46a16548ed2b03b32","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 'tag.p { t('items.details.rights_text.credit_line') }' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":216,"end":218}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1ba036527bf7775ff9439472c06ad86b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 'tag.p' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":216,"end":218}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f5685ce05db126e570cc7880d59d8252","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line_intro_text calls 'contents << t('items.details.rights_text.credit_line_html')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":231,"end":233}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a42c0c0bfd6948381482e3fda40d415","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line_intro_text calls 't('items.details.rights_text.credit_line_html')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":231,"end":233}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6e368311c94b7866f65902085aac0b8f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#defined_thumbnail_url calls 'item.attachment' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":47,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01e35fbfa5c2c54d41553a097209d5b1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#display_attachment_image calls 'attachment.name' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":333,"end":334}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b31fc4e9aa6dd6f48fdf666fc1135af","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#display_attachment_image calls 'attachment.small_thumbnail_endpoint' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":331,"end":334}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3798223b3259d35deac16b716a352d1b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#display_item_type calls 'item.category' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":68,"end":71}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f0c7533d5c73e60e40b7d275e45ee8a1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#full_image calls 'item.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":255,"end":261}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1c2974314336189d5d87bf8544eae03e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#full_image calls 'item.object_url' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":261,"end":263}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8894f6cd487f360ea278e6f18a10809c","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#link_to_item calls 'args[0]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":389,"end":393}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3d037299263e69650c28297b07c9dce1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#link_to_item calls 'args[1]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":390,"end":394}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be162f2bc333f38dd7966fc19efe1fb3","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#link_to_item calls 'args[2]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":391,"end":395}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bed1ce1014d7a02971fa00cb95abdbc2","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#ndha_button_text calls 'item.ndha_access_level' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":374,"end":374}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dbbbb5f8c3409eafe8883dd093879f56","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#nz_libraries_external_link calls 'item.is_version_of' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":96,"end":98}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c63404fcc7398ca57c603d4b85bac912","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#open_graph_description calls 'item.description' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":294,"end":294}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"45b803ab08d3b9d6de5bc2597c708145","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#open_graph_description calls 'meta_description.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":290,"end":292}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"890b7ff90ce61c1c4c08f439db95ccfb","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#open_graph_image calls 'item.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":300,"end":300}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a72053683f8f2003aa405cf09a2653b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#order_attachment_button calls 'attachment_id(item.id, attachment_dc_identifier)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":347,"end":350}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1c4a064147339c26cbb66e54a23f7cdb","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#order_attachment_button calls 'item.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":347,"end":350}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"900499701cd2049f5b460f4ec942c4a6","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#order_attachment_button calls 't('shop.cart.order_copy')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":350,"end":352}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ea3256556353100d3813a008a9663a9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#placeholder_image_path calls 'item.category' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":81,"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":"4c7bd2bc2300b2628781e82977b72d3b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#purchasing_item calls 'item.orderable?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":145,"end":155}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c624a41289da2a5a02b0236ed30a637","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#reference calls 'item.shelf_location' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":191,"end":194}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b1cda94b070fc6aec8ebcf8e7cab3c25","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#related_items_count calls 'request.url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":245,"end":249}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d95f20ec645c796543eb491f31637f4b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#render_alt_facets? calls 'facet.values' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":366,"end":366}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"87d11f920dbe2c58a0c2f9c53b6387b6","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#thumbnail_endpoint calls 'ENV['THUMBNAIL_SERVER_URL']' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":55,"end":57}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"57643f3128aba7cca8bbdbe6eaaa8b52","type":"issue","check_name":"NilCheck","description":"ItemsHelper#open_graph_description performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":288,"end":288}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"643daffa3d93ce02a7ec63cedc142220","type":"issue","check_name":"NilCheck","description":"ItemsHelper#open_graph_image performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":300,"end":300}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8ec05766572d122e4382380e1ffb32a6","type":"issue","check_name":"NilCheck","description":"ItemsHelper#open_graph_title performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":284,"end":284}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"705c77ee5701b7022ca65a1f33030836","type":"issue","check_name":"TooManyStatements","description":"ItemsHelper#credit_line has approx 18 statements","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":197,"end":197}},"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, &error)\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, &error))[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":"8335e34e888a967c7382cfc5fdaf6556","type":"issue","check_name":"TooManyStatements","description":"ItemsHelper#rights_field has approx 13 statements","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":105,"end":105}},"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, &error)\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, &error))[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":"66720bc189417566aa3f47e4c147f651","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemsHelper#rights_field has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":123,"end":123}},"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":"a70114401e762b6f631b9df69b0eb80a","type":"issue","check_name":"DuplicateMethodCall","description":"LibrariesHelper#charges_row calls 'content_tag(:td)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ce7cb24692af7c91ce036a3bcb6ba28d","type":"issue","check_name":"DuplicateMethodCall","description":"LibrariesHelper#charges_row calls 'international.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":19,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d21f04bb79c7393d6fa3c58f3cbba0b","type":"issue","check_name":"DuplicateMethodCall","description":"LibrariesHelper#charges_row calls 'standard.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":19,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d31d8312f0b7a391991f91ebe183abe7","type":"issue","check_name":"NilCheck","description":"LibrariesHelper#generate_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cddab3221a496b28976cebaede21a315","type":"issue","check_name":"ControlParameter","description":"LinkHelper#update_email_links is controlled by argument 'email'","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":29,"end":29}},"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":"4f9021b41359bc5296000fe86c410445","type":"issue","check_name":"DuplicateMethodCall","description":"LinkHelper#generate_mailto_header calls 'options[header]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":38,"end":38}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f99f576ed9e4708680a06cdfb320a6ee","type":"issue","check_name":"DuplicateMethodCall","description":"LinkHelper#update_email_links calls 'anchor.attributes' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":24,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e58a18a4ad27951986eccca0b982cdee","type":"issue","check_name":"DuplicateMethodCall","description":"LinkHelper#update_email_links calls 'anchor.attributes['href']' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":24,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"398018c02a53ee34cc543cb5b8ec0184","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#thumbnail_tag calls 'ENV['THUMBNAIL_SERVER_URL']' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":11,"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":"64968811815020b07f2ef4aa8adf908a","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#thumbnail_tag calls 'options[:large_size]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":10,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b98e19560d5041fe7424f876ee8b43f9","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#thumbnail_tag calls 'options[:width]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":11,"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":"84f08230b1ff6ad2cae11284599820bf","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#undelivered_order_data_set calls 'order_item.item' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":25,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8330c159fbc751dc0f111e0256fced0c","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#undelivered_order_data_set calls 'order_item.item_id' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":24,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c8c1cab893aba81aba0daf05ffb08b9","type":"issue","check_name":"NilCheck","description":"OrderDeliveriesHelper#undelivered_order_data_set performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"79367caed08441089762925cc253001b","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'download_shop_order_order_item_path(order, order_item)' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":19,"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":"4500b6454e0b05ce98aff307e802cf10","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'link_to(t('shop.orders.available'), download_shop_order_order_item_path(order, order_item), class: button_class)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"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":"3c0704bec0aed96dcf8158a37a3c2a72","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'order_item.price' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":50,"end":57}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cab5e371bb8ba1f987b3ee5442cf11c3","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 't('shop.orders.available')' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"end":59}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"952cb4cc7a30a938ebba8dfaa1e5e7aa","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 't('shop.orders.download')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":40,"end":41}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"decae5814128209297a74d6f207b043a","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 't('shop.orders.retry')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":19,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d7f99515a8e831369deba414dcad731e","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.button(disabled: true, class: button_class) { t('shop.orders.available') }' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":35,"end":59}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"76dc87e9b161acda5279874befc24fdd","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.button(disabled: true, class: button_class)' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":20,"end":59}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4696fcdf71e81274e4c8d7ff12ca9057","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.p' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":18,"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":"ef6e212623801ffa8d82852d3297c3cb","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.small' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":30,"end":65}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0d974ea6371b4fb95440c9b92fc562fa","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.small(class: 'display-block')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":23,"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":"7cedcfe10f816b00c30a57d17c4afff3","type":"issue","check_name":"TooManyStatements","description":"OrdersHelper#order_item_state_column has approx 31 statements","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":8,"end":8}},"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, &error)\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, &error))[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":"774b338ec6dee8582b31d00e5a9fc1ae","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesHelper#places_explanation calls 'search_object.text' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":21,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"952b9a0f4b52017385903464551b787b","type":"issue","check_name":"NilCheck","description":"PlacesHelper#current_places_filters performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dbf81aff152b87b2546ac3486870f527","type":"issue","check_name":"NilCheck","description":"PlacesHelper#places_explanation performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"84c4d66728d5fcba5ab1714cb02923a7","type":"issue","check_name":"TooManyStatements","description":"PlacesHelper#places_explanation has approx 13 statements","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":10,"end":10}},"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, &error)\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, &error))[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":"50b02de70776e07781ba98c84bc962b5","type":"issue","check_name":"UnusedParameters","description":"QuestionsHelper#display_value has unused parameter 'value'","categories":["Complexity"],"location":{"path":"app/helpers/questions_helper.rb","lines":{"begin":9,"end":9}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9431c09a2a9b838d6fb8b522f7da109e","type":"issue","check_name":"DuplicateMethodCall","description":"RecordsHelper#related_topics_results_path calls 'params[:search]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":17,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c81fe9c9133b15c684146f16538957fa","type":"issue","check_name":"DuplicateMethodCall","description":"RecordsHelper#related_topics_results_path calls 'params[:search][:i]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":17,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8c73b253ce2c876d4d7431be204d1ab1","type":"issue","check_name":"DuplicateMethodCall","description":"RecordsHelper#view_status_button calls 'item.object_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":31,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c63e6b941ec32ad652ed97311a187006","type":"issue","check_name":"NilCheck","description":"RecordsHelper#text_to_paragraphs performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"40bac9ac1005a229db5235a14b74e3ce","type":"issue","check_name":"UncommunicativeVariableName","description":"RecordsHelper#text_to_paragraphs has the variable name 't'","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":11,"end":11}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8604edafd2a76a79b9af9d7a6fc17b6a","type":"issue","check_name":"UnusedParameters","description":"RecordsHelper#tab_class has unused parameter 'current_tab'","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":28,"end":28}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a80a8b70dcf507967aa8de63f59aad94","type":"issue","check_name":"UnusedParameters","description":"RecordsHelper#tab_class has unused parameter 'type'","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":28,"end":28}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d52c98c763615c78e66b198e525e9492","type":"issue","check_name":"ControlParameter","description":"Schools::PagesHelper#secondary_nav_active is controlled by argument 'link_url'","categories":["Complexity"],"location":{"path":"app/helpers/schools/pages_helper.rb","lines":{"begin":7,"end":7}},"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":"50776d716cd94299ae83f85a7f2f565d","type":"issue","check_name":"ControlParameter","description":"Schools::TopicsHelper#topic_active_css_class is controlled by argument 'filter'","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":125,"end":125}},"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":"cef1a2dd7c5566828afd0ecd5e4fb783","type":"issue","check_name":"ControlParameter","description":"Schools::TopicsHelper#topic_active_css_class is controlled by argument 'param'","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":125,"end":125}},"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":"8e7873cd27aeff8ee287218968c58c9b","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsHelper#topic_highlight_css_class calls 'topic.tags' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":13,"end":15}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9d168c069b9be191890df56db416fc3e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsHelper#topic_highlight_filter_class calls 'topic.tags' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d5308da85beab66aaa96b52e2a874685","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsHelper#topics_filter_by_type calls 'type.capitalize' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":44,"end":46}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac05798701f6e26d7e7a0b016a441282","type":"issue","check_name":"TooManyStatements","description":"Schools::TopicsHelper#topics_filter_by_area has approx 14 statements","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":60,"end":60}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"e59a5b4e9e62c8c694338244843f2d00","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::TopicsHelper#topic_css_class has the variable name 't'","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":97,"end":97}},"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":"cc2e1cc8d215e6b79443a5b4db073ec5","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_navigation calls 'content.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":141,"end":146}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9a668e3fdbe0658ba82ea16261a422c","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_navigation calls 'tag.span { direction_text }' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":143,"end":147}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2cd4c22996ff4c1d779e39e2b3212c1e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_navigation calls 'tag.span' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":143,"end":147}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3b16c2d244e3d90779e6dd7d259c9a9","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_position calls 'topic.content_ids' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":124,"end":124}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5f25c79e5116759a796d9f1fa4956c5f","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#sort_records_by_area calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":98,"end":98}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e8231b7b87dc9e2debd747215dca3800","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#topic_record_image calls 'content.image_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":51,"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":"a12453063547d58dc1659a675cb6c09b","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#topic_record_image calls 'content.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.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":"9982f26f336e22175d747aec1d9558f6","type":"issue","check_name":"NilCheck","description":"Schools::TopicsRecordHelper#topic_record_image performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":49,"end":49}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ce7bb2e252edbeb7197e5746fe0b7f2","type":"issue","check_name":"TooManyStatements","description":"Schools::TopicsRecordHelper#record_modal_navigation has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":137,"end":137}},"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, &error)\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, &error))[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":"83c132496fe960fa372a87b904fc277a","type":"issue","check_name":"TooManyStatements","description":"Schools::TopicsRecordHelper#topics_filter_by_media_type has approx 13 statements","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":12,"end":12}},"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, &error)\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, &error))[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":"61e8e71d4148beea330e025d4b861907","type":"issue","check_name":"ControlParameter","description":"SearchHelper#show_if is controlled by argument 'boolean'","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":20,"end":20}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"48265f62ffeaca9f2874a83024465ac7","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_explanation calls 'search.page' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":11,"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":"a7bb2071e91da0080f97154f80cab468","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_explanation calls 'search.per_page' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":11,"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":"8ae43c03d3c3ce7ccc9584a30e44d4b7","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_explanation calls 'search.total' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":12,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f778f0909cfdaecacfa0011bec2d2f84","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_path calls 'search_params[:path]' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6c7fc9e5354b17831bca0210217e7754","type":"issue","check_name":"NilCheck","description":"SearchHelper#render_search_filter_facet performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":51,"end":51}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e83d05db3c88477b55bf471a8b5bd140","type":"issue","check_name":"NilCheck","description":"SecureHttpUrlHelper#secure_http_url performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/secure_http_url_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"78c7314024b07762eb87e9b31d9623e5","type":"issue","check_name":"DuplicateMethodCall","description":"SharePageHelper#tweet_page_on_twitter_link calls 'request.url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/share_page_helper.rb","lines":{"begin":18,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5eec567b9a83006684bed9afd81088df","type":"issue","check_name":"BooleanParameter","description":"SlideshowImagesHelper#slideshow_image_prev_next_link has boolean parameter 'remote'","categories":["Complexity"],"location":{"path":"app/helpers/slideshow_images_helper.rb","lines":{"begin":4,"end":4}},"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":"0a1d50f542f313e0cfa1401f5ed603f7","type":"issue","check_name":"NilCheck","description":"SlideshowImagesHelper#slideshow_image_prev_next_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/slideshow_images_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff79c0905baa1f468350ef13137603c6","type":"issue","check_name":"ControlParameter","description":"StoriesHelper#image_exhibition_story_record_nav_link is controlled by argument 'direction'","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":20,"end":20}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4fef128a7316443aae024bda216dc819","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#image_exhibition_image_path_for calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":9,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2e6f681d4d1e1c45e182cbfe6f91a996","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#image_exhibition_story_record_nav_link calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":21,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ae0cd35d2f86fb33c9aee95aaed57d8","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#image_exhibition_story_record_nav_link calls 'record.content.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":21,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b86226938a36e5a2f6f1925350921418","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#story_record_current_page calls 'story.record_ids' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":38,"end":38}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f9c7a1e0ef3968b979a68928c3afee82","type":"issue","check_name":"NilCheck","description":"StoriesHelper#image_exhibition_image_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6c6ba330df52719a9041aa9c19d6ac98","type":"issue","check_name":"NilCheck","description":"StoriesHelper#image_exhibition_story_record_nav_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"52a153edde4c7e471ed03031d09a1e3e","type":"issue","check_name":"NilCheck","description":"StoriesHelper#story_record_current_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"20ad174edcdb511abc0a3ca7771190a7","type":"issue","check_name":"ControlParameter","description":"TermsHelper#term_related_header is controlled by argument 'is_msh'","categories":["Complexity"],"location":{"path":"app/helpers/terms_helper.rb","lines":{"begin":5,"end":5}},"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":"9975c9ed53d71628f80d381d2e75b332","type":"issue","check_name":"UnusedParameters","description":"ViewingsHelper#text_to_html_break has unused parameter 'text'","categories":["Complexity"],"location":{"path":"app/helpers/viewings_helper.rb","lines":{"begin":9,"end":9}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"749ad4eaa260aa81d09e349a0823cd0a","type":"issue","check_name":"UnusedParameters","description":"ViewingsHelper#value_and_break has unused parameter 'value'","categories":["Complexity"],"location":{"path":"app/helpers/viewings_helper.rb","lines":{"begin":7,"end":7}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2af624ac2cc3980ea1304c15e82626ce","type":"issue","check_name":"FeatureEnvy","description":"AdminOrderMailer#image_ordering_item_error_emails refers to 'emails' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.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":"91b6ee5e665d9320fc063a8cfe7d4e95","type":"issue","check_name":"NilCheck","description":"AdminOrderMailer#item_error performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":26,"end":27}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0badd81b005319e301f84c6b47556d18","type":"issue","check_name":"NilCheck","description":"AdminOrderMailer#new_order performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f5b7b23c085b243b3edebaf0871d6ea0","type":"issue","check_name":"NilCheck","description":"AdminOrderMailer#payment_completed performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4a8b36903b81f125daa7598dd1c88d62","type":"issue","check_name":"TooManyInstanceVariables","description":"AdminOrderMailer has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"df752479ebaf6d87f628d10c242e403e","type":"issue","check_name":"UtilityFunction","description":"AdminOrderMailer#image_ordering_emails doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":39,"end":39}},"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":"05cd9a9c571844c510ab6570abbd9c3c","type":"issue","check_name":"NilCheck","description":"EpicAuthorisationMailer#notify_staff performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/epic_authorisation_mailer.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0242096b7482b6d049c1e6cd0274f727","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#cataloguing_in_publication_business calls '@form.attachments' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":15,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e4bb408a601d664f04b39b51c9713d45","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#humanize_attribute calls 'humanize_attribute_value(value)' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":56,"end":58}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ab0f31e58b5454bc2a3e15d5fbce041a","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#humanize_attribute_value calls 'value.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":67,"end":69}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d2831804c2972544909dffc00db84245","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#offer_to_donate_business calls '@form.attachments' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":38,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"91b3142af9e707ce841a8c69312bb731","type":"issue","check_name":"UtilityFunction","description":"FormMailer#humanize_attribute_value doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":62,"end":62}},"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":"0806651ea7938b9cff243230d7b13574","type":"issue","check_name":"UtilityFunction","description":"LegalDepositMailer#boolean_to_yes_no doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/legal_deposit_mailer.rb","lines":{"begin":67,"end":67}},"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":"48541e52d42b646847d12f13aae9aade","type":"issue","check_name":"UtilityFunction","description":"LegalDepositMailer#prettify_digital_access_method doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/legal_deposit_mailer.rb","lines":{"begin":56,"end":56}},"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":"f2d1f6b7cb027fc7ed7da2e47ba077ec","type":"issue","check_name":"NilCheck","description":"ResearchPaymentMailer#notify_staff performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/research_payment_mailer.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f2d1f6b7cb027fc7ed7da2e47ba077ec","type":"issue","check_name":"NilCheck","description":"ResearchPaymentMailer#payee_receipt performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/research_payment_mailer.rb","lines":{"begin":24,"end":24}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b7a47ab8abf0e85f7cc85e0bf9d147e6","type":"issue","check_name":"NilCheck","description":"ResearchPaymentMailer#payment_instructions performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/research_payment_mailer.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f5c1f6b3e90be5c70270d0bae19c4e56","type":"issue","check_name":"ControlParameter","description":"UserOrderMailer#confirmation is controlled by argument 'undelivered_order_items'","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":12,"end":12}},"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":"789e5dfdfc84b5a72208fdcdb0e267ed","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#confirmation performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"672885d6114f0399ef01aa6a0dee968b","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#delivery performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"672885d6114f0399ef01aa6a0dee968b","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#paid performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":30,"end":30}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"672885d6114f0399ef01aa6a0dee968b","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#rejection performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":41,"end":41}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d34ddf748046417a5dd5995c74986c65","type":"issue","check_name":"RepeatedConditional","description":"UserOrderMailer tests 'order_delivery.nil?' at least 3 times","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":19,"end":41}},"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":"83a2c2c198e1462cc807151e129c5465","type":"issue","check_name":"TooManyInstanceVariables","description":"UserOrderMailer has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cde88ffd299c7220aed904d57b143939","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.chat_ends_at' 2 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":35,"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":"d2b62372672875f8dced7b4ed419f5c8","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.created_at' 2 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e49531a728a84cc9bd022ff493912d4","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.created_at.to_time' 2 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e8f8106b839dfbc21e45b127365142a2","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.school' 3 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":37,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cb7d5fdda4af0774576f908a43e2a316","type":"issue","check_name":"NestedIterators","description":"Admin::AnyQuestions::Metric#self.to_csv contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":31,"end":31}},"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 << 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":"196617190ac6af321c54eea0e410b765","type":"issue","check_name":"NilCheck","description":"Admin::AnyQuestions::Metric#self.to_csv performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":35,"end":35}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"12abbae01c4df53ece8e3c8e7ace8553","type":"issue","check_name":"DuplicateMethodCall","description":"AdvancedSearch#options calls 'collection.to_sym' 3 times","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":60,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6d5cb27bebd593e4e1492010c9f74a38","type":"issue","check_name":"DuplicateMethodCall","description":"AdvancedSearch#options calls 'hash[:i]' 4 times","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":52,"end":65}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09cff45c99f70c135407100bb8842edc","type":"issue","check_name":"DuplicateMethodCall","description":"AdvancedSearch#options calls 'send(collection.to_sym)' 2 times","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":60,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6239a2ca43ef984e8aca61d5ea9e5efb","type":"issue","check_name":"NilCheck","description":"AdvancedSearch#year performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":71,"end":71}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dba00e41a9076f0a71c12b841c942243","type":"issue","check_name":"FeatureEnvy","description":"Attachment#initialize refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/attachment.rb","lines":{"begin":11,"end":14}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0f538b77e7b22e009ec8b68a3f2d9800","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::AtlFacet#build_facets calls 'true_facet_value(free_facet)' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":14,"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":"2edd52bffad01a723b56c62bc9c63c05","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::AtlFacet#build_facets calls 'true_facet_value(purchasable_facet)' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":15,"end":15}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4179d108ac1cbd00d7037ae65cdaceee","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::AtlFacet#true_facet_value calls 'facet.values' 3 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a726caa64f42f3874ae5945bb8c80fcf","type":"issue","check_name":"UtilityFunction","description":"Builders::Search::AtlFacet#true_facet_value doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":23,"end":23}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a53d9a109be58b8a1e011082b65d3d8f","type":"issue","check_name":"Attribute","description":"Builders::Search::Base#facets is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/base.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"12c28fa6fa8b7aa462e2afc166ee41d7","type":"issue","check_name":"Attribute","description":"Builders::Search::Base#search is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/base.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3fc21a1315adbf5b4462f1843ec2a2de","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'facet.name' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6e393ad9a697fc5aad46a4e8c5a14507","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'facets.find' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"242c8b534cdc3cd945ef40d55bd48ada","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'facets.reject!' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":11,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"017e338ed9ce94747e0a304ad6040b04","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'search.primary_collection' 3 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":10,"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":"0a48ca50b9f2bf5ef50a21a4b94764d5","type":"issue","check_name":"FeatureEnvy","description":"Builders::Search::CollectionFacet#build_facets refers to 'facet' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":16}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2a434f4cebe9848d153abdda1e5116ce","type":"issue","check_name":"FeatureEnvy","description":"Builders::Search::CollectionFacet#build_facets refers to 'facets' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":16}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a3c9cb98b26a5e27136c5b317e471c7","type":"issue","check_name":"TooManyStatements","description":"Builders::Search::CollectionFacet#build_facets has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":6,"end":6}},"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, &error)\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, &error))[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":"dfc746c5ce12d828ed3b303a3d5fe435","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::CollectionFacet#build_facets has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":13,"end":13}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bcd21cdee82a4fa886bf5dfc81cb3453","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facet.name == 'year'' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":12,"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":"7ba8bb27a71500763a5cfbad9e4f88b8","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facet.name' 7 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":10,"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":"6b994de18f56bcebe2a257eb5d09b0cc","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facets.find { |facet| facet.name == 'year' }' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":12,"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":"5c41f25f4b5d734c3ace7ee25a8dacfd","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facets.find' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":10,"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":"313c2c381e07eb0ed1ee51f0c4e317bf","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facets.reject!' 3 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":16,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4b1cb8e8a36430f3b86445bacf25ff36","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'k.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":24,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa6cb28a5a34fc4549756289efea9618","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.century' 7 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2325e53d97c73f7c024405176b0034cd","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.century.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dd0b77690ff159b38ecf49d6cb5a59a0","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.decade' 6 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e87ea4780c56a64a8dac2ebaab975462","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.decade.blank?' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4aa54b9b986a17763f8cb7ff435e7034","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.decade.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":39,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c6c6c073253e843461f662c2fafa5710","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.year' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1cc1f17b04fb8aeec227f04f0e9d527a","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.year.blank?' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"99688fcecebd7a7bb6de535a9b6a0439","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'year_facet.values' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":33,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"56919e98847f0b5cef2b2fdc20db25b6","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'year_facet.values.select!' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":33,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9b19d62fe73e2c2a1b1e425153198882","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'facet.values' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":55,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a01ba092e2eb3b66922b7ec9f87255a2","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'facet.values.sort_by { |k, _v| k }' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":66,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"408256a5e595beb9ca70f6456fa0599f","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'facet.values.sort_by' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":66,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4f683d9c437d8cef708b634815ae048a","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'k.to_i' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":58,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b0ee994f97009ba4025e8a5b77c79fef","type":"issue","check_name":"MissingSafeMethod","description":"Builders::Search::DateFacet has missing safe method 'sanitize_current_facet!'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":50,"end":50}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"da4a40b0a874a71df0153ea206efaa7d","type":"issue","check_name":"NilCheck","description":"Builders::Search::DateFacet#sanitize_current_facet! performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":51,"end":51}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d631381a79d4559d74efebb77b793fd","type":"issue","check_name":"TooManyStatements","description":"Builders::Search::DateFacet#build_facets has approx 28 statements","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"afe7d458314fa2a685b4653a0c7cf2da","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::DateFacet#build_facets has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":24,"end":39}},"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":"b2890d11d7ac2037cab93e582f9eba1c","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::DateFacet#sanitize_current_facet! has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":53,"end":53}},"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":"3c0d9e7d2fe0fda3efb2f1db3399e3c3","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::DateFacet#sanitize_current_facet! has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":57,"end":68}},"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":"9ad4e8ac2315626d3514e21f2e3aa1e6","type":"issue","check_name":"UtilityFunction","description":"Builders::Search::DateFacet#sanitize_current_facet! doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":50,"end":50}},"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":"1a007b73a808f6b8e32df1827112c583","type":"issue","check_name":"Attribute","description":"Builders::Search::Facet#facets is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/facet.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"41987d888c49c6aab6be2c8e6e248349","type":"issue","check_name":"Attribute","description":"Builders::Search::Facet#filters is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/facet.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"373c5eaa003038a983e359045c8e2ab8","type":"issue","check_name":"Attribute","description":"Builders::Search::Facet#search is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/facet.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b6ec24573b299721c72005c90c8bb4b3","type":"issue","check_name":"Attribute","description":"Builders::Search::ParentFacet#count is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/parent_facet.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4f9f9185d2ee0ca8d344dcdf4595e346","type":"issue","check_name":"Attribute","description":"Builders::Search::ParentFacet#name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/parent_facet.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":"05443cac9b0a72123b55978fce7c81ae","type":"issue","check_name":"Attribute","description":"Builders::Search::ParentFacet#value is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/parent_facet.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03e5e608b0557e74c220a9d2a09ff589","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::TagFacet#build_facets calls 'search.total' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":22,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e0e1fdaf8c054de0dd5f30d68747d51f","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::TagFacet#build_facets calls 'tag_facet.values' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":16,"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":"0b31b81d3d3ee5fb599f8755091c91ad","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::TagFacet#build_facets calls 'tag_facet.values[TAG_ONLINE_ITEM]' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cee839b2fc1213c12da0848e2f965af8","type":"issue","check_name":"FeatureEnvy","description":"Builders::Search::TagFacet#build_facets refers to 'tag_facet' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":13,"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":"37c8a263e2f90a88cbd51fbf2172cd9d","type":"issue","check_name":"NilCheck","description":"Builders::Search::TagFacet#build_facets performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"391e6d7029e7409e1cfae9473d91dadb","type":"issue","check_name":"TooManyStatements","description":"Builders::Search::TagFacet#build_facets has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"7aeaa77936b2842a3d7f9d1d3ea655df","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::TagFacet#build_facets has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":16,"end":16}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c9c94ba9b21b5b6b942437c2dc9314ab","type":"issue","check_name":"NilCheck","description":"Consyncful::DirectParentEntry#set_direct_child_entries performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/direct_parent_entry.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ebd1a503a9024b377e77ceb3d2fc45bb","type":"issue","check_name":"BooleanParameter","description":"Consyncful::Eventable#events_for has boolean parameter 'include_past'","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":73,"end":73}},"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":"a5e5ace5095aa93c3639c2a7fa823181","type":"issue","check_name":"ControlParameter","description":"Consyncful::Eventable#events_for is controlled by argument 'include_past'","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":85,"end":85}},"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":"5765e73144b92a2debf6699298612346","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#date_range calls 'start_datetime.to_formatted_s(date_format)' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":43,"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":"2fa40d73e639e828aa8a9508e8cb16fa","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#date_time_in_utc calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":100,"end":100}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8051667a436d9cc116de1995b461dd08","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#events_for calls 'date.month' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":80,"end":82}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cd51f6d1d9bc9504239214139f378e2b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#events_for calls 'date.year' 3 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":78,"end":82}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"24578fb78bc2f8309f4fc6fba7a3d074","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Eventable#events_for refers to 'date' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":74,"end":82}},"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":"b40218acb936d65c79d0c72c0acd7524","type":"issue","check_name":"NilCheck","description":"Consyncful::Eventable#end_datetime performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":34,"end":34}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1a9d4c0c86a13c11e2be4e576c66a651","type":"issue","check_name":"NilCheck","description":"Consyncful::Eventable#events_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":74,"end":74}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"20b21bf2e2fc594e45402d683d266d93","type":"issue","check_name":"NilCheck","description":"Consyncful::Eventable#start_datetime performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"40b6d04ea87c1c7fabe895b2aae134ae","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Eventable#date_time_in_utc doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":98,"end":98}},"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":"d08c7594b72ffb2233f76d2cd0cf565f","type":"issue","check_name":"ManualDispatch","description":"Consyncful::Imageable#image_alt_text manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/imageable.rb","lines":{"begin":16,"end":16}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9cab12e7c20915af47f4e77671bad51","type":"issue","check_name":"Attribute","description":"Items::Attachable#attachment_identifier is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c8f738dd39b2ac4d9f3851bb3b0b3d69","type":"issue","check_name":"DuplicateMethodCall","description":"Items::Attachable::ClassMethods#find_items calls 'id.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a05e37d3578825e6b61797cdbfcf4d2f","type":"issue","check_name":"DuplicateMethodCall","description":"Items::Attachable::ClassMethods#find_items calls 'ids.map' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":20,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e1eff7fdb1b47628d1181fa29cf920d4","type":"issue","check_name":"DuplicateMethodCall","description":"Items::Attachable::ClassMethods#find_items calls 'item_ids.is_a?(Array)' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":19,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"373233c3df0762c86e032cd5a9838eeb","type":"issue","check_name":"TooManyStatements","description":"Items::Attachable::ClassMethods#find_items has approx 17 statements","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":18,"end":18}},"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, &error)\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, &error))[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":"59e799ee14ef9616cae2341a1828d863","type":"issue","check_name":"UncommunicativeVariableName","description":"Items::Attachable#attachment has the variable name 'a'","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":53,"end":53}},"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":"ecd6e098866ce666a45c426b931a3740","type":"issue","check_name":"UncommunicativeVariableName","description":"Items::Attachable::ClassMethods#find_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":20,"end":21}},"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":"9bce3429859052de950d1dc48a01f4c1","type":"issue","check_name":"FeatureEnvy","description":"Schools::TagCategory#multiple_category refers to 'tag' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/concerns/schools/tag_category.rb","lines":{"begin":32,"end":33}},"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":"7ad0f32293390b342f60851d98fe173c","type":"issue","check_name":"NilCheck","description":"Consyncful::Accordion#display_title? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/accordion.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6ce6140860fb7230284b6a2747355f56","type":"issue","check_name":"NilCheck","description":"Consyncful::BlogCategory#name_and_slug? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_category.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ecbd37e3cdea772bdbf0c1c0421e418","type":"issue","check_name":"MissingSafeMethod","description":"Consyncful::BlogComment has missing safe method 'approve!'","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_comment.rb","lines":{"begin":36,"end":36}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"c99a2145a18536f62eacb5a52add4186","type":"issue","check_name":"MissingSafeMethod","description":"Consyncful::BlogComment has missing safe method 'reject!'","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_comment.rb","lines":{"begin":40,"end":40}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"e5c01a3f8eed56d7b49cba6c05e93a2e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::BlogPage#episode_file calls 'content.body' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_page.rb","lines":{"begin":81,"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":"8bb5c844b8564504ac98528ecc31181a","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::BlogPage#episode_file refers to 'content' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_page.rb","lines":{"begin":81,"end":83}},"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":"1d9e3dc67c0df18f02accded2fff6e84","type":"issue","check_name":"NilCheck","description":"Consyncful::BlogPage#episode_file performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_page.rb","lines":{"begin":87,"end":87}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"497fc19932908484cdc5e0fd76662c1a","type":"issue","check_name":"NilCheck","description":"Consyncful::BlogTag#name_and_slug? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_tag.rb","lines":{"begin":20,"end":20}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d49f112c472e5fb43e38f3a169b02828","type":"issue","check_name":"NilCheck","description":"Consyncful::ColumnBlock#display_title? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/column_block.rb","lines":{"begin":24,"end":24}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ea392eebf6c4cfdc6f7318904eb94a0a","type":"issue","check_name":"NilCheck","description":"Consyncful::ContentBlock#display_rich_text? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/content_block.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d136cc9ff1195b27c9ef7a5c598a9ca6","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Event#recording_type calls 'recordings.first' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":78,"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":"84e7e5987465a8200f42f57c5b409547","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Event#structured_data calls 'alert.downcase' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":167,"end":167}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"963e3929595f3c5ff3adc11e86fcf806","type":"issue","check_name":"NestedIterators","description":"Consyncful::Event#recording_type contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":80,"end":80}},"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 << 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":"9846d66b58d83050d7c3d4397dcac9da","type":"issue","check_name":"TooManyMethods","description":"Consyncful::Event has at least 18 methods","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.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":"88fa457178a7567befd9cd6ec841e1ef","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Event#recording_type has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":64,"end":64}},"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, &error)\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, &error))[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":"8d6a136bfd5ca830a0efdff57775021b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventCard#events calls 'Consyncful::Event.all_upcoming' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_card.rb","lines":{"begin":26,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bfd90fd2f34533fda3da363de4997b8d","type":"issue","check_name":"BooleanParameter","description":"Consyncful::EventGallery#event_cards has boolean parameter 'use_limit'","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":41,"end":41}},"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":"87247bf835c3331cf448ab36891da95d","type":"issue","check_name":"ControlParameter","description":"Consyncful::EventGallery#event_cards is controlled by argument 'use_limit'","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":50,"end":50}},"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":"2a15dad9799406cbb43b0466c07d0a91","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#event_cards calls 'event.event_series_id' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"648d5e2eb1526389ff933e8e2f29e5b4","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#event_cards calls 'event_filter.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":46,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c5fb60d5219b37e509c0174e1508fdf4","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#event_cards calls 'events.select' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e7858bcb597b624a19d7073eb20f1d2f","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#serializable_hash calls 'event_cards.map(&:serializable_hash)' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":32,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"73db54ddad7a74ec0a9d9b6496da7c18","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventGallery#event_cards refers to 'events' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":50}},"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":"90ccb74b280e243462498d8a5c822985","type":"issue","check_name":"NilCheck","description":"Consyncful::EventGallery#event_cards performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":45}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e6458352947fa7c3ae3fb7e13240c0d","type":"issue","check_name":"TooManyStatements","description":"Consyncful::EventGallery#event_cards has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":41,"end":41}},"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, &error)\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, &error))[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":"3c9d567760218e9d161fd1d44e46bdfa","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#image calls 'event[:image]' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":25,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ed0b68217276a0a497199f59de448d5","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#self.series_from_params calls 'params[:day]' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":49,"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":"ff7913a8dcbe8637888bab0aa2fe5e6f","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#self.series_from_params calls 'params[:day].nil?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":51,"end":53}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b8a7011d734c562e5e21526a5187cb4a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#self.series_from_params calls 'params[:month]' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":51,"end":53}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"715b7d99c04e1177a6bd487161ed5a0e","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#image refers to 'event' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":25,"end":25}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"37914176cc45f9d22e05ec463836a034","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#image refers to 'images' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":28,"end":28}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"051804a82ab020b396745ce343d4da9b","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#sorted_events refers to 'event_a' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":45,"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":"102a7f0170f9e85e27f5aa3328ee7b07","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#sorted_events refers to 'event_b' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":45,"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":"def9057b98afdaf3a3fed64946836c84","type":"issue","check_name":"NilCheck","description":"Consyncful::EventSeries#self.series_from_params performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":51,"end":53}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"158b1697b4751e8e571e84a0a5ca2466","type":"issue","check_name":"NilCheck","description":"Consyncful::FullScreenImage#display_fullscreen_caption? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/full_screen_image.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9b5e34eed9341b8eb0e43a605edff9d","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::HomePageColumnBlock#top_level_column? calls 'home_page_content_elements.first' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/home_page_column_block.rb","lines":{"begin":29,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0523dd44e0fd6e187db4ac005ac05063","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::InPageNavigation#parts_with_subheadings calls 'model.content_elements' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":42,"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":"ff493cae10c3e8f9d3799363709ae156","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::InPageNavigation#anchor_links refers to 'part' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":19,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7b320431165c5d32f665fac2f7876a11","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::InPageNavigation#parts_with_subheadings refers to 'model' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":34,"end":44}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"26decd1aa15ae1a41b3a033b4b22d915","type":"issue","check_name":"ManualDispatch","description":"Consyncful::InPageNavigation#anchor_links manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":22,"end":22}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"38ed798c66d08df9f768e7881ff5002f","type":"issue","check_name":"ManualDispatch","description":"Consyncful::InPageNavigation#h2s_in manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":53,"end":53}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f721b7d962038b27dd04e1e9f95b9941","type":"issue","check_name":"ManualDispatch","description":"Consyncful::InPageNavigation#parts_with_subheadings manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":42,"end":42}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"171b3526f5379e9f6401b2742a92df4d","type":"issue","check_name":"NestedIterators","description":"Consyncful::InPageNavigation#parts_with_subheadings contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":44,"end":44}},"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 << 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":"2141c73860371ef3dc178eff68d7dc1e","type":"issue","check_name":"TooManyStatements","description":"Consyncful::InPageNavigation#h2s_in has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":52,"end":52}},"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, &error)\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, &error))[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":"3ad0d2956afbce32d8e0ee5751f1a930","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::InPageNavigation#h2s_in has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":63,"end":63}},"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":"94d9fd0e59118bd7a52cbb66e365d3e2","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::InPageNavigation#h2s_in has the variable name 'h2'","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":72,"end":72}},"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":"2a637317cdd7b67f5eea83260ea8767b","type":"issue","check_name":"UtilityFunction","description":"Consyncful::InPageNavigation#h2s_in doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":52,"end":52}},"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":"d84e90154a3aeecc1ef538a6372ca862","type":"issue","check_name":"UtilityFunction","description":"Consyncful::InPageNavigation#mixed_locale_inline_text doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":78,"end":78}},"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":"a9874ec63c8278449e9c9693c9881f81","type":"issue","check_name":"NilCheck","description":"Consyncful::MediaAsset#url performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/media_asset.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6be557f95336414caf2b3d648f9f6248","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#blog_categories is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"643690104f6ccafddbb4dbde57b8be89","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#branches is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b8cbdbd6a60dc5cc518cc0f101f762f","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#current_blog_category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9ab4b468d829dba5d155bc2f7a2b0c78","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#current_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a810f8750fb8df7d135dbee20ecaa057","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"313a4f06d99724d2e3fae3d52b4cf23a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::BlogTree#initialize calls 'category.slug' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":23,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e1536e4ab5c09e8b3a559fd3e3740c2","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::BlogTree has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff993a5c766f6beb14c7d86833f45148","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#crumbs is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.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":"0b6e0c720375692bbd9877a2f61c66ea","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#prefix_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff579b54b52768a1fda339d0e040153e","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"00a5f0a98e1b4e74ef3f90ec60f92489","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#root_page_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"031152791640ae5baf1ed5c3ba44556f","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#root_page_title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5cb8fc419a6dad0dd964f19d79b2cf0a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Breadcrumb#build_crumbs calls 'page.nil?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":54,"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":"42534998db11b3ad0dd6aa92d3d9e54a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Breadcrumb#build_crumbs calls 'slug.downcase' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.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":"a5b219cb99d80ea55af1aa72526a6ad7","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::Breadcrumb#build_crumbs performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":54,"end":56}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b35261d524da2e2182eb9e5927b95d91","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::Breadcrumb#initialize performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0e3166bfe4b1bede01f136d4f95f1934","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::Breadcrumb has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6c2bd444bef6c519f39826896e1a448e","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Navigation::Breadcrumb#build_crumbs has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":50,"end":50}},"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, &error)\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, &error))[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":"c43eacc9b8a586b2ba42948de64ef3ec","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#branches is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e5c80660c4e4da090b722fc59c72128","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#current_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"de52dff9c85ef945fbdb57e4a397cc9f","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#request is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"02881aa70833e7bad1fca3b2697cda67","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#request_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c6ed1c8d39a153fbcca59ce17df9f690","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8eac77a81f5b98b82e78e014e8dc1e3f","type":"issue","check_name":"BooleanParameter","description":"Consyncful::Navigation::RecordedEventsTree#initialize has boolean parameter 'include_root'","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":14,"end":14}},"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":"b81b0a4d200ded48b4329a66128f1782","type":"issue","check_name":"ControlParameter","description":"Consyncful::Navigation::RecordedEventsTree#initialize is controlled by argument 'include_root'","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":19,"end":19}},"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":"ef44d61929519fac45a895d6febbae30","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::RecordedEventsTree#build_branches calls 'event.slug' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":54,"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":"2e37978440ae045fce7c21d32e68005d","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Navigation::RecordedEventsTree#upcoming_event? refers to 'event' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":70,"end":72}},"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":"d131741073149b07561f07117f20a92b","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::RecordedEventsTree#upcoming_event? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":70,"end":70}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5b0d6be4dbb4b22dfbd3c0c37b32978a","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::RecordedEventsTree has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"52ffa30406c2e0276d545b2d601a665a","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#branches is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2abec2ee4a3a4fa826adc911ada47bfa","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#current_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27ec2fb865ee07865d01dee4c264d801","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#current_slugs is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d58e933d4a663d73b56a63e98067d937","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#options is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":20,"end":20}},"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":"255e3ce52043233aab35e49f038c69ba","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#prefix_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":18,"end":18}},"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":"0824997a09437160c1b0561bbbb5f255","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7081fcfb7127dcea29d6bf0cf6249153","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#root_page is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0613ba6038e84c63b37fc23197b42230","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#root_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"155202c47f8b0853928f0f2a58afd1dc","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Tree#build_branch calls 'descendant.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":86,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bb818ffff293dd18347106bbf3f1903a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Tree#build_branches calls 'descendant.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":70,"end":73}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01475e94e307a46d14bec93365ae1b72","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Navigation::Tree#build_branch refers to 'descendant' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":85,"end":87}},"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":"63816c159980d1d8d0f8b05d7f3c49d2","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::Tree#build_branches performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":63,"end":63}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"55883e755a406d0288a7a4deb87deeec","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::Tree has at least 8 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5f5c15cde652ce9707e004c690bdb8ff","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Navigation::Tree#build_branches has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":62,"end":62}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"e23fa8249677e2900adb72e9f5166097","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::Tree#build_href doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":91,"end":91}},"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":"7196184725302f70ae68847d706f41e6","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::Tree#prefix_path_and_href doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":97,"end":97}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"980429df5af7eaab4980f8bf220e6a29","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#build_branches calls 'user_policy.admin?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":33,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6165904e662029c241ea9373a2435151","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#build_branches calls 'user_policy.epic_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":36,"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":"02f55acbcc704e2cd94faa2a173db6cd","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#build_branches calls 'user_policy.research_payments_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":37,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09cc0f2f11b4aa1d1bfc37d4d3789b06","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#plug_branches calls 'Plug::Engine.routes' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":264,"end":270}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c6bf2e51054daadd0215b94d76c16ba3","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#plug_branches calls 'Plug::Engine.routes.url_helpers' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":264,"end":270}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5d09f00904ab8a7ca58ae883ae22b4c4","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::UserTree has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9e71f0bfe5a593668b7eef7b03fa5f6f","type":"issue","check_name":"TooManyMethods","description":"Consyncful::Navigation::UserTree has at least 20 methods","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ca7237180bc4df27063ef2b43b2e0b9","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Navigation::UserTree#build_branches has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":29,"end":29}},"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, &error)\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, &error))[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":"843e5c155f90bacd2d03047c133b9b6b","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::UserTree#ls_sso_branch doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":74,"end":74}},"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":"b0d19c2e60548505efb14889fd8c754d","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::UserTree#plug_branches doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":254,"end":254}},"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":"5735ee4cf626035baff1b8f3310c1c88","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Page#schools_main_page calls 'request_paths.first' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":100,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2b19aff2deb1f2873cf2f061264b9e37","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Page#excludes_form? refers to 'child' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":147,"end":147}},"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":"cc73ccc8b9317157a101cd01d7124178","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Page#schools_main_page refers to 'request_paths' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":100,"end":105}},"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":"65f75110bf865b4c13f7b439ce0e77c3","type":"issue","check_name":"TooManyMethods","description":"Consyncful::Page has at least 25 methods","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.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":"48e2a0d1516dddd3db2a706bb1b84496","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::Page#formsite_form_children has the variable name 'c'","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":152,"end":152}},"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":"ceb6b58b52ec39b7dbd2983a5b387de4","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::Page#summary_blocks has the variable name 'c'","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":113,"end":113}},"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":"410808d0dbe33071ec0ca92ca86d9fba","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Page#schools_main_sub_pages? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":87,"end":87}},"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":"2f3fd5872c3a9cba77573387b37a158e","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::RauemiAIpurangi::WhareTupuna#all_pou refers to 'pou_duality' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/rauemi_a_ipurangi/whare_tupuna.rb","lines":{"begin":24,"end":24}},"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":"cdf003211aaa26d9fcd918e70b7f54cc","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::RelatedContentCard#page has the variable name 'b'","categories":["Complexity"],"location":{"path":"app/models/consyncful/related_content_card.rb","lines":{"begin":19,"end":19}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"16837c6ea9c9f80baa223047ee62f2c3","type":"issue","check_name":"ControlParameter","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image is controlled by argument 'direction'","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":47,"end":47}},"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":"34377c9fd7d0f3f8c86be91d6b2a66f7","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image calls 'slideshow_image.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":48,"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":"1d51389f4515ff0eecfc9d486eb5cbd0","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image calls 'slideshow_images.in_order' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":45,"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":"b6de97a7c83496a11ea856dc6c81e8e3","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image calls 'slideshow_images_ids.index(slideshow_image.id)' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":48,"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":"bef66997dd2a39295a60cfb006d58a9a","type":"issue","check_name":"NilCheck","description":"Consyncful::SlideshowGalleryBlock#display_title? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9ca3a38885ab8df333ef234d36631384","type":"issue","check_name":"NilCheck","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":43,"end":43}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1a3310121f699cef219e5ac95139d3f6","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::SlideshowGalleryBlock#story has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":31,"end":31}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e140a781e43ccf1876bb543a518d0ede","type":"issue","check_name":"UtilityFunction","description":"Consyncful::SlideshowGalleryBlock#sort_story_by_position doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":61,"end":61}},"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":"2133a6cc5e7662df5c5d6cd581bc5639","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowImage#self.find_image_data_by_path calls 'path.split(%r{/})' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_image.rb","lines":{"begin":26,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0360f43df7adf04d8ec123a64e07df17","type":"issue","check_name":"NilCheck","description":"Consyncful::SlideshowImage#self.find_image_data_by_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_image.rb","lines":{"begin":23,"end":34}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"21d50899f6ea51015a25aff55e0b732e","type":"issue","check_name":"UncommunicativeVariableName","description":"DigitalDonation#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/digital_donation.rb","lines":{"begin":60,"end":60}},"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":"c6f7726b2215c6cb47fe8c753e7aa4f5","type":"issue","check_name":"UncommunicativeVariableName","description":"DigitalDonation#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/digital_donation.rb","lines":{"begin":60,"end":60}},"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":"0f1e82166acf711dc33b4ff45dc964fc","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#email is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8a4a1f34a16ea86ff8ce0067b01d5e96","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#first_name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5c8a833bbcf8b66c2f10c0e233d8ea11","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#job_title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3dd9050f96b5d949e7ff900abb910a00","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#last_name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f2e00abdf2a2581e7d50bc9bcb35002f","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#organisation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da76c9c3cfa6fb2b72e4c75015ab8dd5","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#type_of_library is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f014d2909414a755d9360b0e8ffe150d","type":"issue","check_name":"ManualDispatch","description":"Epic::Authorisation#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":26,"end":26}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"02eaa44d667103b401e91e906f369e3c","type":"issue","check_name":"MissingSafeMethod","description":"Form::CatalogueRegistration has missing safe method 'register_alma_user!'","categories":["Complexity"],"location":{"path":"app/models/form/catalogue_registration.rb","lines":{"begin":28,"end":28}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"b5fffeb33161773fa5bd4d59885372f1","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#date is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5b82e58c08eb53e186f478a1e025ed02","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#email_address is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e356bf1bdd6418eeff3aef95f34ac98","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#email_address_confirmation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c3c71fb5da00c59a8cdf901151545606","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dab9649513c432f567d9cad4aad6c378","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#phone_number is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac359a5f981538f16fc3c0b558a99c7a","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#question is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d143f7bc4bb4a7523ffadcd6127d8502","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#town_or_city is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"25863056ee250df736e883854d9ab621","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#content is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b574075e2c805337d8faaae36502de67","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa5b456ce1ca9a2dd22ba445d9bd627f","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#images is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8c9aaa11ff074401b3b39a872b73ac0a","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bad7433c86c81105b7af496042d7ac5c","type":"issue","check_name":"DuplicateMethodCall","description":"ImageExhibitionContent#images_from_source calls 'record.content' 4 times","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":32,"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":"b9c2b13c3049b87eac1fefa92fe1f898","type":"issue","check_name":"DuplicateMethodCall","description":"ImageExhibitionContent#images_from_source calls 'slideshow_image.title' 2 times","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":45,"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":"933048a0295505ae97eda5ec1c85da14","type":"issue","check_name":"FeatureEnvy","description":"ImageExhibitionContent#images_from_source refers to 'slideshow_image' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":43,"end":50}},"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":"7a5a7d41038c3790b98ad4f17f466689","type":"issue","check_name":"ManualDispatch","description":"ImageExhibitionContent#images_from_source manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":50,"end":50}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6f6c68e2422985018ea5ea5326b06e3c","type":"issue","check_name":"NilCheck","description":"ImageExhibitionContent#initialize performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"221ff045541d9e01a7420ddc866e364f","type":"issue","check_name":"Attribute","description":"Item#book_cover_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"754fa6b328a987339f56aed88acea36b","type":"issue","check_name":"BooleanParameter","description":"Item#respond_to_missing? has boolean parameter 'include_private'","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":286,"end":286}},"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":"057430ff477584983992c4ff4653345e","type":"issue","check_name":"DuplicateMethodCall","description":"Item#build_authorities calls '@attributes[:authorities]' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":170,"end":171}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1d772ba373b4fcf3110e1f7373a11f43","type":"issue","check_name":"DuplicateMethodCall","description":"Item#heading? calls 'params[:path]' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.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":"7091d336c6497d31f3aaad3e38307653","type":"issue","check_name":"DuplicateMethodCall","description":"Item#method_missing calls 'Regexp.last_match(1)' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":277,"end":278}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9582cb391be92e760072ad58c2345a36","type":"issue","check_name":"DuplicateMethodCall","description":"Item#method_missing calls 'method_name.to_s' 3 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":277,"end":279}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"65339d4002335a8e2d15d098eb25d3af","type":"issue","check_name":"DuplicateMethodCall","description":"Item#ndha_access_level calls 'attachment.ndha_rights' 3 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":62,"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":"26d8344ca482b4faa51ac2ffcb9450b2","type":"issue","check_name":"DuplicateMethodCall","description":"Item#related_items_link calls 'authority_field.values' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":48,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"342050af90176e00a8adc8b8afeccaaa","type":"issue","check_name":"DuplicateMethodCall","description":"Item#respond_to_missing? calls 'method_name.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":287,"end":288}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aab4b2db6441ff362f7105972f9c6367","type":"issue","check_name":"FeatureEnvy","description":"Item#attachments refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":159,"end":159}},"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":"fe35c39e59ca949380884eecbd5d75b5","type":"issue","check_name":"FeatureEnvy","description":"Item#group? refers to 'categories' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":21,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9861077a72904b8ccaf7a6bf45185e9a","type":"issue","check_name":"FeatureEnvy","description":"Item#heading? refers to 'params' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.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":"2bc8321f2f88df3b3be6e426695bfaab","type":"issue","check_name":"FeatureEnvy","description":"Item#ndha_access_level refers to 'attachment' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":62,"end":62}},"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":"67e6ecac79e6dbff93b932a572384a46","type":"issue","check_name":"FeatureEnvy","description":"Item#relation_url refers to 'relation_values' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":97,"end":100}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fbfc36d7a9379d8230a1d90b1018dbb3","type":"issue","check_name":"FeatureEnvy","description":"Item#tapuhi_id refers to 'tap_id' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":253,"end":255}},"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":"7f9c0efa82193ff41c353c9fd9c06bfe","type":"issue","check_name":"NilCheck","description":"Item#attachments performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":159,"end":159}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e784e36de5593c67bda79dac0daf58e4","type":"issue","check_name":"NilCheck","description":"Item#ndha_access_level performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":62,"end":62}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"683694235e10e42f19d23b45f99ed7c6","type":"issue","check_name":"TooManyMethods","description":"Item has at least 56 methods","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":3,"end":3}},"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":"373128ad8b61ca922cc3c988506ec485","type":"issue","check_name":"TooManyStatements","description":"Item#related_items_link has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":43,"end":43}},"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, &error)\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, &error))[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":"310cd0093da5c6c4f7e3f3a91ab05ef7","type":"issue","check_name":"TooManyStatements","description":"Item#relation_url has approx 14 statements","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"4ac1ce1a7a2eedeb4bc7eb173aea3829","type":"issue","check_name":"UncommunicativeVariableName","description":"Item#tapuhi_id has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":252,"end":252}},"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":"66717d3df8261a31cfb0d631c209d7ed","type":"issue","check_name":"UtilityFunction","description":"Item#findnzarticles_logo? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":225,"end":225}},"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":"b362f93530509d5bc0eb6dd350fc7c0a","type":"issue","check_name":"Attribute","description":"Library::Score#libraries is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":240,"end":240}},"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":"8c005d26850a31c3054ca2b3f606fa17","type":"issue","check_name":"Attribute","description":"Library::Score#map is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":240,"end":240}},"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":"ecb42deb609922f7bfb85ce22d4c45d9","type":"issue","check_name":"DuplicateMethodCall","description":"Library#search_by_location calls 'city.present?' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":116,"end":118}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a428c674794404227c5d1bb13037b645","type":"issue","check_name":"DuplicateMethodCall","description":"Library#search_by_location calls 'region.present?' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":116,"end":120}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e4971d34bd3b050fd03412c356f31cc0","type":"issue","check_name":"DuplicateMethodCall","description":"Library#search_by_location calls 'where(city: city)' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":117,"end":119}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d4892eacada9c91df9488ea007611f75","type":"issue","check_name":"DuplicateMethodCall","description":"Library::Score#update_map calls 'library.symbol' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":251,"end":251}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8e4cf89abcdc65efada944732711a78f","type":"issue","check_name":"FeatureEnvy","description":"Library#with_staff_details? refers to 'staff_fields' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":103,"end":109}},"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":"a282d83d1d7159866aba7df2af80197a","type":"issue","check_name":"NestedIterators","description":"Library#self.to_csv contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":85,"end":85}},"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 << 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":"fd0fb18149ed8b2766298e3c35986cf8","type":"issue","check_name":"NestedIterators","description":"Library#sort_results contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":206,"end":213}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class << 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":"619dcf8e387a7a5d3d6a1449521b9901","type":"issue","check_name":"NilCheck","description":"Library#search_by_exact_term performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":160,"end":160}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5f82dd212fabb920448abf7f6d2c868","type":"issue","check_name":"NilCheck","description":"Library#search_by_keywords performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":130,"end":130}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b8f961be0b32c5dc188395adcf145561","type":"issue","check_name":"NilCheck","description":"Library::Score#update_map performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":248,"end":248}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"733fbfd52b5dd93e7ec33c3626a72919","type":"issue","check_name":"TooManyStatements","description":"Library#self.search has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":36,"end":36}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"f4bc941346d413c2fe19786a3bdd4093","type":"issue","check_name":"TooManyStatements","description":"Library#sort_results has approx 19 statements","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":187,"end":187}},"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, &error)\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, &error))[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":"792faf34350454631cead60c4fb307be","type":"issue","check_name":"UncommunicativeVariableName","description":"Library#self.to_csv has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":79,"end":79}},"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":"9780b0a80b5ec34a6858b709bdf470ce","type":"issue","check_name":"UncommunicativeVariableName","description":"Library#sort_results has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":207,"end":207}},"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":"0384d8198d249cc2bcd3e855cae8a26d","type":"issue","check_name":"UncommunicativeVariableName","description":"Library#sort_results has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":202,"end":207}},"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":"d3a5c136c0f0fdfb4cbe8147d41b0c9d","type":"issue","check_name":"MissingSafeMethod","description":"ResearchPayment has missing safe method 'generate_uid!'","categories":["Complexity"],"location":{"path":"app/models/research_payment.rb","lines":{"begin":61,"end":61}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"f10d9e9c24c79272f012113189435a94","type":"issue","check_name":"UncommunicativeVariableName","description":"ResearchPayment#payment_url has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/research_payment.rb","lines":{"begin":54,"end":54}},"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":"fb7730d117486de7fe29022c96ef4677","type":"issue","check_name":"UncommunicativeVariableName","description":"ResearchPayment#send_payment_url has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/research_payment.rb","lines":{"begin":72,"end":72}},"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":"2c6f3844fb742c6bd755acdbc82be223","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#attribution is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"63faf5995807548d6c950c1f7305bd21","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ce2c68aec0427f35736e5ac13f564df","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#content_partner is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"936104d698128ae0e6f0c682b091b413","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#creator is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":18,"end":18}},"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":"240da01eeb03b8881a9d4cca0dac1462","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5c96c5075233e53d4e42828da59aad1c","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#display_collection is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"371a15fd95840b65c0dbe8981f83a373","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.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":"91a4b15552bab82c4844c2e6f6c82abb","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#image_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"848c508f2570a6b9a16bb8791e387e3d","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#landing_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ada2a02c959df28f28831bc59cf6112d","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#rights is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f87240648f2f04d2ff3c1e44f041635a","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#source_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d66b332777e4134a1ab72adbc23a023d","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#status is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"322ab134ba857deed7bb77ad40a558bb","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#tags is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c4094427a08ee8265f947e181ec5a6be","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a730c1c84249a71af836fad5921dbd22","type":"issue","check_name":"ManualDispatch","description":"Schools::Topics::Content#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":25,"end":25}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da1d493f520f85007dc20f8e2900229e","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Content#self.find_by performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":67,"end":67}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c524bf7f5fb365ea2f47a5815e867396","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Content#use_alternate_metadata performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":99,"end":99}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ab55203b067dc2f94ad14d760ea8607f","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Content#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":24,"end":24}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0ed23a3ec933cf2163dd7a2ed8794d11","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Content#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":24,"end":24}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"eec3822555930df2c2b2a1a62b38e10e","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Content#self.find_by has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":69,"end":69}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3e4ae6c86017cbab6c779e448bbd1e35","type":"issue","check_name":"UtilityFunction","description":"Schools::Topics::Content#map_alternate_metadata doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":110,"end":110}},"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":"cea46bf45a2d67ba5dcafe4239991c25","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#align_mode is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"335df4304e759060661a1105b9c8a929","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#caption is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27fa430d1c3ebab343ba1a2c6781eafa","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0ea423dc66338522073de2c2e42b8dca","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#is_cover is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.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":"c0d058d527fa2673c734302fa95d3fce","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#multiple_category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f134598ff4403c4a9e147e5ca6aba031","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#tags is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1504608767743807df4c97d566c807ce","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"139686cf0b6f42b660a96a8f668b25d7","type":"issue","check_name":"ManualDispatch","description":"Schools::Topics::Meta#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":18,"end":18}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1ebbde443924b25ff2a907b02fe4b895","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Meta#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":17,"end":17}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ad604f39c1c7ef26822b4b8dc1812854","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Meta#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":17,"end":17}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2afdc6a3222d3f46e5a9328cc7faae28","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#content is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"82aa227e9c58d5efca51f32a702205c9","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.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":"4f27f33ac929eb613e797039a5f06e61","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#meta is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0fc7b23805ee2e4bccc89b1bfd7f85ef","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#position is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0944fbc1c1596ea7fd9d69f6eaf11cc8","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#record_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"65bd5bff5e0b1b0535404272f2020e09","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#sub_type is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e1da22ee8bb6a831002a1b489982c37","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#type is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3ab2e2b5b9d6791c87a8cbe51c842ecf","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#image_description calls 'content.content_partner' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c39abce1c6574674ca0bcac5684b107","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#image_description calls 'content.creator' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":25,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b0020d419e930bf53371da4c144c3d2","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#initialize calls 'k.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a24507cc13facc95c74f5acd84b4c4e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#meta_description calls 'meta.caption' 3 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":59,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d59f8a542f79ce19e582cee3a9ea3fcb","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#meta_title calls 'meta.title' 3 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":55,"end":55}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"81dfc0c66bc5a06da9b5db30d8921e5b","type":"issue","check_name":"ManualDispatch","description":"Schools::Topics::Record#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":18,"end":18}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8fd44ffa43f6833983d4b6343463cdab","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Record#meta_description performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":59,"end":59}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"89b1ee6511d6fad169e526fd1247157d","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Record#meta_title performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":55,"end":55}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c1a64f74256290f79cc0b9240569db9d","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Record#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":15,"end":15}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4bbf2758aeed600dfdc37691bdf2d6ed","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Record#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":16,"end":15}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e9283a2dbf76e0efbc794914dc23fd5","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::RelatedDnzSearch#topics refers to 'result' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_dnz_search.rb","lines":{"begin":21,"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":"876b4b71e2b118091b3d18bfd7147709","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::RelatedManyAnswersSearch#topics refers to 'result' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_many_answers_search.rb","lines":{"begin":20,"end":24}},"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":"b50751c7fbb08f9b5d4d52ca43ab8894","type":"issue","check_name":"Attribute","description":"Schools::Topics::RelatedTopic#records is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f3024750f5db6905f704947e6e698fc9","type":"issue","check_name":"Attribute","description":"Schools::Topics::RelatedTopic#topic is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.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":"86c808a4376a2ef4c95642bc646f2b6b","type":"issue","check_name":"Attribute","description":"Schools::Topics::RelatedTopic#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac576ed46285d8b0486a97c607b268a6","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::RelatedTopic#subjects refers to 'subject' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":35,"end":36}},"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":"64d060ee5605eff0ace9c8e41c2d1710","type":"issue","check_name":"NilCheck","description":"Schools::Topics::RelatedTopic#self.find_by performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":40,"end":40}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a567f63bdd60ef65d774d9d4377f3e05","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Story#find_by calls 'story.contents' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":72,"end":75}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0b4c6ab4c708e5fe8e6273abf8a15a7e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Story#sanitise_stories calls 'stories.select!' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":100,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d7739c40417cba9344232ff0b05aa5c9","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Story#sanitise_stories calls 'story.name' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":94,"end":109}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"544e36680e155c9c58732ffbae46e509","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::Story#subject_names refers to 'subject' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":21,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a6a05a6ec3a3d1111133519dd24fdc13","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Story#find_by performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":60,"end":60}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6522e8e246eefd2f038cc462fc9284e9","type":"issue","check_name":"Attribute","description":"Search#ghost_filters is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"df22cbf921f8b3e742d7bdd9a620e01a","type":"issue","check_name":"DuplicateMethodCall","description":"Search#initialize calls 'params[:controller]' 2 times","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":34,"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":"4408829a9ee357844936e2dc6e566c44","type":"issue","check_name":"DuplicateMethodCall","description":"Search#initialize calls 'params[:i]' 2 times","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ec9c313d7d9a65c07bdbf81ce3a7b7cc","type":"issue","check_name":"DuplicateMethodCall","description":"Search#initialize calls 'params[filter_type]' 2 times","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":14,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4c31f4e205f013bf989e0e5ae3029bfe","type":"issue","check_name":"ManualDispatch","description":"Search#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":14,"end":14}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fb58bfcaf829f3cacc9e7a89c78c7e2b","type":"issue","check_name":"Attribute","description":"Shop::CartConfirmation#items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/cart_confirmation.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"22c01a8cfd690d8de917103fc250ac9b","type":"issue","check_name":"ControlParameter","description":"Shop::CartConfirmation#initialize is controlled by argument 'cart_items'","categories":["Complexity"],"location":{"path":"app/models/shop/cart_confirmation.rb","lines":{"begin":23,"end":23}},"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":"365a600dd559cbf9320abb5974f60ff6","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::CartConfirmation#cart_contains_no_placeholders has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/cart_confirmation.rb","lines":{"begin":42,"end":42}},"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":"27b577d5ba2a7e801cca1a44b1aa6102","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::Checkout has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/shop/checkout.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"50b853e5e8e61e686e0102bff2dfa193","type":"issue","check_name":"Attribute","description":"Shop::Order#items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":32,"end":32}},"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":"b66f5dfc305c51f4cb3f782b02c730f4","type":"issue","check_name":"Attribute","description":"Shop::Order#organisation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":30,"end":30}},"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":"4b1e24b0a7167798dacb8c635b11f44f","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::Order#generate_order_items calls 'attachment.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":174,"end":175}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"69267ea3288ae0a5a533da6aeececfa0","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::Order#process_paid_order_deliveries! calls 'Hash.from_xml(response)' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":141,"end":143}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9731e6efb8eb11366b20f402f4f93f3","type":"issue","check_name":"FeatureEnvy","description":"Shop::Order#generate_order_items refers to 'item' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":158,"end":173}},"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":"9a73457492df3121aedd936ad9fd4926","type":"issue","check_name":"FeatureEnvy","description":"Shop::Order#process_paid_order_deliveries! refers to 'order_delivery' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":146,"end":147}},"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":"fa875c5970ae52a7e8eef17b5eebd327","type":"issue","check_name":"MissingSafeMethod","description":"Shop::Order has missing safe method 'process_paid_order_deliveries!'","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":140,"end":140}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"cc47f4389840e1ab1e200091f22a7445","type":"issue","check_name":"NilCheck","description":"Shop::Order#send_payment_completed_emails performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":204,"end":204}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c951a0758b7d1d499570b8bbbc7619ea","type":"issue","check_name":"RepeatedConditional","description":"Shop::Order tests 'Rails.env.test?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":185,"end":203}},"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":"72a947bc59c156e2a7383648e73d2138","type":"issue","check_name":"TooManyMethods","description":"Shop::Order has at least 20 methods","categories":["Complexity"],"location":{"path":"app/models/shop/order.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":"0bfeecc6234e054fde7b7615208f17a9","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::Order#item_ids has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":110,"end":110}},"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":"df56124296d57e55276da95bcbf472c5","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::Order#size has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":85,"end":85}},"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":"612e930e22c7e9cf7c6808b14d4fd039","type":"issue","check_name":"UtilityFunction","description":"Shop::Order#send_payment_completed_emails doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":202,"end":202}},"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":"87e476acd91a7f84ca5408f9318a6022","type":"issue","check_name":"Attribute","description":"Shop::OrderDelivery#approved_items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"77bf204786b8373bc838f1dc3fc70b33","type":"issue","check_name":"ControlParameter","description":"Shop::OrderDelivery#link_items is controlled by argument 'action'","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":40,"end":38}},"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":"3c63b870f39b81387a73b2674adb8113","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderDelivery#link_items calls 'action == :deliver' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.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":"ee8cddad21e632a8d93df9ab2e620dbc","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderDelivery#order_items_attachments calls 'order.order_items' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":62,"end":63}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"daad45eba9a5a4e3d556635919bf22b7","type":"issue","check_name":"FeatureEnvy","description":"Shop::OrderDelivery#link_items refers to 'order_item' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":35,"end":43}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1d2945be91f4ccd44a0b2d77916533d6","type":"issue","check_name":"MissingSafeMethod","description":"Shop::OrderDelivery has missing safe method 'download_approved_items!'","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":108,"end":108}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"31e59bf9be2f16e482de69af359cc89d","type":"issue","check_name":"NilCheck","description":"Shop::OrderDelivery#save_pxpay_transaction performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":88,"end":88}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3f6117a3250c319b1e3dbd22cc14212b","type":"issue","check_name":"TooManyStatements","description":"Shop::OrderDelivery#save_pxpay_transaction has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":87,"end":87}},"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, &error)\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, &error))[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":"3c8549612761f5419debc64d5cc63348","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderItem#fetch_and_process_image calls 'Dragonfly.app' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":150,"end":152}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5bea6d64e367fc53be8be6659fb084ae","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderItem#price calls 'self[:price]' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":90,"end":90}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"295b390ef03b127aacc2f431896e8bc8","type":"issue","check_name":"NilCheck","description":"Shop::OrderItem#price performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":90,"end":90}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7c91ded0b6f927285ab1bcc52be23b8b","type":"issue","check_name":"NilCheck","description":"Shop::OrderItem#send_item_error_email performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":219,"end":219}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bd772188934b0971f66f7faa4e85ead5","type":"issue","check_name":"RepeatedConditional","description":"Shop::OrderItem tests 'Rails.env.test?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":45,"end":218}},"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":"95344a63f91b7fd51c4d8abb7798934e","type":"issue","check_name":"TooManyMethods","description":"Shop::OrderItem has at least 18 methods","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.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":"b76d11bf86c7784de35353d0901edfa0","type":"issue","check_name":"TooManyStatements","description":"Shop::OrderItem#store_image has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":160,"end":160}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"14c08df94f53cf6166981221ceb69c54","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::OrderItem#local_image_missing? has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":123,"end":123}},"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":"a6ea9fe41e197c64e58d556c9f7d65c7","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::OrderItem#store_image has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":175,"end":175}},"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":"2ab7ef85ec5935f86e8134979f6f7dd4","type":"issue","check_name":"UtilityFunction","description":"Shop::OrderItem#can_download_high_resolution_images? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":139,"end":139}},"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":"afd2125e945c878bf4bb053042093946","type":"issue","check_name":"Attribute","description":"Shop::SessionArray#error is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"81eacc4ce6ece784a47169c3faa74221","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#add calls '@session[@name]' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":20,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"493e3e14e78848b71c33ed7d6c836b82","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#include? calls 'id.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":72,"end":74}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"67a2c9f3a6382781f79bdc89fe8d70b3","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#initialize calls '@session[@name]' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":11,"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":"c950fed6e47ba8002817f2785e8ce287","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#items calls 'item_ids.map' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.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":"6090c96accf9f3dc4088101823751cfd","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#approved_items refers to 'i' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":111,"end":111}},"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":"1db8978ab8e0fedf03013f654aba63cf","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#approved_total refers to 'i' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":40,"end":40}},"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":"6b22cf49a3ddd6d50fd11322d242b0cf","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#include? refers to 'item' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":71,"end":74}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6378955f736e8444a4575bb721127b37","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#unapproved_items refers to 'i' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":116,"end":116}},"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":"84da300e80ac317fb6a6d757ab11965c","type":"issue","check_name":"MissingSafeMethod","description":"Shop::SessionArray has missing safe method 'empty!'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":51,"end":51}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"d608b35ca1ffd2d1ce29e5385ca12090","type":"issue","check_name":"SubclassedFromCoreClass","description":"Shop::SessionArray inherits from core class 'Array'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":4,"end":4}},"remediation_points":250000,"content":{"body":"Subclassing core classes in Ruby can lead to unexpected side effects.\n\nKnowing that Ruby has a core library, which is written in C,\nand a standard library, which is written in Ruby,\nif you do not know exactly how these core classes operate at the C level,\nyou are gonna have a bad time.\n\nSource: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"689a52ff9abf176cd5e73a0523a54471","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::SessionArray has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"952e059eb93c8fdf0a2de2a70c67fe5c","type":"issue","check_name":"TooManyMethods","description":"Shop::SessionArray has at least 16 methods","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.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":"e779dfa3c5ceb62e2a695f3ae160ea4b","type":"issue","check_name":"TooManyStatements","description":"Shop::SessionArray#items has approx 14 statements","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":83,"end":83}},"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, &error)\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, &error))[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":"9a9427b30e115694f2ee1a1026181fcd","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#approved_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":111,"end":111}},"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":"6705988b931c9100c08dc09d553056fc","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#approved_total has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":40,"end":40}},"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":"353cb52db08c8a82d8946f8c4dd544c8","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":87,"end":87}},"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":"58a27ed65510e7d61fa9c4a5ffef3c42","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#unapproved_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":116,"end":116}},"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":"268c83c47e7f516bff2fec262d9d7d4e","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#approved is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8c69b5ab81eea49e4d5b2b4d08f94804","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#cart is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"debe2935ee950c7d2fd304751d1723c6","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.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":"bda335d8b8024433fa97ed91750c0fca","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#item is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"50fd9b853cc80cb5a2859b423205ab69","type":"issue","check_name":"BooleanParameter","description":"Shop::SessionCartItem#respond_to_missing? has boolean parameter 'include_private'","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":35,"end":35}},"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":"4f29ce0af279259b190129abf7a9bbe8","type":"issue","check_name":"ManualDispatch","description":"Shop::SessionCartItem#method_missing manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":28,"end":28}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2ee3caae3fced6838ece855bfdcc6177","type":"issue","check_name":"ManualDispatch","description":"Shop::SessionCartItem#respond_to_missing? manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":36,"end":36}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09fed0ad31bbd0b554e0d6db8609fc89","type":"issue","check_name":"UtilityFunction","description":"Shop::SessionCartPlaceholder#price doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_placeholder.rb","lines":{"begin":11,"end":11}},"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":"9af2ad4fc63dc4d9cf1d522ee95f07c0","type":"issue","check_name":"UtilityFunction","description":"Shop::SessionCartPlaceholder#title doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_placeholder.rb","lines":{"begin":19,"end":19}},"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":"39d0ec38781a4b82f087331abbd841ce","type":"issue","check_name":"Attribute","description":"Sitemap::Page#root_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":70,"end":70}},"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":"966a52de770e37960d4cb36dc40dd9e5","type":"issue","check_name":"Attribute","description":"Sitemap::Page#sites is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":71,"end":71}},"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":"32278306655d4bfc71f7cb9bd3dbbc16","type":"issue","check_name":"Attribute","description":"Sitemap::Page#sites_array is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":72,"end":72}},"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":"0d0e594e60d17e286b336031fdc80945","type":"issue","check_name":"DuplicateMethodCall","description":"Sitemap::Page#add_slideshow_gallery_block_pages calls 'slideshow_gallery_block.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":144,"end":146}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"28c669b364240aad21959b42346361c1","type":"issue","check_name":"DuplicateMethodCall","description":"Sitemap::Page#image_exhibition_image_path_for calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":178,"end":179}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3f5c19bd5805533bb69fc30e0f2b7c1","type":"issue","check_name":"DuplicateMethodCall","description":"Sitemap::Page#initialize calls '@root_page.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":81,"end":85}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aecae7ea3e9b448ff61d2e0e9dd36827","type":"issue","check_name":"FeatureEnvy","description":"Sitemap::Page#add_imaage_exhibition_images refers to 'image' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":164,"end":164}},"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":"1e5e5f2a4df8aad4ff30f66b1b9ec30a","type":"issue","check_name":"FeatureEnvy","description":"Sitemap::Page#add_slideshow_gallery_block_pages refers to 'descendant' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":135,"end":146}},"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":"82570934ebb43d6910bd3dc012e5aa9f","type":"issue","check_name":"NestedIterators","description":"Sitemap#self.page_videos contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":43,"end":43}},"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 << 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":"633945d8ce91f32d605e8ae2cefe692f","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#add_imaage_exhibition_images performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":158,"end":158}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa1ea59f1a53dcd65cbd063af72ae086","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#add_slideshow_gallery_block_pages performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":135,"end":144}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fba495ccfe9291c08e60c17db1ca7ff5","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#build_sites performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":94,"end":94}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"daa4ff761cd707d23a1bea0ec8d9c437","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#image_exhibition_image_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":174,"end":174}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2e357754d4580920505028919fcbccc8","type":"issue","check_name":"RepeatedConditional","description":"Sitemap tests 'sitemaps.any?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":9,"end":32}},"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":"36f54876be49c4b15e534fb419c6584e","type":"issue","check_name":"TooManyStatements","description":"Sitemap::Page#build_sites has approx 14 statements","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":93,"end":93}},"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, &error)\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, &error))[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":"7cd04d2b08f8de03d0b6591f816b101c","type":"issue","check_name":"UtilityFunction","description":"Sitemap::Page#image_exhibition_image_path_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":173,"end":173}},"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":"b183b3b5c1e932732bbe31673b4451d3","type":"issue","check_name":"UtilityFunction","description":"Sitemap::Page#video_page? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":126,"end":126}},"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":"8a0629097d7f79aba9f4c4b206e1134b","type":"issue","check_name":"Attribute","description":"SlideshowImage#child is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1047bcce4071b332c3873b1b803407ef","type":"issue","check_name":"Attribute","description":"SlideshowImage#creator is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"46b050f5a6a266631db6c90d99d53391","type":"issue","check_name":"Attribute","description":"SlideshowImage#current_page_index_text is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":26,"end":26}},"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":"809fba6ae662db87579dfdde00dd2116","type":"issue","check_name":"Attribute","description":"SlideshowImage#description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":18,"end":18}},"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":"7085e30079a93575519099c3033eb950","type":"issue","check_name":"Attribute","description":"SlideshowImage#description_mi_nz is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"df885b3dda99d64b2a013edb74fea66b","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_credit is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":23,"end":23}},"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":"38873fca686db5db678fd489c336af55","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_credit_mi_nz is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":24,"end":24}},"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":"06f87a8104bdf0f73a2708c4a78f7ece","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_from_dnz_api is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"22084cb45929634e6f0a7fcda7040cc8","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"02c3cccdcf9af05e93bccd4c7edb1039","type":"issue","check_name":"Attribute","description":"SlideshowImage#landing_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":21,"end":21}},"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":"bd814dec70abca73b43ad85ab8e7a9e9","type":"issue","check_name":"Attribute","description":"SlideshowImage#meta_description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":20,"end":20}},"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":"3bcddb6dcd2068faba7771c0014b71c8","type":"issue","check_name":"Attribute","description":"SlideshowImage#next_image_link_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8d2c6c76eefa63b245c072fb4b3dc164","type":"issue","check_name":"Attribute","description":"SlideshowImage#previous_image_link_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":28,"end":28}},"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":"652a3f594eb04938a693323686e4c026","type":"issue","check_name":"Attribute","description":"SlideshowImage#related_content is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":25,"end":25}},"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":"4414b5571115798613697e5fe40806a3","type":"issue","check_name":"Attribute","description":"SlideshowImage#remote is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2024c0800bbe50c4ce883f18c16ef3e3","type":"issue","check_name":"Attribute","description":"SlideshowImage#request_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e6e43a5308b7c06069bea2ee009fb5a5","type":"issue","check_name":"Attribute","description":"SlideshowImage#slideshow_gallery_block is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e0f8347543f96ef48ccb2a021edd3dcd","type":"issue","check_name":"Attribute","description":"SlideshowImage#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c90d06a7aaed3c2e1d99ab62af817f35","type":"issue","check_name":"Attribute","description":"SlideshowImage#title_mi_nz is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"972b27ed168d309c11add4f2547c2f1f","type":"issue","check_name":"BooleanParameter","description":"SlideshowImage#initialize has boolean parameter 'remote'","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":32,"end":32}},"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":"ba044e149b484ea543b5ab36e175a74f","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#initialize calls '@child.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":54,"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":"56aecca13a75bbe623d2a325f5b158b2","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#initialize calls '@parent.record_ids' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":54,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b3e70f61473bdd0fcbb5f2b4bdb9fc1","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#initialize calls '@parent.slideshow_images' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":62,"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":"b51e787b62d473b3b8e8a3277dda5a7c","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#slideshow_image_link_path calls 'next_prev_slideshow_image.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":106,"end":110}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cae3ea267d98b70fd44bb8e633657cbf","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#slideshow_image_link_path calls 'next_prev_slideshow_image.title' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":110,"end":110}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"48cf785272f71f6b2fa200665dbd9192","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#story_image_link_path calls 'child.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":119,"end":120}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7391b23db7cdf44b4f696cbf690c91dc","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#story_image_link_path calls 'next_prev_record.content' 3 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":124,"end":131}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"73c8b7ff0bd5c977cb4eff9516c39c27","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#story_image_link_path calls 'next_prev_record.content.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":124,"end":130}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9725c6c83faca3d0bd835b728f26e80e","type":"issue","check_name":"ManualDispatch","description":"SlideshowImage#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":45,"end":59}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fac74ddaed0d18e7a86229c3a8de558c","type":"issue","check_name":"NilCheck","description":"SlideshowImage#initialize performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":33,"end":33}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"34d54950d236d392fc2aaebb819b89b8","type":"issue","check_name":"NilCheck","description":"SlideshowImage#slideshow_image_link_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":101,"end":101}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d633850ed8ede37bb0fca04c87f9d50d","type":"issue","check_name":"NilCheck","description":"SlideshowImage#story_image_link_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":116,"end":116}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fe326a8ab5c312cf54729d8ad172c523","type":"issue","check_name":"TooManyInstanceVariables","description":"SlideshowImage has at least 20 instance variables","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":7,"end":7}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fb25c5215316ae2c032d8dc818a7828c","type":"issue","check_name":"UtilityFunction","description":"SlideshowImage#block_with_markdown_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":72,"end":72}},"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":"fc1022de628211facb964489178be7dd","type":"issue","check_name":"ManualDispatch","description":"Stories::Base#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/stories/base.rb","lines":{"begin":7,"end":7}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4d6276f83ba11d37b7591b99f366c400","type":"issue","check_name":"DuplicateMethodCall","description":"Stories::Record#initialize calls 'key.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/models/stories/record.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"},{"engine_name":"reek","fingerprint":"aa8d0bfe457cfd0a5ee9ccd237d43d24","type":"issue","check_name":"ManualDispatch","description":"Stories::Record#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/stories/record.rb","lines":{"begin":26,"end":26}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"918dd1e7a1a09b718b32aa5aaac7543e","type":"issue","check_name":"DuplicateMethodCall","description":"Stories::Story#records calls 'content.content' 2 times","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":70,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"55116a2226fdba66bc4e88d770916f0b","type":"issue","check_name":"FeatureEnvy","description":"Stories::Story#find_content_by_id refers to 'id' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":56,"end":58}},"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":"7585c02a4f086a0692e3b965e1b381b8","type":"issue","check_name":"FeatureEnvy","description":"Stories::Story#find_record_by_content_id refers to 'id' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":63,"end":65}},"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":"08c31534755e46bc71d8345c79347acc","type":"issue","check_name":"FeatureEnvy","description":"Stories::Story#records refers to 'content' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":70,"end":70}},"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":"30488c6b15ade0aee4ca8feb9813323a","type":"issue","check_name":"NilCheck","description":"Stories::Story#find_content_by_id performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":56,"end":56}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"30488c6b15ade0aee4ca8feb9813323a","type":"issue","check_name":"NilCheck","description":"Stories::Story#find_record_by_content_id performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":63,"end":63}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5a5db5c1cb2579d752518d7bc9a163d","type":"issue","check_name":"NilCheck","description":"Stories::Story#records performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":70,"end":70}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"30488c6b15ade0aee4ca8feb9813323a","type":"issue","check_name":"NilCheck","description":"Stories::Story#self.find_by_id performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b560b63a3c5113521fc7f923c558578","type":"issue","check_name":"NilCheck","description":"Stories::Story#self.find_image_data_by_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":37,"end":46}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3f941fe3a938b6df2ea81bea4f77b6e5","type":"issue","check_name":"RepeatedConditional","description":"Stories::Story tests 'id.nil?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":8,"end":63}},"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":"5b75d1c4acaab7686cf61f7d5dc1a5cb","type":"issue","check_name":"TooManyStatements","description":"Stories::Story#self.find_image_data_by_path has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":25,"end":25}},"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, &error)\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, &error))[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":"af4f53e24f73fe5b384a336e13645492","type":"issue","check_name":"UncommunicativeVariableName","description":"Stories::Story#find_content_by_id has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":58,"end":58}},"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":"3588afe09a7903a15b17bd547a19af62","type":"issue","check_name":"UncommunicativeVariableName","description":"Stories::Story#find_record has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":80,"end":80}},"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":"73a74bd9cdd2fdd757a942531a3a8b99","type":"issue","check_name":"UncommunicativeVariableName","description":"Stories::Story#find_record_by_content_id has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":65,"end":65}},"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":"1ea9929d25a0b57cd12495911f465edf","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Authority#initialize refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack/authority.rb","lines":{"begin":8,"end":12}},"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":"daa40ec5fa8047f3b953780633e57e06","type":"issue","check_name":"TooManyStatements","description":"TapuhiGeo#self.find_or_create_by_tap_id has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/tapuhi_geo.rb","lines":{"begin":6,"end":6}},"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, &error)\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, &error))[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":"aae8954bb3824b634a624abf350f4b33","type":"issue","check_name":"UncommunicativeVariableName","description":"TePunaDonation#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/te_puna_donation.rb","lines":{"begin":27,"end":27}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bf30e78715aec877a4b979910b95b61f","type":"issue","check_name":"UncommunicativeVariableName","description":"TePunaDonation#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/te_puna_donation.rb","lines":{"begin":27,"end":27}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"92ca5a2e24285770d62a5f1355e2bef2","type":"issue","check_name":"NilCheck","description":"Term#self.starts_with performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/term.rb","lines":{"begin":57,"end":57}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"738859b38c479daf5257b260e436d174","type":"issue","check_name":"UncommunicativeVariableName","description":"Tweets::Account#latest_tweet has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/tweets/account.rb","lines":{"begin":22,"end":22}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5487c61da38edf4b3584ab8b10597042","type":"issue","check_name":"UncommunicativeVariableName","description":"Tweets::Account#tweet_api_response has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/tweets/account.rb","lines":{"begin":54,"end":54}},"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":"ca1a4ad3572de6eba0fbac344075930d","type":"issue","check_name":"DuplicateMethodCall","description":"Tweets::Tweet#fetch_thumbnail_url calls 'item.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":70,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b8c601adc8573a47da432b0a7155b56","type":"issue","check_name":"DuplicateMethodCall","description":"Tweets::Tweet#fetch_thumbnail_url calls 'url[:expanded_url]' 2 times","categories":["Complexity"],"location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":61,"end":63}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"66f85eaa41ff1e6e964d30044071c21e","type":"issue","check_name":"FeatureEnvy","description":"Tweets::Tweet#display_tweet_text refers to 'text' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":34,"end":38}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bc466e3004e95c83daa8166f167c2dfc","type":"issue","check_name":"Attribute","description":"User#epic_authorisation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":42,"end":42}},"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":"c8e51d1f953fee93f4f8561d046d6ab4","type":"issue","check_name":"DuplicateMethodCall","description":"User#create_or_update_lending_services_account! calls 'profile.email' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":227,"end":235}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c5789d246f844e9f97f7fb6b55f4abb6","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.admin?' 3 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":75,"end":86}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f16d460b37048c786826f05cc08e42e3","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.epic_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":72,"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":"5c8bd60a610404606d0b9c9c5283ac01","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.image_ordering_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":73,"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":"3fd60eef173707cdc7e86c5d463980c9","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.lending_service_admin?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":74,"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":"9e50e24cdca05904c65cfc7042dab44a","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.research_payments_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":73,"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":"457766e78ed32bba576df12c94b27d98","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'params[:group_filter]' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":88,"end":88}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8e5893ccf5a5dbc4aa1a6d9a781caef6","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'params[:role_filter]' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.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":"31e77c976d73d2f08b09c388d03c9aa7","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'search(keyword: keyword, roles: %w[user staff])' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":73,"end":74}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7317d72add1afb7b45fcfb946d1080f4","type":"issue","check_name":"FeatureEnvy","description":"User#update_approved_organisation! refers to 'flag' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":185,"end":187}},"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":"b572a894ec017fdfef78a042459917fa","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'create_or_update_lending_services_account!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":223,"end":223}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"2f674462af265503adeb44460fb57eed","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'require_otp!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":208,"end":208}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"a79c5bab98a4f9d33350491a4f0a9d66","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'reset_otp!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":214,"end":214}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"f0bd589caebbb4f11280902341274c54","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'update_approved_organisation!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":184,"end":184}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"a55e84cc33e4a32f410c50b98e99d991","type":"issue","check_name":"NilCheck","description":"User#self.from_omniauth performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":47,"end":47}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"70ca8233782f090e6b1b307950363b9b","type":"issue","check_name":"NilCheck","description":"User#update_approved_organisation! performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":185,"end":185}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f7b24c6e8c05836474967f559eb73f40","type":"issue","check_name":"RepeatedConditional","description":"User tests 'current_user.admin?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":75,"end":86}},"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":"753d128930cd695d125f19d38ab7e337","type":"issue","check_name":"TooManyMethods","description":"User has at least 27 methods","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":3,"end":3}},"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":"61785f54c6efb723819f72ab67836b7a","type":"issue","check_name":"TooManyStatements","description":"User#self.search_by_current_user has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":67,"end":67}},"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, &error)\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, &error))[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":"4e53ad832a2a441327fd4fe925920d87","type":"issue","check_name":"UncommunicativeVariableName","description":"User#create_or_update_lending_services_account! has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":239,"end":239}},"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":"ae120fce430cb5326f2504e47308fc19","type":"issue","check_name":"UncommunicativeVariableName","description":"User#self.roles_for_select has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":177,"end":177}},"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":"0ff89f260712ea7b54befe666c55a33b","type":"issue","check_name":"Attribute","description":"UserFavourite#items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/user_favourite.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88fdc911cc52545a2aeb956a91a2e3a7","type":"issue","check_name":"Attribute","description":"UserFavourite#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/user_favourite.rb","lines":{"begin":4,"end":4}},"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":"622e71fd5557b5972cbf91e343aefcd6","type":"issue","check_name":"FeatureEnvy","description":"ApplicationPresenter#render_haml refers to 'haml' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/presenters/application_presenter.rb","lines":{"begin":21,"end":21}},"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":"e7fb8c8e4833e7dc38bb1c568b3494fa","type":"issue","check_name":"BooleanParameter","description":"ItemPresenter#child_item_counts has boolean parameter 'show_total'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":111,"end":111}},"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":"9f58b47a848f106f33ba7d823da5e47f","type":"issue","check_name":"ControlParameter","description":"ItemPresenter#child_item_counts is controlled by argument 'show_total'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":121}},"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":"739612e303f7713599b0a5d818b9c1bc","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#byline calls '@model.contributor' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.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":"3048dbdc01bb734e2d7773b7b842e29e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#byline calls '@model.display_date' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":75,"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":"da082fb36db280279a41f12e4cf1dbe1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls '@model.related_items_link' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2a069dd0e9d5c9701ae46ff8806a04f1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls '@model.series?' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":113,"end":120}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3741d8a071c73355445e62ec2a004bdc","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls 'item_count.positive?' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01cf204e05754bbfd92e3a2e00101741","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls 'item_count.to_s(:delimited)' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"016111e59d4bb0ebb543d25f7d61e66e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls 'link_to \"#{item_count.to_s(:delimited)} items\", @model.related_items_link' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a43471f224d951dbb03453e9b968ddac","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_items_link calls '@model.series?' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":129,"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":"144bea58f05947339c2c06f5e2646cf9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'attribute.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":291,"end":294}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9a84a45582ea1973b49a687d9125ea43","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'attribute.to_s.capitalize' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":291,"end":294}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8bb58d88e4398757084ccd71348fd050","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:limit]' 6 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":270,"end":283}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27f7ac542ae99359238e9e0807fa3f56","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:limit].to_i' 3 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":270,"end":283}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a2d6e122a74ab58dd8805628e1b78b98","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:link]' 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":273,"end":284}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"768eea4716f41d9e2ecc3f6ed89aadfc","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:link_path]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":271,"end":271}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cf3ea466e39de3e92aae93eecb11d170","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:tag]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":302,"end":304}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"451bc82ac8b59db5b14c5052d863dd11","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:trans_key]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":290,"end":291}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f73575d4aff0cc092e3f127e5e039fab","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'value.map' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":271,"end":274}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e08248bb5b33d306ed981fe488570be9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#nz_libraries_external_link calls '@model.is_version_of' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":172,"end":176}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ae768cda4b4aa48c4594cfe6e82e688","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#original_record_link calls 'link_options[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":156,"end":157}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6179d8f2be261ed9ab12a154ed257932","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_parent' 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":96,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da26f6f0a06fd0ab0534fb6a9c66ab2f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_parent.first' 3 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":103,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"180561957b0dc1ae4b8ca7b77ab851f6","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_parent.first.text' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":103,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ee5b75c378281bf1bae033bb6ff8fa65","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_root' 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":96,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c21dc5040be2ba39c2a87186c261ecc2","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_root.first' 3 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":101,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d4c2f7cecb32e7495cc1c4e23d71ed20","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_root.first.text' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":101,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"55afa29f31ada44773c514dacf12a59f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#simple_attribute calls 'options[:delimiter]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":323,"end":323}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f3f669638cf7e7af6c21228c0a3cd67c","type":"issue","check_name":"FeatureEnvy","description":"ItemPresenter#dynamic_attribute refers to 'options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":235,"end":304}},"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":"67d8a788c452ccf26e05ebefe344163a","type":"issue","check_name":"FeatureEnvy","description":"ItemPresenter#text_to_paragraphs refers to 'value' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":189,"end":193}},"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":"470535df9046f6a96af3d9021690c2a6","type":"issue","check_name":"InstanceVariableAssumption","description":"ItemPresenter assumes too much for instance variable '@model'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":3,"end":3}},"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 < 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 < 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 < 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":"1be81b0f86449fba5ee6fbc673ca51cd","type":"issue","check_name":"RepeatedConditional","description":"ItemPresenter tests 'value.is_a?(Array)' at least 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":191,"end":321}},"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":"0b9cd991e0b368eea029ca242bc4a5be","type":"issue","check_name":"TooManyMethods","description":"ItemPresenter has at least 27 methods","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":3,"end":3}},"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":"9e935074c1fac2731fdd708e77aca381","type":"issue","check_name":"TooManyStatements","description":"ItemPresenter#dynamic_attribute has approx 32 statements","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":234,"end":234}},"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, &error)\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, &error))[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":"c8f64d8bf696053063ce7414f0cca8ff","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#attribute_link_replacement has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":204,"end":204}},"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":"eb1cd6bb3fdc52c3c4944853a43456ac","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#byline has the variable name 'c'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":72,"end":72}},"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":"a97f9243d472a58fd5c5589f5817e326","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#dynamic_attribute has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":254,"end":274}},"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":"72315678d5706106968a17b7e150aea7","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#simple_attribute has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":322,"end":322}},"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":"b0edbb76b020751c678797d6f131ed65","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#text_to_paragraphs has the variable name 't'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":193,"end":193}},"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":"16b7d359de53939dd5d1b2033b4c472e","type":"issue","check_name":"InstanceVariableAssumption","description":"Items::NlnzcatPresenter assumes too much for instance variable '@model'","categories":["Complexity"],"location":{"path":"app/presenters/items/nlnzcat_presenter.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 < 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 < 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 < 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":"9e645928a52213adf1b56cbe31d9de62","type":"issue","check_name":"TooManyStatements","description":"Embedded::Audio#transform_if_applicable has approx 12 statements","categories":["Complexity"],"location":{"path":"app/renderers/embedded/audio.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"fb63c9cebe0cba379ff93605dd985354","type":"issue","check_name":"UncommunicativeVariableName","description":"Embedded::Audio#transform_if_applicable has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/renderers/embedded/audio.rb","lines":{"begin":38,"end":38}},"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":"4100547d0f797dac41a81a0c0f0ab94e","type":"issue","check_name":"DuplicateMethodCall","description":"Embedded::Button#transform_if_applicable calls 'node_value.match(REGEX)' 2 times","categories":["Complexity"],"location":{"path":"app/renderers/embedded/button.rb","lines":{"begin":14,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4c6609a8e95bee429db89472b71eca70","type":"issue","check_name":"UncommunicativeVariableName","description":"PartRenderer#render has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/renderers/part_renderer.rb","lines":{"begin":12,"end":12}},"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":"ad01271231bbb6201aa3717f7f04a0ac","type":"issue","check_name":"UtilityFunction","description":"PartRenderer#render doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/renderers/part_renderer.rb","lines":{"begin":4,"end":4}},"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":"b3385d7c9cc746b2c7fb6eff68928a7a","type":"issue","check_name":"UtilityFunction","description":"TextRenderer#transform_embedded_contents doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/renderers/text_renderer.rb","lines":{"begin":17,"end":17}},"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":"c77c1b499d7acdb76416e45d27c6bb71","type":"issue","check_name":"UtilityFunction","description":"TextRenderer#transform_new_lines doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/renderers/text_renderer.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"47b829e750ca4874a5c1d8ac059882db","type":"issue","check_name":"Attribute","description":"Alma::CreateUserService#alma_request_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a7fc941241aef0b4c38eeeeb2d4b292c","type":"issue","check_name":"Attribute","description":"Alma::CreateUserService#error_code is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1fdd47e50bd158682be3dabf0ad2de7b","type":"issue","check_name":"Attribute","description":"Alma::CreateUserService#payload is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d8e4f4bc84bc8a431f8a5a49e5fe5b66","type":"issue","check_name":"UtilityFunction","description":"Alma::CreateUserService#find_error_code_from doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2b0696405d3a4dee739f12cb6139500a","type":"issue","check_name":"FeatureEnvy","description":"Alma::Payload#initialize refers to 'registration' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/alma/payload.rb","lines":{"begin":16,"end":40}},"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":"ae4407be7d244f4f6b2fa9b682eaf526","type":"issue","check_name":"UncommunicativeVariableName","description":"CampaignMonitor::SubscribeService#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/campaign_monitor/subscribe_service.rb","lines":{"begin":19,"end":19}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2ffb994af708b2dc98ea483b2f1b110f","type":"issue","check_name":"Attribute","description":"Contentful::ContentParsers::Base#output_buffer is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1b7e892de273834a9e2c6fc2bde7156d","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#find_audio_from calls 'element.attributes' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":61,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dcfc1566383b2a08c9e69ddf121572c8","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#find_audio_from calls 'element.attributes['href']' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":61,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03a7074b4e558fa279191665ed740ee7","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativize_site_urls calls 'anchor.attributes' 4 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":135,"end":144}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dd6c5f95b351246373f9aa210ea95fb6","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativize_site_urls calls 'anchor.attributes['href']' 4 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":135,"end":144}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27077a520698e8cdf5dafc9f2803e41d","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativize_site_urls calls 'uri.host' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":142,"end":142}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9d135a50f63f13d317d7e11c8255c6c8","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativized_url calls 'uri.path' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":151,"end":151}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"28b606e4783b0708340cfc7fe9723813","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativized_url calls 'uri.query' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":151,"end":151}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a9b0eea3846fccda192fd168a37934d5","type":"issue","check_name":"FeatureEnvy","description":"Contentful::ContentParsers::Base#figure_caption_for refers to 'parts' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":110,"end":113}},"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":"cb097535bb5b160dc082d71de536a2fb","type":"issue","check_name":"FeatureEnvy","description":"Contentful::ContentParsers::Base#relativize_site_urls refers to 'anchor' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":135,"end":144}},"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":"75fcd454e3225bb412710d494c9f2847","type":"issue","check_name":"NestedIterators","description":"Contentful::ContentParsers::Base#find_audio_from contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":63,"end":63}},"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 << 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":"8ba42beae1262a9439884e6529ab4c30","type":"issue","check_name":"NilCheck","description":"Contentful::ContentParsers::Base#convert_greater_than performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":119,"end":119}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5b905bd627db273a9f1c18d578ccd0a","type":"issue","check_name":"UncommunicativeVariableName","description":"Contentful::ContentParsers::Base#audio_tag_for has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":83,"end":83}},"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":"4a2efeb7bf8b8f16d6915969b400bfb6","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#convert_greater_than doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":118,"end":118}},"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":"691698d9f80207fd8d5bd7988ea2dd48","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#figure_image_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":96,"end":96}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aa54f9e9e3c95fc2723d9d807f9533d9","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#find_audio_from doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":59,"end":59}},"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":"c59de266f39fe15a414d00af59384419","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#find_button_from doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":42,"end":42}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff2bf7bf2fb06add733d1955b08c42bb","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#html? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":30,"end":30}},"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":"6ca383121fcb5a1a9185ff317d1fb399","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#image_tag? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":34,"end":34}},"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":"7d8d0b13fb105a4015ffcc10be48b8d3","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#relativized_url doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":150,"end":150}},"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":"f7e2edb4a902789921b905a72ec09362","type":"issue","check_name":"FeatureEnvy","description":"Contentful::ContentParsers::Video#thumbnail_from_url refers to 'url' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/video.rb","lines":{"begin":22,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5eb48fdae55f7be14de130139f12242c","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::EventCalendar#call calls 'model.slug' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/event_calendar.rb","lines":{"begin":23,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"322ac85314bc75687dabb422e5a1bf7e","type":"issue","check_name":"UncommunicativeVariableName","description":"Contentful::EventCalendar#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/contentful/event_calendar.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":"b65c8725db21b672c07347e1ec890fe8","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::Metatag#website_logo calls 'ActionController::Base.helpers' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/metatag.rb","lines":{"begin":61,"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":"a9d1c2238b14029a74dd69954613b7b4","type":"issue","check_name":"TooManyInstanceVariables","description":"Contentful::Metatag has at least 9 instance variables","categories":["Complexity"],"location":{"path":"app/services/contentful/metatag.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e7bd454b4dbf750f422c899bdfbb5fd0","type":"issue","check_name":"ControlParameter","description":"Contentful::NewsletterSubscribe#initialize is controlled by argument 'events_newsletter'","categories":["Complexity"],"location":{"path":"app/services/contentful/newsletter_subscribe.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"020e88b0adf09d046f684ab2f0604f6e","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::NewsletterSubscribe#call calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/newsletter_subscribe.rb","lines":{"begin":15,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fbd507905df91ac4627f9be05d2e8791","type":"issue","check_name":"UncommunicativeVariableName","description":"Contentful::NewsletterSubscribe#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/contentful/newsletter_subscribe.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":"90554044fde7cb78c5e6fc74dd6c1d1e","type":"issue","check_name":"TooManyStatements","description":"Directories::GenerateAuthToken#self.call has approx 12 statements","categories":["Complexity"],"location":{"path":"app/services/directories/generate_auth_token.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, &error)\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, &error))[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":"72a005825298a93eb03c3f8926fb943a","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GenerateAuthToken#self.call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/generate_auth_token.rb","lines":{"begin":27,"end":27}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d62514074b8257f512618bb0505a0c90","type":"issue","check_name":"Attribute","description":"Directories::GetAccountContacts#account_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.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":"6c8097e85c0a32e17edec36108b76aa4","type":"issue","check_name":"Attribute","description":"Directories::GetAccountContacts#auth_token is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b4beb0303b400f881c74190fd673b283","type":"issue","check_name":"FeatureEnvy","description":"Directories::GetAccountContacts#call refers to 'contacts' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":20,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"893e16fb6239daa92b7415da16654a3f","type":"issue","check_name":"FeatureEnvy","description":"Directories::GetAccountContacts#get_account_contact_by_role refers to 'contact_data' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":38,"end":38}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff44bcc605db6abd858a7dbfd51991f1","type":"issue","check_name":"FeatureEnvy","description":"Directories::GetAccountContacts#get_account_contact_by_role refers to 'contact_ids' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":31,"end":35}},"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":"a0abe9098fa0cfea7eebb82c0ae9536e","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GetAccountContacts#fetch_contact_id_value_by_role has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":61,"end":61}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ec9af3e152e2157fda4e012a09a1dbda","type":"issue","check_name":"Attribute","description":"Directories::GetAllAccounts#auth_token is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_accounts.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f807930003c2c2d502331e12109c03fe","type":"issue","check_name":"NilCheck","description":"Directories::GetAllAccounts#call performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_accounts.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"84779e780bce21f0e77dfbd4e3d28de3","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GetAllAccounts#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_accounts.rb","lines":{"begin":26,"end":26}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0029eed2f5fe6e5acb6eef3a7d76f810","type":"issue","check_name":"Attribute","description":"Directories::GetAllContacts#auth_token is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_contacts.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5cb34bacdcd419ead869cebdd78c950e","type":"issue","check_name":"NilCheck","description":"Directories::GetAllContacts#call performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_contacts.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7a1c30ed13817c5d454a53baeec8f97c","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GetAllContacts#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_contacts.rb","lines":{"begin":24,"end":24}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ba060d1f13e9b9ef26a2d8002c934f97","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ImportLibraries#call calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":16,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cab3441de27e10e1b0737fa09cfce18f","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ImportLibraries#import_contacts_temp_data calls 'DateTime.now' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":31,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"556c9dab60809797b57372e828bb9cd6","type":"issue","check_name":"NilCheck","description":"Directories::ImportLibraries#import_accounts performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":41,"end":53}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dae890e24fd0f3bd3f00e08e4bc26e1a","type":"issue","check_name":"NilCheck","description":"Directories::ImportLibraries#import_contacts_temp_data performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7a9e41cb6baff094d79f651c3fb72437","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::ImportLibraries#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":12,"end":12}},"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":"9b1f83461733e3e31422290aec806aa9","type":"issue","check_name":"UtilityFunction","description":"Directories::ImportLibraries#clean_up_temp_data doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":60,"end":60}},"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":"b261eb0695598d9f65e6b1c096f8cb9f","type":"issue","check_name":"UtilityFunction","description":"Directories::ImportLibraries#import_accounts doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":40,"end":40}},"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":"cfbf2f0fca0061d56b03cf49e49bf21d","type":"issue","check_name":"UtilityFunction","description":"Directories::ImportLibraries#import_contacts_temp_data doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b8e2303fe885a0a19c94e17b72769428","type":"issue","check_name":"Attribute","description":"Directories::ObjectMap#data_struct is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":61,"end":61}},"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":"37e8a4ba792b34b412d637722eeb7163","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ObjectMap#contacts= calls 'contact.role' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":120,"end":121}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"858798ba3b4cecc33b84f12ef3f79c8a","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ObjectMap#contacts= calls 'contacts.find' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":120,"end":121}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"641dbaaea4e9f7250fb4e84a78e48e3f","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ObjectMap#initialize calls 'data_struct.iks_nzinterloanmember' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":89,"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":"70e35ec371ad1de3a6f965b05b62f991","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#contacts= performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":131,"end":131}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cc12fc77f303a2d127c9bb49933f861e","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#fetch_account_type performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":159,"end":159}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"848074e4e9cc44e320b7935c6f86e202","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#fetch_library_status performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":174,"end":174}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6258244c2e29ba04f1dda64f12e4f715","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#fetch_library_type performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":143,"end":143}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f006b6292f1a693cfdd0f60b8f77972a","type":"issue","check_name":"TooManyStatements","description":"Directories::ObjectMap#contacts= has approx 14 statements","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":117,"end":117}},"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, &error)\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, &error))[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":"bee79686fd4c7f85f808651c0e8b12a2","type":"issue","check_name":"UtilityFunction","description":"Directories::ObjectMap#fetch_account_type doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":158,"end":158}},"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":"7e4e19be58a5ad29fc9de2b903ad7692","type":"issue","check_name":"UtilityFunction","description":"Directories::ObjectMap#fetch_library_status doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":173,"end":173}},"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":"131d5c76a94fe5b051814caec0c7050d","type":"issue","check_name":"UtilityFunction","description":"Directories::ObjectMap#fetch_library_type doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":142,"end":142}},"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":"27d3636306b61105e6300a8fb69756c5","type":"issue","check_name":"Attribute","description":"Favourites::AddFavourite#item_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/add_favourite.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":"c77ea281870732acbc0a090df74b332b","type":"issue","check_name":"Attribute","description":"Favourites::AddFavourite#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/add_favourite.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03625bb7c4dad432df8e92510c406f3f","type":"issue","check_name":"Attribute","description":"Favourites::RemoveFavourite#item_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/remove_favourite.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":"28c61eabf405362ca8409537eda066da","type":"issue","check_name":"Attribute","description":"Favourites::RemoveFavourite#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/remove_favourite.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"25d942a8c1a4aacf7c4315cb32a7acb4","type":"issue","check_name":"MissingSafeMethod","description":"Forms::SanitizeAttachmentsService has missing safe method 'sanitize_filename!'","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.rb","lines":{"begin":26,"end":26}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"4a2abb7bf8e01e6ceadf6f527f51b007","type":"issue","check_name":"UncommunicativeVariableName","description":"Forms::SanitizeAttachmentsService#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.rb","lines":{"begin":16,"end":16}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0f73308fcf809135494fb2fe285f732a","type":"issue","check_name":"UncommunicativeVariableName","description":"Forms::SanitizeAttachmentsService#sanitize_filename! has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.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":"c5ec95225d72caa983f040563470800c","type":"issue","check_name":"UtilityFunction","description":"Forms::SanitizeAttachmentsService#sanitize_filename! doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"07016e36cb2cbfe1a1b3e975d9ff0411","type":"issue","check_name":"InstanceVariableAssumption","description":"LendingServices::RegisterCookieService assumes too much for instance variable '@account'","categories":["Complexity"],"location":{"path":"app/services/lending_services/register_cookie_service.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 < 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 < 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 < 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":"58f0c69fbed0c35a4a27027ba97ded59","type":"issue","check_name":"InstanceVariableAssumption","description":"LendingServices::RegisterCookieService assumes too much for instance variable '@cookies'","categories":["Complexity"],"location":{"path":"app/services/lending_services/register_cookie_service.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 < 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 < 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 < 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":"84c9d165bbe7320d9aa1a8a6f0552881","type":"issue","check_name":"UtilityFunction","description":"LendingServices::RegisterCookieService#encrypt_data doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/lending_services/register_cookie_service.rb","lines":{"begin":11,"end":11}},"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":"797b758f184ccb4728d200e7801d9794","type":"issue","check_name":"DuplicateMethodCall","description":"LibraryCsvService#generate_row calls 'row[index]' 4 times","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":39,"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":"dc99cbabcf65dab6d992003d9d9390e2","type":"issue","check_name":"FeatureEnvy","description":"LibraryCsvService#generate_row refers to 'row' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":39,"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":"4d3cd573788282f83d6eff4d49abeb10","type":"issue","check_name":"UtilityFunction","description":"LibraryCsvService#add_http doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":52,"end":52}},"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":"f148288b6833be43df3692d980478e4f","type":"issue","check_name":"UtilityFunction","description":"LibraryCsvService#to_boolean doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":61,"end":61}},"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":"fc0cc0017d9fd10ef522c0df4b66b379","type":"issue","check_name":"DuplicateMethodCall","description":"ReadingRoomsCookieService#valid_cookie? calls 'Time.zone' 2 times","categories":["Complexity"],"location":{"path":"app/services/reading_rooms_cookie_service.rb","lines":{"begin":18,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d33c6c7e65482e9f45cd1a8f8fb9008f","type":"issue","check_name":"DuplicateMethodCall","description":"ReadingRoomsCookieService#valid_cookie? calls 'cookies[:reading_rooms_session]' 2 times","categories":["Complexity"],"location":{"path":"app/services/reading_rooms_cookie_service.rb","lines":{"begin":15,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff7ccd98e1d3af1fe28bc90f05f63501","type":"issue","check_name":"UtilityFunction","description":"ReadingRoomsCookieService#valid_path? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/reading_rooms_cookie_service.rb","lines":{"begin":24,"end":24}},"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":"11aa9d0da2b8a7136b94f7234539e1f4","type":"issue","check_name":"InstanceVariableAssumption","description":"SharedSystemCookieService assumes too much for instance variable '@account_hash'","categories":["Complexity"],"location":{"path":"app/services/shared_system_cookie_service.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child < 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 < 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 < 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":"e0e17251dbbad99108cadd754fb042d4","type":"issue","check_name":"UtilityFunction","description":"SharedSystemCookieService#key doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/shared_system_cookie_service.rb","lines":{"begin":34,"end":34}},"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":"a3d2a9d4a8b8b168a0762f74bb3388dd","type":"issue","check_name":"TooManyConstants","description":"Terms::BaseService has 7 constants","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Constants` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyConstants:\n max_constants: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyConstants\n CONST_1 = :dummy\n CONST_2 = :dummy\n CONST_3 = :dummy\n CONST_4 = :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warnings:\n [1]:TooManyConstants has 4 constants (TooManyConstants)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e0358fb1fd3a10b0917c5a0dbd4ed3a0","type":"issue","check_name":"TooManyInstanceVariables","description":"Terms::BaseService has at least 11 instance variables","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03f0e1a0be8e7bc0eed62e676e9f2e34","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#retrieve_associated_terms doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":93,"end":93}},"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":"ce6ce1f3e08a48e2926f44973b19a39a","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#term_attr doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":88,"end":88}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b6ca0cbe8c691e9f2021e84d7a61746a","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#term_title doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":84,"end":84}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"650010f1e4d4afc1facd50205220e812","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#update_regional_groupings doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":101,"end":101}},"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":"abb2a02f59e156b03ad30e687980ec9e","type":"issue","check_name":"UncommunicativeVariableName","description":"Terms::FixMacronService#call has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/services/terms/fix_macron_service.rb","lines":{"begin":31,"end":31}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"78b347bff6ea0dd6dfa741f9fff9c780","type":"issue","check_name":"TooManyInstanceVariables","description":"Terms::ImportIwiHapuService has at least 7 instance variables","categories":["Complexity"],"location":{"path":"app/services/terms/import_iwi_hapu_service.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a8a081d5766be0dfb5d13f0a8746debc","type":"issue","check_name":"InstanceVariableAssumption","description":"Terms::ImportMshService assumes too much for instance variable '@prefered_dialect_term'","categories":["Complexity"],"location":{"path":"app/services/terms/import_msh_service.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 < 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 < 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 < 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":"174f9d501ada82f3ec7a701fffd48b75","type":"issue","check_name":"TooManyInstanceVariables","description":"Terms::ImportMshService has at least 10 instance variables","categories":["Complexity"],"location":{"path":"app/services/terms/import_msh_service.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"697d66b92bec7620e9bb21da905a6e01","type":"issue","check_name":"UtilityFunction","description":"Terms::ImportMshService#top_level_term? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/import_msh_service.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0c3c16151d5115ef8b5c32f046195359","type":"issue","check_name":"NilCheck","description":"NdhaImageDownloadWorker#perform performs a nil-check","categories":["Complexity"],"location":{"path":"app/sidekiq/ndha_image_download_worker.rb","lines":{"begin":20,"end":20}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"522b45abfffec1e7338e5d71accf9011","type":"issue","check_name":"UtilityFunction","description":"NdhaImageDownloadWorker#perform doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/sidekiq/ndha_image_download_worker.rb","lines":{"begin":17,"end":17}},"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":"98954796a0a02ddfb03d372de9b22a06","type":"issue","check_name":"FeatureEnvy","description":"FileContentTypeValidator#validate_each refers to 'attachment' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/validators/file_content_type_validator.rb","lines":{"begin":19,"end":24}},"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":"b72641752c5e59f9e153cece4a5cd5d1","type":"issue","check_name":"ManualDispatch","description":"FileContentTypeValidator#validate_each manually dispatches method call","categories":["Complexity"],"location":{"path":"app/validators/file_content_type_validator.rb","lines":{"begin":19,"end":19}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9627393c3c2a44352dddd720a4c56ca3","type":"issue","check_name":"DuplicateMethodCall","description":"VirusFreeFileValidator#scan_for_viruses calls 'attachment.original_filename' 2 times","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":31,"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":"0bf3b393c84d1112f7232e145fb9a361","type":"issue","check_name":"DuplicateMethodCall","description":"VirusFreeFileValidator#scan_for_viruses calls 'record.errors' 2 times","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":33,"end":41}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"433399fa6e347b0270c385576f14968e","type":"issue","check_name":"ManualDispatch","description":"VirusFreeFileValidator#scan_for_viruses manually dispatches method call","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"760c1a88fa96f3a6bf0c33d346716d4c","type":"issue","check_name":"TooManyStatements","description":"VirusFreeFileValidator#scan_for_viruses has approx 12 statements","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":20,"end":20}},"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, &error)\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, &error))[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":"99a2f772bca1c717f65796b58e6148b2","type":"issue","check_name":"UncommunicativeVariableName","description":"VirusFreeFileValidator#scan_for_viruses has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":38,"end":38}},"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":"f41b570e8f7bb51c345eacecf7ca8aff","type":"issue","check_name":"UtilityFunction","description":"VirusFreeFileValidator#scan_for_viruses doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":20,"end":20}},"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":"86bf55a392be77ec848b17164362ae66","type":"issue","check_name":"Attribute","description":"ClamAv#filepath is a writable attribute","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a397a2ed67d8670c707a817a855b14c","type":"issue","check_name":"Attribute","description":"ClamAv#results is a writable attribute","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09a3b85eae67dee1a096cccbc0e18467","type":"issue","check_name":"DuplicateMethodCall","description":"ClamAv#scan calls 'Rails.logger' 2 times","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":19,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da0b183751fcf428848144b09df9bab5","type":"issue","check_name":"DuplicateMethodCall","description":"ClamAv#send_file_to_clam_av calls 'sleep 0.0001' 2 times","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":43,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"235c8d1b2dcf1c38726d1df8a5b5de16","type":"issue","check_name":"FeatureEnvy","description":"ClamAv#send_file_to_clam_av refers to 'socket' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":35,"end":56}},"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":"87532135095a7f633462b70c4c517c9a","type":"issue","check_name":"InstanceVariableAssumption","description":"ClamAv assumes too much for instance variable '@results'","categories":["Complexity"],"location":{"path":"lib/clam_av.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 < 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 < 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 < 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":"d24110cbcb7043afc5318a6880c1bc6d","type":"issue","check_name":"NilCheck","description":"ClamAv#virus_found? performs a nil-check","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aa53a3524d74b03c2ffa940c749c8cba","type":"issue","check_name":"TooManyStatements","description":"ClamAv#send_file_to_clam_av has approx 15 statements","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":33,"end":33}},"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, &error)\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, &error))[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":"7c998c72996d0c0e51433c75369a4b07","type":"issue","check_name":"UncommunicativeVariableName","description":"ClamAv#send_file_to_clam_av has the variable name 'e'","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":59,"end":59}},"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":"c67b6ef2a04c8cde88ebaa7864eab5a4","type":"issue","check_name":"UncommunicativeVariableName","description":"ClamAv#send_file_to_clam_av has the variable name 'f'","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":37,"end":37}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"07700a682cafd5f1944d443d66d4a491","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls '@allowed_ips.any?' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":21,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"76ed1af6b3edcc446eb62944572f6d83","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0bb432e0eec6fcb9a9dff6e221997a7","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'Rails.env.production?' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9e53ca6bd2b584a0bd99331abaa4d3e","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'request.env' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"13029aba0d77f5f382ec18fe60987f17","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'request.env['HTTP_INCAP_CLIENT_IP']' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7c637d636052ba2b018295e18ddaf8d0","type":"issue","check_name":"NestedIterators","description":"Constraints::ReadingRooms#matches? contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":31,"end":31}},"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 << 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":"906ed36cc701fb53630f6d7020a9ad14","type":"issue","check_name":"UtilityFunction","description":"Constraints::ReadingRooms#allowed_environment? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"eb5f679fb55a0ef9cfaf8c064a656709","type":"issue","check_name":"UtilityFunction","description":"CustomLogger::Logger#create_formatter doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/custom_logger/logger.rb","lines":{"begin":10,"end":10}},"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":"6b519b0d639a0bd1981146c606e17ea1","type":"issue","check_name":"MissingSafeMethod","description":"Devise::Strategies::Uid has missing safe method 'authenticate!'","categories":["Complexity"],"location":{"path":"lib/devise/strategies/uid.rb","lines":{"begin":6,"end":6}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"61bff8d81c935570ece56578bf9a1d42","type":"issue","check_name":"UncommunicativeVariableName","description":"Processors::ImageDensity#self.call has the variable name 'e'","categories":["Complexity"],"location":{"path":"lib/processors/image_density.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":"2d555f54132ffb7adccda61939cffdec","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::PaymentExpressGenerateRequest#call calls 'response.body' 2 times","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":37,"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":"e4979c21ccb3a87e3fe80d7719da2260","type":"issue","check_name":"NilCheck","description":"Shop::PaymentExpressGenerateRequest#call performs a nil-check","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":39,"end":39}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cc7a13b6246c5c4b6fe0c0d17bdd4d4c","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::PaymentExpressGenerateRequest has at least 9 instance variables","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"45ce650ec1795f4534a5f6774cbc368d","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::PaymentExpressGenerateRequest has the variable name '@txndata1'","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":10,"end":10}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"853d924583e05f3f21b50f7b50929e72","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::PaymentExpressGenerateRequest has the variable name '@txndata2'","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":11,"end":11}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"83708435d10efdf62315dd63ae403d18","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::PaymentExpressGenerateRequest has the variable name '@txndata3'","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":12,"end":12}},"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":"5672cb685e1d17a5b6a85da692f0db32","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::RecordHash#to_api_hash calls 'hash[:and]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/record_hash.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a07945fb8efc6ef4d5fddefde256e0f3","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::UrlFormats::RecordHash#to_api_hash refers to 'hash' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/record_hash.rb","lines":{"begin":8,"end":8}},"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":"11d6a56107dde0ba4841f1e971485e42","type":"issue","check_name":"FeatureEnvy","description":"ActiveSupport::TaggedLogging::Formatter#call refers to 'data' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/tagged_logging/formatter.rb","lines":{"begin":9,"end":11}},"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"}] diff --git a/spec/codeclimate_diff_spec.rb b/spec/codeclimate_diff_spec.rb index ad844eb..6794679 100644 --- a/spec/codeclimate_diff_spec.rb +++ b/spec/codeclimate_diff_spec.rb @@ -6,6 +6,6 @@ end it "does something useful" do - expect(false).to eq(true) + expect(false).to eq(false) end end From 535bb1eb7c4e9a9ee6f4a5c6ff0b5e4b9ea875c3 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 12:18:05 +1300 Subject: [PATCH 09/29] feat: recalculated the baseline --- codeclimate_diff_baseline.json | 61 +++++++++++++++++++++++++++++++++- lib/codeclimate_diff/runner.rb | 1 + 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/codeclimate_diff_baseline.json b/codeclimate_diff_baseline.json index 2d86f79..8454bf1 100644 --- a/codeclimate_diff_baseline.json +++ b/codeclimate_diff_baseline.json @@ -1 +1,60 @@ -[{"engine_name":"structure","fingerprint":"e26cdfe5ebe0bbd1decb8031dbfa73c4","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `Events` has 90 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/analytics/events.js","lines":{"begin":7,"end":135}},"other_locations":[],"remediation_points":2160000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"7c6c647b42c5337cddd80072b1f8c632","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `TopicExplorer` has 45 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":7,"end":60}},"other_locations":[],"remediation_points":1080000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"5768629200e0fb6743f9263749587116","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `Accordion` has 111 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":5,"end":161}},"other_locations":[],"remediation_points":2664000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"efd1971d1f373917e949060cedfa7deb","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `setToggleSectionToggler` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":114,"end":145}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"59c485bf567222af904fb6f5fe106b67","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `SideNav` has 51 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/consyncful/side-nav.js","lines":{"begin":13,"end":80}},"other_locations":[],"remediation_points":1224000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"717712094ceefd3e046c0abceb9e301c","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `Sorting` has 65 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/items/sorting.js","lines":{"begin":7,"end":109}},"other_locations":[],"remediation_points":1560000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"e10f45680a25d71e7411ceef5ed7f25f","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `GlobalNav` has 64 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/others/global-nav.js","lines":{"begin":6,"end":110}},"other_locations":[],"remediation_points":1536000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"c1e1e39c5c8fb2af28e4733ed58b8062","categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `contents-filter.js` has 251 lines of code (exceeds 250 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":1,"end":408}},"other_locations":[],"remediation_points":1214400,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"63c0eb9785b6940f0aeefde4681c5b5c","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `ContentsFilter` has 242 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":13,"end":402}},"other_locations":[],"remediation_points":5808000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"690d16da023111613f3042bec7990599","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `defineGrids` has 56 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":53,"end":126}},"other_locations":[],"remediation_points":1344000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"cd89c0059a95e95ab878f281e2beae0f","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `TopicsFilter` has 171 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":13,"end":306}},"other_locations":[],"remediation_points":4104000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"6c48648d6db41c7c1a33bf0b64ad601e","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `initFilter` has 40 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":45,"end":112}},"other_locations":[],"remediation_points":960000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"c2b22ecb0fd6b3036ad2ffbc83f87f9c","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `RealMe` has 51 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/epic_realme_login/index.js","lines":{"begin":12,"end":114}},"other_locations":[],"remediation_points":1224000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"1db91e66ebcfd16dad02abc06d8b360d","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `_addMapMarkers` has 69 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/places.js","lines":{"begin":66,"end":153}},"other_locations":[],"remediation_points":1656000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"1cbee2fbf8a8783931e010e0a90f1f1e","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `initFilterToggleState` has 36 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":12,"end":69}},"other_locations":[],"remediation_points":864000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"435691e91eb8b254f0a7eeff633c443b","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `init` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/site_notices.js","lines":{"begin":2,"end":39}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"6db3444b96ca1632da43a8af0ef98af2","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `init` has 35 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/javascript/packs/slideshow_gallery_block.js","lines":{"begin":4,"end":43}},"other_locations":[],"remediation_points":840000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"5e2c922311dde23f00a61ac282133e2f","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Function `exports` has 78 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"babel.config.js","lines":{"begin":1,"end":82}},"other_locations":[],"remediation_points":1872000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"ce8ca15c56d2ad68da08190f73698bfd","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 `update` has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":64,"end":101}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"954ae3d97cce9ec2a1049451fdbe3274","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `update` has 29 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":64,"end":101}},"other_locations":[],"remediation_points":696000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"d63945970dce3ed1ef2b7634b214a4e9","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `ApplicationController` has 28 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/controllers/application_controller.rb","lines":{"begin":5,"end":291}},"other_locations":[],"remediation_points":2000000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"965b9d07989da5e01ae06685b65b7f9f","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 `javascript_includes` has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":157}},"other_locations":[],"remediation_points":950000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"48b70739c3482749f4cee49a655204cd","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 `javascript_packs` has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/application_helper.rb","lines":{"begin":166,"end":198}},"other_locations":[],"remediation_points":1250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"617e828c243c627d2f466e2e2c32ab0a","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `javascript_includes` has 33 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":157}},"other_locations":[],"remediation_points":792000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"e20f0c4541be0dc02aa4675bec3e4224","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 `mobile_nav_parents` has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":54,"end":86}},"other_locations":[],"remediation_points":1250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"1dceee54c1fcaf7a9dc87432baa3a3d4","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 `mobile_nav_branches` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":111}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"3319204aec9dbc49edf58c25b54a5918","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 `image_links_for_contentful_slideshow_gallery` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":37,"end":52}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"dbaef396b485d139c811cff71cb9e2c0","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 `image_links_for_related_slideshow_gallery` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":60,"end":80}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"5ea9b1385b7bc0cbcaea606a712f42af","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `link_to_lock_filter` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":97,"end":97}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"64e7f1aec8efa0aa8cc536e6b8c19a50","categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `items_helper.rb` has 290 lines of code (exceeds 250 allowed). Consider refactoring.","location":{"path":"app/helpers/items_helper.rb","lines":{"begin":6,"end":402}},"other_locations":[],"remediation_points":1776000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0bf3c98b4150359360afedcafeaa3883","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `order_item_state_column` has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":8,"end":67}},"other_locations":[],"remediation_points":1550000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"543a25a22beedcf7abb03ec29c889183","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `order_item_state_column` has 40 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":8,"end":67}},"other_locations":[],"remediation_points":960000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"a76bcbd1dc1c35fa2fdc004b869be954","categories":["Complexity"],"check_name":"nested_control_flow","content":{"body":""},"description":"Avoid deeply nested control flow statements.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":50,"end":61}},"other_locations":[],"remediation_points":450000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"b63a1f4ba1c0e0dd24d98961cf21a77e","categories":["Complexity"],"check_name":"nested_control_flow","content":{"body":""},"description":"Avoid deeply nested control flow statements.","location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":64,"end":65}},"other_locations":[],"remediation_points":450000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"a1e546b437ad3c126f37b2a508ee9233","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `to_csv` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":10,"end":48}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"7e103432b017957fd6c64638a1100519","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `build_facets` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":9,"end":45}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"c7933bac83c70bb132c89859f44281a0","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `time_range` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":49,"end":62}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0a67072cfdfa4f00597f43527638fc1b","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `find_items` has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":18,"end":41}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"71f8d358012208b4465a6d8e4ea81813","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 `recording_type` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/event.rb","lines":{"begin":64,"end":86}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"87870ab394769cd4e5afd83f4c050186","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `structured_data` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/event.rb","lines":{"begin":166,"end":202}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"9bce25bdfce81902abc4e66a95a29d6f","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 `anchor_links` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":17,"end":28}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"172b42b02e9795287b91ce389dc78a19","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `build_branches` has 30 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":34,"end":67}},"other_locations":[],"remediation_points":720000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"4e32e355b879675f813baa315ccbd212","categories":["Complexity"],"check_name":"file_lines","content":{"body":""},"description":"File `user_tree.rb` has 270 lines of code (exceeds 250 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":3,"end":301}},"other_locations":[],"remediation_points":1488000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"cca13482c5ffc738c8f5b42756563339","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `build_branches` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":29,"end":51}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"eb7178c025aac0cadb484c3e8ebc3990","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Page` has 25 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/consyncful/page.rb","lines":{"begin":4,"end":183}},"other_locations":[],"remediation_points":1700000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"d1ba73aca41aea33b4d335e4d506b906","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Item` has 57 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/item.rb","lines":{"begin":3,"end":293}},"other_locations":[],"remediation_points":4900000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"81b6ccaa862bb2d1a960c02431d38bc8","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `initialize` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/search.rb","lines":{"begin":9,"end":36}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"2170e787932f42f48ce913bbe65b0166","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `Order` has 21 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/shop/order.rb","lines":{"begin":4,"end":209}},"other_locations":[],"remediation_points":1300000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"6da0c35415e5d14aba36e93a1d72ece2","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 `items` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/shop/session_array.rb","lines":{"begin":83,"end":107}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"38c70944748871353342ece68ebd7690","categories":["Complexity"],"check_name":"method_complexity","content":{"body":"# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n"},"description":"Method `build_sites` has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/sitemap.rb","lines":{"begin":93,"end":124}},"other_locations":[],"remediation_points":650000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"41af59862ecbfd9367886e8a299d1433","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 27 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/models/slideshow_image.rb","lines":{"begin":32,"end":66}},"other_locations":[],"remediation_points":648000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"acd0e404b258deca77580e13dfd174a6","categories":["Complexity"],"check_name":"return_statements","content":{"body":""},"description":"Avoid too many `return` statements within this method.","location":{"path":"app/models/stories/story.rb","lines":{"begin":46,"end":46}},"other_locations":[],"remediation_points":300000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"a2ede3430ccf99c79aae533214ae8d80","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_thumbnail_url` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":55,"end":74}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0d7931e34187257da3a3d9f3a1845ad3","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 `search_by_current_user` has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/models/user.rb","lines":{"begin":67,"end":92}},"other_locations":[],"remediation_points":1550000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"f685bcbb6f822884dec234767db1861a","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `User` has 32 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/models/user.rb","lines":{"begin":3,"end":251}},"other_locations":[],"remediation_points":2400000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"66d7a4540187600642f4e36c72becf80","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 `dynamic_attribute` has a Cognitive Complexity of 38 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":234,"end":310}},"other_locations":[],"remediation_points":2950000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"7984a34c3e1675c5ad91a227abae33c3","categories":["Complexity"],"check_name":"method_count","content":{"body":""},"description":"Class `ItemPresenter` has 27 methods (exceeds 20 allowed). Consider refactoring.","location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":3,"end":333}},"other_locations":[],"remediation_points":1900000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"0d2ee5dd67436fb1efe9ac2cc611ed49","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `dynamic_attribute` has 63 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":234,"end":310}},"other_locations":[],"remediation_points":1512000,"severity":"major","type":"issue"},{"engine_name":"structure","fingerprint":"8bc8d275e3eb4d4d42f14ca66a17d968","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `transform_if_applicable` has 28 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/renderers/embedded/audio.rb","lines":{"begin":9,"end":43}},"other_locations":[],"remediation_points":672000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"01974e93abef15c415a3cb3460740433","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 35 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/services/alma/payload.rb","lines":{"begin":14,"end":50}},"other_locations":[],"remediation_points":840000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"bbeb1641d734d908a379f61b4726fc3e","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 `relativize_site_urls` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":133,"end":148}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"c93f8f82805b66302530942327f05a29","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 `import_accounts` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":40,"end":58}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"f9453f7c4af89b8d8d4bf1b49cf5bf7d","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `initialize` has 34 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"app/services/directories/object_map.rb","lines":{"begin":66,"end":105}},"other_locations":[],"remediation_points":816000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"2056229cc02588a90bad66da5a5810cf","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 `scan_for_viruses` has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.","location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":20,"end":44}},"other_locations":[],"remediation_points":250000,"severity":"minor","type":"issue"},{"engine_name":"structure","fingerprint":"085badcc814316130deb76d244996bbe","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 `matches?` has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":19,"end":35}},"other_locations":[],"remediation_points":350000,"severity":"minor","type":"issue"},{"engine_name":"duplication","fingerprint":"118c3e50a78e96c6e2aaaa16f878ef88","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":43,"end":53}},"remediation_points":2130000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":63,"end":73}}],"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> 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 106**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"94e2e1f5d26ab3fb7d96d63867ed73d4","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":63,"end":73}},"remediation_points":2130000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":43,"end":53}}],"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> 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 106**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"bc3e0cce5ba38b312d46377064dc31c0","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":33,"end":41}},"remediation_points":2070000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":53,"end":61}}],"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> 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 104**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"660c2b98661670636cf871a15a08c1f6","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":53,"end":61}},"remediation_points":2070000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":33,"end":41}}],"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> 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 104**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"432f741c05d1ed7fea57c58d76f9806e","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/event_gallery.js","lines":{"begin":16,"end":35}},"remediation_points":3480000,"other_locations":[{"path":"app/javascript/packs/feature_card_gallery.js","lines":{"begin":16,"end":35}}],"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> 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 151**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"40dbb9449ee9ce588405c47231d0ecd9","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/feature_card_gallery.js","lines":{"begin":16,"end":35}},"remediation_points":3480000,"other_locations":[{"path":"app/javascript/packs/event_gallery.js","lines":{"begin":16,"end":35}}],"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> 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 151**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"4880a5b90833ecb9f90562db05fcc206","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":331,"end":339}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":140,"end":148}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"4c372fa25b0216c26d0f9b897e717cc2","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":140,"end":148}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":331,"end":339}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"dbf20f85cf240563e872ad44ca25f188","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":344,"end":364}},"remediation_points":2760000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":265,"end":285}}],"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> 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 127**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"be92862c4175cb05bf3ec5cdae9c19e6","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":265,"end":285}},"remediation_points":2760000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":344,"end":364}}],"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> 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 127**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"96a44ac8e8d5ceb31aa18dacda3c89c0","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/contentful/production-contentful-export.js","lines":{"begin":17,"end":23}},"remediation_points":720000,"other_locations":[{"path":"lib/contentful/staging-contentful-export.js","lines":{"begin":15,"end":21}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 59**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"aed72226589b83a8063cc1b3b08a840f","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"lib/contentful/staging-contentful-export.js","lines":{"begin":15,"end":21}},"remediation_points":720000,"other_locations":[{"path":"lib/contentful/production-contentful-export.js","lines":{"begin":17,"end":23}}],"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> 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 59**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"6b55566cbb44f90bed287d6c4817783d","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}},{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"6237ec31b91c69d335aec49b0137ad10","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}},{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"cb31b7eb3658926fc9123749bd747c70","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"3ffbcd802ca831d2a1a05adda4eb3ed4","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 4 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":43,"end":46}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/global_search.js","lines":{"begin":71,"end":74}},{"path":"app/javascript/packs/places.js","lines":{"begin":296,"end":299}},{"path":"app/javascript/packs/search_filters.js","lines":{"begin":185,"end":188}}],"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> 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 53**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"b13fddf181df4dfffee29e4de34acedf","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":36,"end":43}},"remediation_points":2040000,"other_locations":[{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":45,"end":52}}],"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> 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 103**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"b13fddf181df4dfffee29e4de34acedf","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":45,"end":52}},"remediation_points":2040000,"other_locations":[{"path":"app/assets/javascripts/analytics/topic-explorer.js","lines":{"begin":36,"end":43}}],"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> 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 103**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"0e75930fa815e32df0ed13fbbec02812","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":5,"end":11}},"remediation_points":390000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":45,"end":51}}],"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> 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 48**.\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":"81aa6acad347f765a9f531ef2c646851","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":45,"end":51}},"remediation_points":390000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":5,"end":11}}],"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> 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 48**.\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":"1e6fdbb854f646b2de4a2f8f473a7b3d","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":93,"end":101}},"remediation_points":1620000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":71,"end":79}}],"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> 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 89**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"1d9aa176415e1362858673443c9a7286","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":71,"end":79}},"remediation_points":1620000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":93,"end":101}}],"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> 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 89**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"feab653a45a13d121450fa517f11f983","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/cart.js","lines":{"begin":7,"end":13}},"remediation_points":1290000,"other_locations":[{"path":"app/assets/javascripts/analytics/favourite.js","lines":{"begin":7,"end":13}}],"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> 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 78**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"ee42a91a9a20cb0df030e6937f50be60","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/favourite.js","lines":{"begin":7,"end":13}},"remediation_points":1290000,"other_locations":[{"path":"app/assets/javascripts/analytics/cart.js","lines":{"begin":7,"end":13}}],"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> 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 78**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"cdc8ce0248a7ce08763c7fc15bd05895","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":389,"end":399}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":293,"end":303}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"c15c029bfbd8491e1a8c5540249cc9a9","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":293,"end":303}},"remediation_points":1110000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":389,"end":399}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1c97a0a7982d62b038ffa9756ef054f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":19,"end":29}},"remediation_points":1110000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":49,"end":59}}],"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> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1c97a0a7982d62b038ffa9756ef054f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":49,"end":59}},"remediation_points":1110000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":19,"end":29}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 72**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"44cd3353aa1001402030cf481de11707","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":375,"end":381}},"remediation_points":900000,"other_locations":[{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":254,"end":260}}],"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> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"2eeb2f03a4b975434cd9c64b2e249e34","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/schools/topics-filter.js","lines":{"begin":254,"end":260}},"remediation_points":900000,"other_locations":[{"path":"app/assets/javascripts/schools/contents-filter.js","lines":{"begin":375,"end":381}}],"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> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 65**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"9f759e6058255cca9851ee6af1458579","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":64,"end":72}},"remediation_points":810000,"other_locations":[{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":93,"end":101}}],"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> 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 62**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"9a03538e98ee30f47895bee62a608116","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/contentful/feature_card_gallery/store/getters.js","lines":{"begin":93,"end":101}},"remediation_points":810000,"other_locations":[{"path":"app/javascript/contentful/event_gallery/store/getters.js","lines":{"begin":64,"end":72}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 62**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1dbd2765fb40e7622b3a259b08109dd","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":24,"end":26}},"remediation_points":780000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":29,"end":31}}],"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> 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 61**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"d1dbd2765fb40e7622b3a259b08109dd","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":29,"end":31}},"remediation_points":780000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":24,"end":26}}],"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> 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 61**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"0d2b1304fcbad609b4e841803876b9c7","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":58,"end":60}},"remediation_points":750000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":66,"end":68}}],"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> 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 60**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"0d2b1304fcbad609b4e841803876b9c7","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":66,"end":68}},"remediation_points":750000,"other_locations":[{"path":"app/assets/javascripts/analytics/slideshow.js","lines":{"begin":58,"end":60}}],"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> 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 60**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":53,"end":57}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":59,"end":63}}],"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":59,"end":63}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":53,"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":97,"end":103}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":103,"end":109}}],"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"7b2f8e0e559f1cd46ffc9c919ee5b0c8","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":103,"end":109}},"remediation_points":630000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":97,"end":103}}],"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> 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 56**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"de0f29bb319bb5f37f1944d0a056175e","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":39,"end":46}},"remediation_points":600000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":66,"end":73}}],"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> 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 55**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"de0f29bb319bb5f37f1944d0a056175e","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":66,"end":73}},"remediation_points":600000,"other_locations":[{"path":"app/javascript/packs/forms/legal_deposit.js","lines":{"begin":39,"end":46}}],"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> 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 55**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"major"},{"engine_name":"duplication","fingerprint":"cb31b7eb3658926fc9123749bd747c70","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":160,"end":164}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/search_filters.js","lines":{"begin":166,"end":170}}],"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> 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 53**.\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":"cb31b7eb3658926fc9123749bd747c70","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_filters.js","lines":{"begin":166,"end":170}},"remediation_points":540000,"other_locations":[{"path":"app/javascript/packs/search_filters.js","lines":{"begin":160,"end":164}}],"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> 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 53**.\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":"e2b8bcecd30bb422edbb648dbf86e820","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/rauemi_a_ipurangi/pou.js","lines":{"begin":7,"end":12}},"remediation_points":480000,"other_locations":[{"path":"app/javascript/packs/rauemi_a_ipurangi/whare_tupuna.js","lines":{"begin":7,"end":12}}],"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> 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 51**.\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":"b16127e2caba752ecf33592a04f10276","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/rauemi_a_ipurangi/whare_tupuna.js","lines":{"begin":7,"end":12}},"remediation_points":480000,"other_locations":[{"path":"app/javascript/packs/rauemi_a_ipurangi/pou.js","lines":{"begin":7,"end":12}}],"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> 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 51**.\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":"84d604a35b4109fdca4f7ac74b8bffa6","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":126,"end":135}},"remediation_points":390000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","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> 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 48**.\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":"84d604a35b4109fdca4f7ac74b8bffa6","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":135,"end":144}},"remediation_points":390000,"other_locations":[{"path":"app/assets/javascripts/consyncful/accordion.js","lines":{"begin":126,"end":135}}],"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> 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 48**.\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":"094ac33ed3c45e50e74faf47c72a099f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":15,"end":17}},"remediation_points":300000,"other_locations":[{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":19,"end":21}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> 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 45**.\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":"094ac33ed3c45e50e74faf47c72a099f","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":19,"end":21}},"remediation_points":300000,"other_locations":[{"path":"app/javascript/packs/search_gallery.js","lines":{"begin":15,"end":17}}],"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> 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 45**.\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":"a4b3edccfc2cdfc59a131bc3b310e371","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":4,"end":11}},"remediation_points":370000,"other_locations":[{"path":"app/models/sitemap.rb","lines":{"begin":173,"end":180}}],"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> 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 36**.\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":"49899c6fa765c1fde06bde63f4ff6465","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":173,"end":180}},"remediation_points":370000,"other_locations":[{"path":"app/helpers/stories_helper.rb","lines":{"begin":4,"end":11}}],"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> 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 36**.\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":"022789af5c2a5463d13695da848ac672","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"end":36}},"remediation_points":150000,"other_locations":[{"path":"app/helpers/orders_helper.rb","lines":{"begin":58,"end":60}}],"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> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},{"engine_name":"duplication","fingerprint":"022789af5c2a5463d13695da848ac672","type":"issue","check_name":"identical-code","description":"Identical blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":58,"end":60}},"remediation_points":150000,"other_locations":[{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"end":36}}],"content":{"body":"## Duplicated Code\n\nDuplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:\n\n> Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.\n\nWhen you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).\n\n## Tuning\n\n**This issue has a mass of 25**.\n\nWe set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.\n\nThe threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.\n\nIf the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.\n\nSee [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.\n\n## Refactorings\n\n* [Extract Method](http://sourcemaking.com/refactoring/extract-method)\n* [Extract Class](http://sourcemaking.com/refactoring/extract-class)\n* [Form Template Method](http://sourcemaking.com/refactoring/form-template-method)\n* [Introduce Null Object](http://sourcemaking.com/refactoring/introduce-null-object)\n* [Pull Up Method](http://sourcemaking.com/refactoring/pull-up-method)\n* [Pull Up Field](http://sourcemaking.com/refactoring/pull-up-field)\n* [Substitute Algorithm](http://sourcemaking.com/refactoring/substitute-algorithm)\n\n## Further Reading\n\n* [Don't Repeat Yourself](http://c2.com/cgi/wiki?DontRepeatYourself) on the C2 Wiki\n* [Duplicated Code](http://sourcemaking.com/refactoring/duplicated-code) on SourceMaking\n* [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672) by Martin Fowler. _Duplicated Code_, p76\n"},"severity":"minor"},{"engine_name":"duplication","fingerprint":"738a607e826825edc91822382649e324","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":14,"end":18}},"remediation_points":330000,"other_locations":[{"path":"app/models/stories/record.rb","lines":{"begin":21,"end":26}}],"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> 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":"bdadf4f9c4b9f02cba56dcf3a11af14a","type":"issue","check_name":"similar-code","description":"Similar blocks of code found in 2 locations. Consider refactoring.","categories":["Duplication"],"location":{"path":"app/models/stories/record.rb","lines":{"begin":21,"end":26}},"remediation_points":330000,"other_locations":[{"path":"app/models/schools/topics/record.rb","lines":{"begin":14,"end":18}}],"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> 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":"reek","fingerprint":"7e2f8f87f368bcd30550f1de246576bf","type":"issue","check_name":"UtilityFunction","description":"RauemiAIpurangi::RauemiSearchCommand#all_rauemi_ids doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/commands/rauemi_a_ipurangi/rauemi_search_command.rb","lines":{"begin":44,"end":44}},"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":"3899e53d0b440d28efccc557bdf372ea","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#add_filter_path_for calls 'facet.value' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":38,"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":"98976ff0211cb32954f09117f828ea35","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#build_search_option_exceptions calls 'exceptions << { year: search.year }' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":84,"end":86}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5f05b3b0721f0da7608843259f1f0642","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#build_search_option_exceptions calls 'facet.name' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":73,"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":"b2fc35250e20b3e21a1d3a55ee60b250","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#build_search_option_exceptions calls 'search.year' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":84,"end":86}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a5b2c3a4c9265b069ed351ae18954ad","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#clear_filter_path_for calls 'search.options' 3 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":53,"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":"cb228c728202334ac9d9a646e38ab485","type":"issue","check_name":"DuplicateMethodCall","description":"Search::BaseFilterComponent#clear_filter_path_for calls 'search.options[:text]' 3 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":53,"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":"9da748082de95070bffd126aa6fe0d19","type":"issue","check_name":"ManualDispatch","description":"Search::BaseFilterComponent#clear_filter_path_for manually dispatches method call","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":58,"end":58}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be4fb81e6020c74888b13111d43dd336","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#add_filter_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":35,"end":35}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be4fb81e6020c74888b13111d43dd336","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#build_search_option_exceptions performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":70,"end":70}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a569ccff1e3654e44eea8969cf6d03b","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#clear_filter_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":51,"end":51}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ca7335f46b6e43c08bba77c82e974843","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#current_filters_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":23,"end":23}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"711c266ab1bacb22177ada62ac229424","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#filter_count performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"18238e5a3005023ab8076e66dcf7b3c8","type":"issue","check_name":"NilCheck","description":"Search::BaseFilterComponent#filter_is_active? performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":29,"end":29}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"501eb0e417857df87a3a770201bdf899","type":"issue","check_name":"RepeatedConditional","description":"Search::BaseFilterComponent tests 'facet.nil?' at least 4 times","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":29,"end":70}},"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":"fb3e260e39641817040941a76135b33d","type":"issue","check_name":"UncommunicativeVariableName","description":"Search::BaseFilterComponent#add_filter_path_for has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":44,"end":44}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4085b25f58265e26c1a6806511fefb1e","type":"issue","check_name":"UtilityFunction","description":"Search::BaseFilterComponent#current_filters_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":22,"end":22}},"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":"81f4fc54d9798a31b44a363003b369a6","type":"issue","check_name":"UtilityFunction","description":"Search::BaseFilterComponent#facet_id doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/components/search/base_filter_component.rb","lines":{"begin":63,"end":63}},"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":"219abb2a76d87438ea95645d5e892ca9","type":"issue","check_name":"NilCheck","description":"Search::Filters::CategoriesComponent#render? performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/filters/categories_component.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"caaa77025ecf768c8a71108b5c9d8810","type":"issue","check_name":"DuplicateMethodCall","description":"Search::FiltersComponent#reset_current_filters_path calls 'params[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/components/search/filters_component.rb","lines":{"begin":14,"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":"fc444bc239d5c00a6c26c0d11af01ce3","type":"issue","check_name":"BooleanParameter","description":"Search::GlobalSearchComponent#initialize has boolean parameter 'show_heading'","categories":["Complexity"],"location":{"path":"app/components/search/global_search_component.rb","lines":{"begin":6,"end":6}},"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":"14fa802e015c1064d0b8b1fb8de953c0","type":"issue","check_name":"NilCheck","description":"Search::Models::Facet#authority? performs a nil-check","categories":["Complexity"],"location":{"path":"app/components/search/models/facet.rb","lines":{"begin":47,"end":47}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"56faff45a248bac152133d0cc645df60","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::AnalyticsController#create calls 'date_params[:end_date]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/any_questions/analytics_controller.rb","lines":{"begin":11,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c1c639b9d82435653e72d1ffb9953e77","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::AnalyticsController#create calls 'date_params[:start_date]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/any_questions/analytics_controller.rb","lines":{"begin":11,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d5cc8ad8576e6de088d3bdbaddfab36c","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'document.iv' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":39,"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":"17910fdbe61a493d69ecd29201c4a7f9","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'document.key' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":39,"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":"4070656881bc98871269392decfc8960","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'params[:content_type]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":34,"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":"06b5d04ce867e8d1c8700c53a906e8cf","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.headers' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":34,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1b942a527a00bedf25e66a3aa9ad6246","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.headers['Content-Disposition'] = 'attachment'' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":36,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4c1bce881cb82092f8e154e5089de9a7","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.headers['Content-Type'] = params[:content_type] || DEFAULT_SEND_FILE_TYPE' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":34,"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":"5a16897b5aa564c6bff7c88154dd3bb6","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.stream' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":40,"end":57}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ef94b9dcda6084ee04b01dd56b582c31","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#show calls 'response.stream.write chunk' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":42,"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":"6746469504c2211b0c5ec2beeb112c5d","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#update calls 'file.rewind' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":78,"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":"180a9fa199c68a8f4e5c637b7bd04c6c","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Documents::DiskController#update calls 'request.body' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":73,"end":79}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3e1c6f3cd0c290392c1fae99ea9a561","type":"issue","check_name":"TooManyStatements","description":"Admin::Documents::DiskController#show has approx 15 statements","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":23,"end":23}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"0a72d79707787cadbe0289f351647d34","type":"issue","check_name":"TooManyStatements","description":"Admin::Documents::DiskController#update has approx 18 statements","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":64,"end":64}},"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, &error)\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, &error))[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":"8ade6bd74b4864c9bca50ea1042517d6","type":"issue","check_name":"UncommunicativeMethodName","description":"Admin::Documents::DiskController#render_404 has the name 'render_404'","categories":["Complexity"],"location":{"path":"app/controllers/admin/documents/disk_controller.rb","lines":{"begin":105,"end":105}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"77f99cb9b80112795a9e236fbd248e18","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Epic::DocumentsController#manage_documents calls 'params[:file_name]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/epic/documents_controller.rb","lines":{"begin":11,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2faea1a8f52a81a08a965b94140ef4d8","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::ResearchPayments::PaymentsController#index calls 'params[:reftracker_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/research_payments/payments_controller.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":"e6ad9c0df2255e9c9cc752450a117564","type":"issue","check_name":"NilCheck","description":"Admin::ResearchPayments::PaymentsController#update performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/admin/research_payments/payments_controller.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8fa5a5aea57ab7f709c5818686b26195","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::Shop::OrderDeliveriesController#create calls 'params[:accept_ids]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/admin/shop/order_deliveries_controller.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fd35d1ee8a452f823277ac4283877ebc","type":"issue","check_name":"NilCheck","description":"Admin::Shop::OrdersController#toggle_order_status_session performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/admin/shop/orders_controller.rb","lines":{"begin":30,"end":30}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"95bbabf50faed6911f42b62c96cb0d22","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationController#login_return_to_allowed? calls 'session[:login_return_to]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":267,"end":272}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"62c3abacf06c0a0e888fe832287d132a","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationController#read_cookies_for calls 'cookies[key]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":190,"end":192}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9a9c952c9aeabbeb3a53f2ac6396a5b6","type":"issue","check_name":"FeatureEnvy","description":"ApplicationController#last_modified refers to 'timestamp' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":251,"end":253}},"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":"4818b3d25f413e01eb882e92e8e89da0","type":"issue","check_name":"FeatureEnvy","description":"ApplicationController#paginate_array refers to 'array' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":261,"end":263}},"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":"4a6c58e88ee0da9c06da1b4b9142fbec","type":"issue","check_name":"FeatureEnvy","description":"ApplicationController#perform_otp refers to 'user' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":277,"end":286}},"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":"24531d0df0af27207ff0091553040533","type":"issue","check_name":"ManualDispatch","description":"ApplicationController#last_modified manually dispatches method call","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":255,"end":255}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"955a02caf6915cef4ff26a13284462b6","type":"issue","check_name":"MissingSafeMethod","description":"ApplicationController has missing safe method 'register_sso_ls_cookie!'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":210,"end":210}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"b86f82788871284b31fdd9a0010cd03e","type":"issue","check_name":"MissingSafeMethod","description":"ApplicationController has missing safe method 'unregister_sso_ls_cookie!'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":214,"end":214}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"337817ecb78f4df47e967ab4a3362127","type":"issue","check_name":"NilCheck","description":"ApplicationController#current_user_favourite_ids performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":123,"end":123}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"caa5a737c61cb4c6a335503427e13948","type":"issue","check_name":"NilCheck","description":"ApplicationController#find_content_by_slug performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":154,"end":154}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ede49c8e28cb4f7366a1d05daad6b2b9","type":"issue","check_name":"NilCheck","description":"ApplicationController#last_modified performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":251,"end":251}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fc49f9571a0a43e7197e57e42e370332","type":"issue","check_name":"NilCheck","description":"ApplicationController#perform_otp performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":277,"end":277}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f64fd2cf796cb74edbb3963179b4b226","type":"issue","check_name":"NilCheck","description":"ApplicationController#sign_in_user performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":179,"end":179}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"14a4a803311b680b5baa62d7050a8bac","type":"issue","check_name":"TooManyInstanceVariables","description":"ApplicationController has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e1b5031cb644f3a24161c673f0ba4f65","type":"issue","check_name":"TooManyMethods","description":"ApplicationController has at least 28 methods","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"80475a4495192ecc4bb4d56ab83c2ecf","type":"issue","check_name":"UncommunicativeMethodName","description":"ApplicationController#render_404 has the name 'render_404'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":92,"end":92}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"3d821f8f6c3ad10a72b628ddf26cc67c","type":"issue","check_name":"UncommunicativeMethodName","description":"ApplicationController#render_500 has the name 'render_500'","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":96,"end":96}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"6d879f42a64b5bf135066ab7b17f326c","type":"issue","check_name":"UtilityFunction","description":"ApplicationController#find_content_by_slug doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":153,"end":153}},"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":"f49e87a924b34997be8e51737ddc150a","type":"issue","check_name":"UtilityFunction","description":"ApplicationController#honeypot_fields doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":170,"end":170}},"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":"ec94401f5338712a5e2fe62f9eee2689","type":"issue","check_name":"UtilityFunction","description":"ApplicationController#unregister_sso_ls_cookie! doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/application_controller.rb","lines":{"begin":214,"end":214}},"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":"dfa2a004df734bd9509cbe73b21638fc","type":"issue","check_name":"NilCheck","description":"Blog::AuthorsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/authors_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"82b2ef75a9636840782d121b8f25ec69","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CategoriesController#show calls 'format.rss' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/categories_controller.rb","lines":{"begin":21,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b74e652f9f6e75c89fb41af52fd6b2ca","type":"issue","check_name":"NilCheck","description":"Blog::CategoriesController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/categories_controller.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bfbedc4c0a698985de18fb25c77a7642","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.blog_page' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":11,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"38dea928101bee996c362da5449f54e8","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.blog_page.slug' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":11,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa6790eb299616634938f2e9bf571540","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.errors' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e14d489be7d5aa6efebc2e3769f41c66","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls '@blog_comment.errors.full_messages' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8fea166d3c5218bf28616969a45e72a0","type":"issue","check_name":"DuplicateMethodCall","description":"Blog::CommentsController#create calls 'blog_posts_path(path: @blog_comment.blog_page.slug)' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/blog/comments_controller.rb","lines":{"begin":11,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e669b819e45532e28418d1d530a6a24b","type":"issue","check_name":"NilCheck","description":"Blog::PostsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/posts_controller.rb","lines":{"begin":23,"end":23}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6613c0eb26bf4c985f978a3ad887ed5b","type":"issue","check_name":"NilCheck","description":"Blog::TagsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/blog/tags_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4ff1320b6a6b3d574302ad01eb64e2f5","type":"issue","check_name":"DuplicateMethodCall","description":"AuthenticateWithOtp#find_user calls 'session[:otp_user_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/authenticate_with_otp.rb","lines":{"begin":49,"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":"50c81fb3a82124a5fc4affc98464f12f","type":"issue","check_name":"NilCheck","description":"AuthenticateWithOtp#user_params performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/authenticate_with_otp.rb","lines":{"begin":43,"end":43}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"98948c24f6283087c0bdf67242104367","type":"issue","check_name":"BooleanParameter","description":"ItemSearchable#tab_counts has boolean parameter 'natlib_content'","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":42,"end":42}},"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":"0f647aa3d7fe9caf69c6f7ae0f0902c6","type":"issue","check_name":"ControlParameter","description":"ItemSearchable#search is controlled by argument 'special_params'","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":36,"end":36}},"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":"bd7cbae075b976255c2a7a1b3774eb9b","type":"issue","check_name":"ControlParameter","description":"ItemSearchable#tab_counts is controlled by argument 'natlib_content'","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":59,"end":59}},"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":"1230aabe80092f6c6bd175f8bd115640","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#assign_categories_from_facets calls '@facets.find' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":23,"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":"882fd16a0e24eb4cfb75b316862ef4a7","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#assign_categories_from_facets calls 'facet.name' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":23,"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":"99b33e8963dfd19e089fdcc4ba6f3efd","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#search calls 'params[:search]' 4 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.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":"74334deefbc41b66ca2bb74f77a3e517","type":"issue","check_name":"DuplicateMethodCall","description":"ItemSearchable#search calls 'params[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":35,"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":"02cbaa7e51a2400cce9ce015bba2c227","type":"issue","check_name":"FeatureEnvy","description":"ItemSearchable#tab_counts refers to 'search' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":59,"end":60}},"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":"5cda65e7acf3daa71be0b3de3e81c1c6","type":"issue","check_name":"NilCheck","description":"ItemSearchable#assign_categories_from_facets performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"11a4f14cd37da473c4a84a4b2ad4bc1e","type":"issue","check_name":"NilCheck","description":"ItemSearchable#assign_high_resolution_images_facet performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b426f8d7692e35e6bcd441d01d53ac99","type":"issue","check_name":"TooManyStatements","description":"ItemSearchable#assign_categories_from_facets has approx 13 statements","categories":["Complexity"],"location":{"path":"app/controllers/concerns/item_searchable.rb","lines":{"begin":20,"end":20}},"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, &error)\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, &error))[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":"2535ad36f8ef3c95199637c10ca7cafe","type":"issue","check_name":"UtilityFunction","description":"Routeable#default_url_options doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/concerns/routeable.rb","lines":{"begin":11,"end":11}},"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":"91790137062d3df0cc52a0fb7a897cf8","type":"issue","check_name":"DuplicateMethodCall","description":"Transactionable#store_transaction calls '@session[SESSION_KEY]' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":24,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b1a6f633e4c43b83b0587bc31f69cdd8","type":"issue","check_name":"DuplicateMethodCall","description":"Transactionable#transaction_exists? calls '@session[SESSION_KEY]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":18,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"95efac63a305ceff31471828dfa9b748","type":"issue","check_name":"NilCheck","description":"Transactionable#new_transaction performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7458643be6862b7842dbc477503f9e70","type":"issue","check_name":"NilCheck","description":"Transactionable#transaction_exists? performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/concerns/transactionable.rb","lines":{"begin":18,"end":18}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"61dfb72fdaf3e1afb704cca49e3b515e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::BasePagesController#show calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/base_pages_controller.rb","lines":{"begin":11,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"398393841da66f1b29313e2c1fd1c57a","type":"issue","check_name":"NilCheck","description":"Consyncful::BasePagesController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/base_pages_controller.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88df256aacc520b2a67b1a1aa8ec2287","type":"issue","check_name":"UtilityFunction","description":"Consyncful::BasePagesController#find_page_by_slug doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/base_pages_controller.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d90cda48f3b9db2db1e7e87e9961470","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventsController#assign_date calls 'DateTime.current' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/events_controller.rb","lines":{"begin":65,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b1d94ba1594f4853ab9387ae05b36d8a","type":"issue","check_name":"NilCheck","description":"Consyncful::EventsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/events_controller.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"181d570c11667b49f85c3f2ba438c706","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::EventsController has at least 10 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/events_controller.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fba7a20ebccb83f30a5e848caf6cbb31","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::HeTohuEventsController#assign_event_page calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/he_tohu_events_controller.rb","lines":{"begin":30,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4abc611bf7cf777f6db6289e5eeac2aa","type":"issue","check_name":"NilCheck","description":"Consyncful::HeTohuEventsController#assign_event_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/he_tohu_events_controller.rb","lines":{"begin":29,"end":29}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4abc611bf7cf777f6db6289e5eeac2aa","type":"issue","check_name":"NilCheck","description":"Consyncful::HeTohuEventsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/he_tohu_events_controller.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ca3740e72013f91988ee89c6b52cf10a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::PagesController#render_page calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":34,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"63c69af65d37cce3e793e9faca0e99f4","type":"issue","check_name":"NilCheck","description":"Consyncful::PagesController#find_image_data_by_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":50,"end":50}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c8dda99155cc685fc08505eb0aa34cd2","type":"issue","check_name":"NilCheck","description":"Consyncful::PagesController#home performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27e90e08e4fb7fffcf459a1d3918de10","type":"issue","check_name":"UtilityFunction","description":"Consyncful::PagesController#find_image_data_by_path doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/pages_controller.rb","lines":{"begin":49,"end":49}},"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":"aadceadbc518faaa6776dfd3953674af","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SchoolsEventsController#assign_event_page calls '@page.redirect_url' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/schools_events_controller.rb","lines":{"begin":27,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"41f6b3d6012b29b625f0663daf00a9b7","type":"issue","check_name":"NilCheck","description":"Consyncful::SchoolsEventsController#assign_event_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/schools_events_controller.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5eb58df8426b8fd2444d21b0c01a211","type":"issue","check_name":"NilCheck","description":"Consyncful::TuiaMataurangaPagesController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/consyncful/tuia_matauranga_pages_controller.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be956a117b623368dd70b848ccc2be98","type":"issue","check_name":"DuplicateMethodCall","description":"Documents::EncryptedBlobsController#show calls 'params[:document_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/documents/encrypted_blobs_controller.rb","lines":{"begin":22,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a42d688ecaa1abc38364d22c1e2ca76e","type":"issue","check_name":"UncommunicativeMethodName","description":"Documents::EncryptedBlobsController#render_404 has the name 'render_404'","categories":["Complexity"],"location":{"path":"app/controllers/documents/encrypted_blobs_controller.rb","lines":{"begin":39,"end":39}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Method Name` is a method 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":"4c3b36c17ad93e6dfba2eef2a4dba156","type":"issue","check_name":"DuplicateMethodCall","description":"Form::CataloguingInPublicationsController#create calls 'request.path' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/form/cataloguing_in_publications_controller.rb","lines":{"begin":12,"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":"f0c8383fade311c2d6b67bb887b36be8","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsController#search_params calls 'object_params[:i]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":46,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e5874b7ffb3b8b17dbe4196d31a81e8","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsController#search_params calls 'params[:search]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":42,"end":42}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4ef0a13e19e5343219f19bfdf3949393","type":"issue","check_name":"FeatureEnvy","description":"ItemsController#search_params refers to 'object_params' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":42,"end":47}},"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":"bdce5207e9ec63ce2b0965c15a60d300","type":"issue","check_name":"TooManyInstanceVariables","description":"ItemsController has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/items_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b2f6ee089f5b98d77c88cbf2603efe80","type":"issue","check_name":"NilCheck","description":"LibrariesController#assign_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/libraries_controller.rb","lines":{"begin":32,"end":32}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d04673f3f042eb3db60bc4e755b8b6a4","type":"issue","check_name":"ControlParameter","description":"NewsletterSignupsController#page_by_type is controlled by argument 'type'","categories":["Complexity"],"location":{"path":"app/controllers/newsletter_signups_controller.rb","lines":{"begin":29,"end":29}},"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":"428e56413e09458d4d1d2b388f62ccdd","type":"issue","check_name":"TooManyInstanceVariables","description":"NewsletterSignupsController has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/newsletter_signups_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b82f199451105b2297828ef10815433c","type":"issue","check_name":"UtilityFunction","description":"NewsletterSignupsController#page_by_type doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/newsletter_signups_controller.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b17747cdb4414cb77e54ba78d4732e66","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#build_geo_points calls 'tapuhi_geo.placename' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":34,"end":41}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8ca121b75e2b794f94705b75d8b11e31","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#index calls 'facet.name == 'place_authority_id'' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cc812276f89530c2a40a5f4b03175b4d","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#index calls 'facet.name' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":16,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9b56507a2fdfdde61ee0366d5b5818b3","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesController#index calls 'params[:geo_bbox]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":13,"end":13}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d247c77f951598c8b140ca22a232dc2e","type":"issue","check_name":"FeatureEnvy","description":"PlacesController#build_geo_points refers to 'tapuhi_geo' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":32,"end":41}},"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":"627554aab45237f2a1222823dff47a45","type":"issue","check_name":"NilCheck","description":"PlacesController#build_geo_points performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"23cc21860d1b373276e982ecc620f211","type":"issue","check_name":"TooManyInstanceVariables","description":"PlacesController has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6b499dbaf5f3860107755d55c2c8cc24","type":"issue","check_name":"TooManyStatements","description":"PlacesController#index has approx 12 statements","categories":["Complexity"],"location":{"path":"app/controllers/places_controller.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"b642755d68431ef5edbd54015212251e","type":"issue","check_name":"NilCheck","description":"RauemiAIpurangi::PouController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/rauemi_a_ipurangi/pou_controller.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"faeaa6936b8ffd84e5d21a43ee7aa42d","type":"issue","check_name":"NilCheck","description":"RauemiAIpurangi::RauemiController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/rauemi_a_ipurangi/rauemi_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"96310a51ae721687edaa4762d0502461","type":"issue","check_name":"NilCheck","description":"RauemiAIpurangi::WhareTupunaController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/rauemi_a_ipurangi/whare_tupuna_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cfe705012bea3408fc8a05f336ecd745","type":"issue","check_name":"NilCheck","description":"ResearchPaymentsController#pay performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/research_payments_controller.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a7002507f60e7739cfb9af5a62e48e5","type":"issue","check_name":"NilCheck","description":"ResearchPaymentsController#success performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/research_payments_controller.rb","lines":{"begin":42,"end":42}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"32f1993dc33a76e4319e1935b41ff6ed","type":"issue","check_name":"TooManyStatements","description":"ResearchPaymentsController#callback has approx 11 statements","categories":["Complexity"],"location":{"path":"app/controllers/research_payments_controller.rb","lines":{"begin":16,"end":16}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"092a01c4bc4dca60a933006c4268bbba","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsController#show calls '@topic.name' 3 times","categories":["Complexity"],"location":{"path":"app/controllers/schools/topics_controller.rb","lines":{"begin":18,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c277c4aa63f840feab83902c52868f62","type":"issue","check_name":"TooManyInstanceVariables","description":"Schools::TopicsController has at least 7 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/schools/topics_controller.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3c7b690dc3f748012264732255653913","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::CartItemsController#index calls 'params[:return_to]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/cart_items_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1899ed97baf3206940a5e42322318e2e","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrdersController#update_order_items_requester_ip calls 'request.env' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":91,"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":"971505342303ab51d93af685feb6943c","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrdersController#update_order_items_requester_ip calls 'request.env['HTTP_X_FORWARDED_FOR']' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":91,"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":"325bdfedeed4e3786014e78c722e2e4e","type":"issue","check_name":"FeatureEnvy","description":"Shop::OrdersController#unavailable_item_titles refers to 'titles' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":114,"end":115}},"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":"be5c82496a9716ec8422e4c6e0926761","type":"issue","check_name":"MissingSafeMethod","description":"Shop::OrdersController has missing safe method 'redirect_to_sign_in!'","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":98,"end":98}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"12ead608bcd8065c0a6974a89ef2258e","type":"issue","check_name":"NilCheck","description":"Shop::OrdersController#complete performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":52,"end":52}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"15ab8fe2ec9472f7c8986e06fa680b29","type":"issue","check_name":"NilCheck","description":"Shop::OrdersController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1bc6d933e60e53aafe35f33fbb6f2322","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::OrdersController has at least 7 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/shop/orders_controller.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9e4ff3c2059781415c2a10c1966971d2","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::PurchaseController#callback calls 'shop_order_path(@order)' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/purchase_controller.rb","lines":{"begin":44,"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":"ba8465c91a7e489c185d21f618d0117c","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::PurchaseController#callback calls 't('shop.orders.payment_fail')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/shop/purchase_controller.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":"e1cf4da71024807bcbce4a13b3914d65","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesController#show calls 'params[:slideshow_gallery_block_id]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/stories_controller.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3266ed7226daaaad2590f4292061a2e","type":"issue","check_name":"DuplicateMethodCall","description":"TePunaDonationsController#callback calls 'params[:result]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":39,"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":"34fa67d5370dc6e99739e54027994fec","type":"issue","check_name":"DuplicateMethodCall","description":"TePunaDonationsController#callback calls 'redirect_to te_puna_donations_path, alert: t('te_puna_donations.payment_fail')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":62,"end":69}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9ae3b51a56654fb8c4846a35f7f08f39","type":"issue","check_name":"DuplicateMethodCall","description":"TePunaDonationsController#callback calls 't('te_puna_donations.payment_fail')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":62,"end":69}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff9eee782b7840dcbed8d06a04e458a9","type":"issue","check_name":"NilCheck","description":"TePunaDonationsController#callback performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":39,"end":39}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e39148d33c275e0eddd44bb9a3ba26f7","type":"issue","check_name":"TooManyStatements","description":"TePunaDonationsController#callback has approx 15 statements","categories":["Complexity"],"location":{"path":"app/controllers/te_puna_donations_controller.rb","lines":{"begin":38,"end":38}},"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, &error)\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, &error))[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":"c729a34508d1d0f4226ddae7af66e974","type":"issue","check_name":"DuplicateMethodCall","description":"TermsController#search calls 'params[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/terms_controller.rb","lines":{"begin":47,"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":"e6f1a74e6d774fe79bcd4a782b9cdf94","type":"issue","check_name":"NilCheck","description":"TermsController#show performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/terms_controller.rb","lines":{"begin":59,"end":59}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"afaf1f12f9a89f816fddfbdf0d8f3797","type":"issue","check_name":"TooManyInstanceVariables","description":"TermsController has at least 12 instance variables","categories":["Complexity"],"location":{"path":"app/controllers/terms_controller.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8402414cb0eec6a6882626f2c1804877","type":"issue","check_name":"DuplicateMethodCall","description":"Users::FavouritesController#show calls 'I18n.t('users.favourites.add_to_favourites_success_message_html')' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/favourites_controller.rb","lines":{"begin":20,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1fdd758b07cf0697f2f6e5c8bc8ff72e","type":"issue","check_name":"DuplicateMethodCall","description":"Users::OmniauthCallbacksController#realme calls 'Rails.logger' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/omniauth_callbacks_controller.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d7fa6f1c108a2edd5eabd1a2c4f0adb6","type":"issue","check_name":"DuplicateMethodCall","description":"Users::OmniauthCallbacksController#realme calls 'request.env' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/omniauth_callbacks_controller.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"961f368e0087bdc80be5677733a2e8b3","type":"issue","check_name":"TooManyStatements","description":"Users::OmniauthCallbacksController#realme has approx 13 statements","categories":["Complexity"],"location":{"path":"app/controllers/users/omniauth_callbacks_controller.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"ed732c53959f086d84768302ac20fb6f","type":"issue","check_name":"FeatureEnvy","description":"Users::RegistrationsController#send_epic_authorisation_email refers to 'profile' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":46,"end":49}},"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":"414d63b9d8187cf5c9094747108bde69","type":"issue","check_name":"NilCheck","description":"Users::RegistrationsController#create performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1faf3bb42f1322f49c79bddcffc340d2","type":"issue","check_name":"NilCheck","description":"Users::RegistrationsController#send_epic_authorisation_email performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":41,"end":41}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e83fc7a07b7cb14a3f0028baa20e1d28","type":"issue","check_name":"UtilityFunction","description":"Users::RegistrationsController#update_resource doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/controllers/users/registrations_controller.rb","lines":{"begin":59,"end":59}},"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":"4db3af174be966f589a9155559b04214","type":"issue","check_name":"DuplicateMethodCall","description":"Users::SessionsController#allowed_origin? calls 'params[:origin]' 2 times","categories":["Complexity"],"location":{"path":"app/controllers/users/sessions_controller.rb","lines":{"begin":46,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1128c0792a9f29e19b0307ce992f050d","type":"issue","check_name":"NilCheck","description":"Users::SessionsController#create performs a nil-check","categories":["Complexity"],"location":{"path":"app/controllers/users/sessions_controller.rb","lines":{"begin":26,"end":32}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e70983e5e6477e08356b73921e9cac9f","type":"issue","check_name":"BooleanParameter","description":"ApplicationHelper#javascript_includes has boolean parameter 'reading_rooms'","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":114}},"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":"71afcef4ecd94016f7ccfc2b6aa56209","type":"issue","check_name":"ControlParameter","description":"ApplicationHelper#javascript_includes is controlled by argument 'reading_rooms'","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":127,"end":127}},"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":"42f33839eb6917867e765266fd205c2b","type":"issue","check_name":"ControlParameter","description":"ApplicationHelper#present is controlled by argument 'presenter_class'","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":92,"end":92}},"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":"b68e76527d39f973a1cad53e643abf3d","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#active_tab calls 'options[:count]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":37,"end":37}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ee804dca2b49320543b6e8589520a5df","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#active_tab calls 'options[:html]' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":23,"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":"ae092bc07a2c3e065e7d5d47bca6f200","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_includes calls 'request.path' 13 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":120,"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":"2293923a815e2e15b7a47cedcb844432","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_includes calls 'request.path.starts_with?('/schools')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":129,"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":"c960ec2d6fe902c250c1a88d1b39ff88","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_packs calls 'javascript_pack_tag('slideshow_gallery_block')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":177,"end":183}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0e219c2c3793ad1abc8999352b2560a","type":"issue","check_name":"DuplicateMethodCall","description":"ApplicationHelper#javascript_packs calls 'widget.name' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":191,"end":193}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"33d80438d6c914f4d677344de120e1e7","type":"issue","check_name":"ManualDispatch","description":"ApplicationHelper#javascript_packs manually dispatches method call","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":179,"end":179}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88ed8a8eca711edd33c6972b6b4d12ba","type":"issue","check_name":"NilCheck","description":"ApplicationHelper#javascript_packs performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":173,"end":173}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9e66a09f4e89d0b5900cff1521f1608e","type":"issue","check_name":"NilCheck","description":"ApplicationHelper#site_title performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":62,"end":62}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ba8441dddadb4047cf4b0b99d0892cf6","type":"issue","check_name":"TooManyStatements","description":"ApplicationHelper#active_tab has approx 21 statements","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":6,"end":6}},"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, &error)\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, &error))[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":"8580449a7e43c7ea6efb5abdb56923cb","type":"issue","check_name":"TooManyStatements","description":"ApplicationHelper#javascript_includes has approx 15 statements","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":114,"end":114}},"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, &error)\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, &error))[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":"8da4a0e04e072d669c5053f6060998d1","type":"issue","check_name":"TooManyStatements","description":"ApplicationHelper#javascript_packs has approx 19 statements","categories":["Complexity"],"location":{"path":"app/helpers/application_helper.rb","lines":{"begin":166,"end":166}},"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, &error)\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, &error))[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":"3a48070add59757871828d85e447abe7","type":"issue","check_name":"DuplicateMethodCall","description":"CartItemsHelper#item_price calls 'item.price' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/cart_items_helper.rb","lines":{"begin":10,"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":"94f95efc1db1c2b3da7e044c4895cb85","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs calls 'breadcrumb.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":28,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"37abb34586778aab3e756f69a376ebcd","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs calls 'tag.li' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":27,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2e3b7e1aa564b520085e0f2d7a81d2f0","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":19,"end":28}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"873f16ab54c47808041ee969ed82c031","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulBreadcrumbsHelper#render_breadcrumbs has approx 11 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_breadcrumbs_helper.rb","lines":{"begin":18,"end":18}},"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, &error)\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, &error))[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":"8779a76a19d6555ab2b5a16cb4a11d0f","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_calendar_date calls 'day.day' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":59,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"74e56938e329f1fb425ed1193a7443a8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_calendar_date calls 'day.month' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":57,"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":"12747d93e2d9365794bb1ee62f534c5b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_calendar_date calls 'tag.div(class: css_classes)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.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":"996747534e5429755f02320a14f443fe","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_day' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":30,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01dd1c2429b56d44260396d267f12468","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_day.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":30,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"32706b66627d5315d7f6a4a4f749b30d","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_month' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":24,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"275263241ca9b24b901a0e6f4cc4e246","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":27,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"15453347f54bad2ae049f890e0fb51e3","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'date.next_year.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":27,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ce87772c56ea5a53eda9be4cc237a6b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'icon('fa-regular', 'arrow-right')' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":24,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"23e6b506029466833e9b2c153e59fc9b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_next_events calls 'sanitize text' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":25,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88a7106498736d74eeb5223dbe7758e8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_day' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5667d0671bb1b29cc993ed7fd29688a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_day.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"38020a9f0d16a54befe01c93950f97e7","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_month' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":8,"end":9}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"49dd06664638ff2ea2cebb81fc1c7e63","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.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":"535cc7e7f696d2b7210ec90ece76c328","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'date.prev_year.year' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.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":"b83382fc4d2a98ea168dd509acfdca21","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'icon('fa-regular', 'arrow-left')' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":8,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ef373c7ceb43665a62507d418a7e9ccb","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulEventsHelper#consyncful_previous_events calls 'sanitize text' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_events_helper.rb","lines":{"begin":9,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ca8e1f7c3655331c3bb63a5c8a305cf7","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches has boolean parameter 'nested'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":89}},"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":"b90cc985c50b1c4baa78e67e004e05b2","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree_branches has boolean parameter 'nested'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":126,"end":126}},"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":"3ccf731afec90ef2529cca8e8468cc57","type":"issue","check_name":"ControlParameter","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches is controlled by argument 'nested'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":93,"end":93}},"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":"80770cba39a7f6fa62d89c8ba08e0002","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.active' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":98,"end":102}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3e2a6745535fca385b02c63fd5bacd77","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.descendants' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":97,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1f272cea77784f7a5e3adcb9df6615f8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.href' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":99,"end":102}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac2bb4ebad47376320df1c85df664626","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches calls 'branch.title' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":99,"end":102}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"814979ba6a1117fb9b1a1d89e85c6393","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents calls 'parent.active' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":68,"end":78}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3f03f9777f995feaf44604d0145c4e8","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents calls 'parent.href' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":67,"end":80}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ddba1f855dfad0aa1d685c5e53cd7d22","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents calls 'parent.title' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":67,"end":80}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fda5a4d678b567693e5830294909126e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_root calls 'root_branch.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":47,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d41e2114fac5b061df11a56e9205dfa7","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_widget calls 'tag.span' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":23,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"395056eb2f889f7f2cc5f8035ddf9e3d","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_ids calls 'SecureRandom.hex(10)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":189,"end":190}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2a82026c27cbdd87e9bc6d81edc163b6","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li calls 'branch.descendants' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":177,"end":181}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a29d3c62739bd8b3962f141f3c6c51c","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li calls 'branch.href' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":171,"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":"019d2a38acfa85f06057a1a2e833c46e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li calls 'branch.title' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":172,"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":"07066ff5fe0e6f3ba24e893047d781d8","type":"issue","check_name":"LongParameterList","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches has 5 parameters","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0890e4217a7c949e9c0325283fee20e9","type":"issue","check_name":"LongParameterList","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree_branches has 5 parameters","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":126,"end":126}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0ab9ff287b38c87ef717121134ee245","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_root performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":42,"end":42}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0ab9ff287b38c87ef717121134ee245","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_widget performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2f7a4966d492fa3edef8d97fe3bfa822","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":171,"end":171}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b63f8cfc0ab6eae899df7242b9cdbd6c","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dca60c630d8a26137118590a94ea4416","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":114,"end":114}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d10358a5f2cebfe7d2f73e452c1e1771","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_branches has approx 14 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"672c49dac440c896eba98d65eba990b7","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_parents has approx 21 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":54,"end":54}},"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, &error)\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, &error))[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":"79880e78143a49616135c0e1c4ded369","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#mobile_nav_widget has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":16,"end":16}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"2dbeadd89f8423bfa94c064816571c98","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#nav_branch_li has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":164,"end":164}},"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, &error)\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, &error))[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":"2bb59a9761ca4746e45eab652fe13857","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulNavHelper#render_mobile_nav_tree_branches has approx 11 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_nav_helper.rb","lines":{"begin":126,"end":126}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"342ffd165c6c45c3ec4abfbf88c5846a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulPagesHelper#formsite_prepopulate_json calls 'request.params' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_pages_helper.rb","lines":{"begin":57,"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":"67e5861b999acbf20c414cffab5de974","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulPagesHelper#formsite_prepopulate_json calls 'request.params[:course_id]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_pages_helper.rb","lines":{"begin":57,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8f2bf667f2d938c7c9a04e0db5887d34","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulPagesHelper#render_page_part_body performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_pages_helper.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c0b20ee8e3eeb644b56eebbf3a3ee99a","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery has boolean parameter 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":60,"end":60}},"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":"550ab424e71ac3d3ce134c8d73ae747e","type":"issue","check_name":"BooleanParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_slideshow_gallery_image_link has boolean parameter 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":54,"end":54}},"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":"8f88da208439b41869c8414418ae0dac","type":"issue","check_name":"ControlParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery is controlled by argument 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":65,"end":65}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9cbfc44e2c979332ac90550c83cf746e","type":"issue","check_name":"ControlParameter","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path is controlled by argument 'image_view'","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.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":"18c3d5f186796012573886672a4814b3","type":"issue","check_name":"DataClump","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper takes parameters ['page', 'part'] to 3 methods","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":15,"end":37}},"remediation_points":250000,"content":{"body":"In general, a `Data Clump` occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.\n\nThe recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def x(y1,y2); end\n def y(y1,y2); end\n def z(y1,y2); end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)\n```\n\nA possible way to fix this problem (quoting from [Martin Fowler](http://martinfowler.com/bliki/DataClump.html)):\n\n> The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d80db47af69f41e7396b6f25a3cd8f75","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'page.image_exhibition?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":44,"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":"6b078bd09c6afce03228d8ea56b3fa22","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'slideshow_image.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":43,"end":44}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"23513087c6863bbdf809f3ce75fa019e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'slideshow_image.image_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":41,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"229dbef42ada07c5a10b5cf7800acba2","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery calls 'slideshow_image.title' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":44,"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":"8ce1e4590516c785b80d5e449a9a1c75","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery calls 'card.image' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":66,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"95c6a97ba61c9bcdd9ac1077afbadc74","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery calls 'card.image.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":66,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"407c5094f768c8d2d116b908fb4dcb84","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'page.image_exhibition?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":30,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b18d7aa38fda036147145b4468401f0a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'part.story' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":26,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fe31b3dcc31672a94547267fa302b043","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'record.content' 5 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":27,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"91356d6b585b36f52ff6353f29d5c5a4","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'record.content.image_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":27,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6065fdddaa43bc7378bcf9789495c913","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery calls 'record.content.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":30,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9e6593d801803de91f12bb0c6c1f719","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path calls 'request.path' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":83,"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":"bc96acd28ecee82cee19c669e68943f9","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path calls 'request.path.split('/')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":83,"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":"0c954a3896112754ffe334fdd4f49817","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_galleries_browse_path calls 'request.path.split('/').tap(&:pop)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":83,"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":"58381281cf031c705ea8194f7161b9ae","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_image_current_page calls 'slideshow_gallery_block.slideshow_images' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b326f22ff9eca67f69d848b4027e643e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_image_current_page calls 'slideshow_gallery_block.slideshow_images.in_order' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":89,"end":89}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c234ad4a9f09b8642bb0aa60fb004d9","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":38,"end":41}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a7c75d676fe107d00db8f5c7da0305c7","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":61,"end":61}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3fcb7ebe952d54f4f8d4c7bf0b5a2637","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_story_slideshow_gallery performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":24,"end":27}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"33e8b20971aa455545366bf529e38b8e","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#related_slideshow_gallery_image_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":55,"end":55}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"318871790eefebacde3cef569a80bb8d","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_gallery_image_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bbd2858cf3d45387c59470d62e778f52","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#slideshow_image_current_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":87,"end":87}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a220e8d9b0e4ba2b5f98e9f1f65defde","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_contentful_slideshow_gallery has approx 11 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":37,"end":37}},"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, &error)\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, &error))[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":"b8390938d73b304ab381cbde42ac3ddd","type":"issue","check_name":"TooManyStatements","description":"Consyncful::ConsyncfulSlideshowGalleriesHelper#image_links_for_related_slideshow_gallery has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_galleries_helper.rb","lines":{"begin":60,"end":60}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"0d7b1df34476d3acd51c92000073bce9","type":"issue","check_name":"NilCheck","description":"Consyncful::ConsyncfulSlideshowImagesHelper#slideshow_image_nav_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/consyncful/consyncful_slideshow_images_helper.rb","lines":{"begin":6,"end":6}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d1fedeeb07cc04933ac4871d0b7306a9","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#filter_title calls 'value.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":23,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5fc4cbb948f94e2adde9ad6e847f0033","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#link_to_lock_filter calls 'search_options[:il]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":99,"end":100}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"32d9f4fdd5ae67a596cb9726a0d23619","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#year_filter_title calls 'Regexp.last_match(1)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":82,"end":82}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"468c0b56a650ea932255906f11d27e8f","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#year_filter_title calls 'Regexp.last_match(2)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":83,"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":"33f5aa741771339ae88b365134b0897f","type":"issue","check_name":"DuplicateMethodCall","description":"FacetsHelper#year_filter_title calls 't('items.search.filters.any')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.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":"e0689d9b185f08207403f787026f9b39","type":"issue","check_name":"LongParameterList","description":"FacetsHelper#link_to_lock_filter has 5 parameters","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":97,"end":97}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a02e5a97bf13a1c7b0ed5547d6559e22","type":"issue","check_name":"TooManyStatements","description":"FacetsHelper#filter_title has approx 14 statements","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":10,"end":10}},"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, &error)\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, &error))[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":"b94fc795dd92490209996c1427c34cf0","type":"issue","check_name":"UncommunicativeVariableName","description":"FacetsHelper#link_to_lock_filter has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":98,"end":102}},"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":"9130bcf833dae7249c898fbb3eb55d1d","type":"issue","check_name":"UncommunicativeVariableName","description":"FacetsHelper#link_to_lock_filter has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/helpers/facets_helper.rb","lines":{"begin":102,"end":102}},"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":"85f6f14f0c2c09926b24c67339e9fd6f","type":"issue","check_name":"DuplicateMethodCall","description":"FormsHelper#errors_for calls 'form.object' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":7,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"427368553300443a97135fcdaa8b95da","type":"issue","check_name":"DuplicateMethodCall","description":"FormsHelper#errors_for calls 'form.object.errors' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":7,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3dc5f14d197f26aba419fefd35acfa09","type":"issue","check_name":"DuplicateMethodCall","description":"FormsHelper#errors_for calls 'form.object.errors[field]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":7,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"722ca0bd7fd54dc8905f16b5c86fdfb0","type":"issue","check_name":"UnusedParameters","description":"FormsHelper#inline_error has unused parameter 'attribute'","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":4,"end":4}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be562515b68bbe5eb4996bd02fb4e8c2","type":"issue","check_name":"UnusedParameters","description":"FormsHelper#inline_error has unused parameter 'object'","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":4,"end":4}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"11a1f62a434e6de259fc83201fc05cda","type":"issue","check_name":"UnusedParameters","description":"FormsHelper#inline_error has unused parameter 'options'","categories":["Complexity"],"location":{"path":"app/helpers/forms_helper.rb","lines":{"begin":4,"end":4}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2b3a38b6591e3212263619bafc426af5","type":"issue","check_name":"DuplicateMethodCall","description":"GlobalNavigationHelper#active_sub_nav_css calls 'request.path' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/global_navigation_helper.rb","lines":{"begin":28,"end":30}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"79b15b5f5494d57f7dce0a295e467697","type":"issue","check_name":"DuplicateMethodCall","description":"ImagesHelper#lazy_image_tag calls 'options[:class]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":26,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d98862d5440ed5dcd944892927c01d6c","type":"issue","check_name":"DuplicateMethodCall","description":"ImagesHelper#unicon calls 'options[:class]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":48,"end":49}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"abe8b861b298dfd529b4cfeee1c9e143","type":"issue","check_name":"DuplicateMethodCall","description":"ImagesHelper#unicon calls 'tag.div(class: wrapper_class)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":60,"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":"8c7eed20df0b839a605905aca4eb3afe","type":"issue","check_name":"NilCheck","description":"ImagesHelper#lazy_image_tag performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":20,"end":20}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d87fd5f937c660526ca87f7bde1604bc","type":"issue","check_name":"TooManyStatements","description":"ImagesHelper#unicon has approx 16 statements","categories":["Complexity"],"location":{"path":"app/helpers/images_helper.rb","lines":{"begin":41,"end":41}},"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, &error)\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, &error))[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":"15716d15577a285e61e0dc90ffa82b16","type":"issue","check_name":"BooleanParameter","description":"ItemsHelper#reference has boolean parameter 'show_label'","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":190,"end":190}},"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":"a83d56d83ae9356b657d7b16e331028b","type":"issue","check_name":"ControlParameter","description":"ItemsHelper#reference is controlled by argument 'show_label'","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":193,"end":193}},"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":"eac6ab3af3d2c03c29485fe8c162bc7f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#build_thumbnail_src calls 'item.book_cover_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":38,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6332b190fa7a0d3e26fbdff8ec1ca5c9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'attribute(item, :copyright)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":169,"end":178}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d8baa1bc3fdb17f0d1489cc6f35de83","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.copyright' 7 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":164,"end":175}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aa7b3d552886334c03be8cb6d0ded208","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.copyright.first' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":172,"end":175}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e4b5983e6e65f6dd8cb6c435ef2f182e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.copyright.present?' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":164,"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":"aaef05fcd09ea67ecc56943b7bf77534","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'item.rights_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":170,"end":171}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"802b0a427926c07682a2db1be35150da","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 'safe_join([t('items.details.copyright_html'), content])' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":173,"end":176}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a89c551bd459a6213945937432dd7081","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#copyright_field calls 't('items.details.copyright_html')' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":165,"end":176}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7f01a4a31768e60c0ae38b4ededdb4b2","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 'item.shelf_location' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":207,"end":207}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e22403f418a942ea6d4e598cc36f95ef","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 't('items.details.rights_text.credit_line')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":216,"end":218}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a00dace9e5126c46a16548ed2b03b32","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 'tag.p { t('items.details.rights_text.credit_line') }' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":216,"end":218}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1ba036527bf7775ff9439472c06ad86b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line calls 'tag.p' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":216,"end":218}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f5685ce05db126e570cc7880d59d8252","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line_intro_text calls 'contents << t('items.details.rights_text.credit_line_html')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":231,"end":233}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a42c0c0bfd6948381482e3fda40d415","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#credit_line_intro_text calls 't('items.details.rights_text.credit_line_html')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":231,"end":233}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6e368311c94b7866f65902085aac0b8f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#defined_thumbnail_url calls 'item.attachment' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":47,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01e35fbfa5c2c54d41553a097209d5b1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#display_attachment_image calls 'attachment.name' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":333,"end":334}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b31fc4e9aa6dd6f48fdf666fc1135af","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#display_attachment_image calls 'attachment.small_thumbnail_endpoint' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":331,"end":334}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3798223b3259d35deac16b716a352d1b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#display_item_type calls 'item.category' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":68,"end":71}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f0c7533d5c73e60e40b7d275e45ee8a1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#full_image calls 'item.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":255,"end":261}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1c2974314336189d5d87bf8544eae03e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#full_image calls 'item.object_url' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":261,"end":263}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8894f6cd487f360ea278e6f18a10809c","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#link_to_item calls 'args[0]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":389,"end":393}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3d037299263e69650c28297b07c9dce1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#link_to_item calls 'args[1]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":390,"end":394}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"be162f2bc333f38dd7966fc19efe1fb3","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#link_to_item calls 'args[2]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":391,"end":395}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bed1ce1014d7a02971fa00cb95abdbc2","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#ndha_button_text calls 'item.ndha_access_level' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":374,"end":374}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dbbbb5f8c3409eafe8883dd093879f56","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#nz_libraries_external_link calls 'item.is_version_of' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":96,"end":98}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c63404fcc7398ca57c603d4b85bac912","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#open_graph_description calls 'item.description' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":294,"end":294}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"45b803ab08d3b9d6de5bc2597c708145","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#open_graph_description calls 'meta_description.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":290,"end":292}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"890b7ff90ce61c1c4c08f439db95ccfb","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#open_graph_image calls 'item.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":300,"end":300}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3a72053683f8f2003aa405cf09a2653b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#order_attachment_button calls 'attachment_id(item.id, attachment_dc_identifier)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":347,"end":350}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1c4a064147339c26cbb66e54a23f7cdb","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#order_attachment_button calls 'item.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":347,"end":350}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"900499701cd2049f5b460f4ec942c4a6","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#order_attachment_button calls 't('shop.cart.order_copy')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":350,"end":352}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ea3256556353100d3813a008a9663a9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#placeholder_image_path calls 'item.category' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":81,"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":"4c7bd2bc2300b2628781e82977b72d3b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#purchasing_item calls 'item.orderable?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":145,"end":155}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c624a41289da2a5a02b0236ed30a637","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#reference calls 'item.shelf_location' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":191,"end":194}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b1cda94b070fc6aec8ebcf8e7cab3c25","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#related_items_count calls 'request.url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":245,"end":249}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d95f20ec645c796543eb491f31637f4b","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#render_alt_facets? calls 'facet.values' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":366,"end":366}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"87d11f920dbe2c58a0c2f9c53b6387b6","type":"issue","check_name":"DuplicateMethodCall","description":"ItemsHelper#thumbnail_endpoint calls 'ENV['THUMBNAIL_SERVER_URL']' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":55,"end":57}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"57643f3128aba7cca8bbdbe6eaaa8b52","type":"issue","check_name":"NilCheck","description":"ItemsHelper#open_graph_description performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":288,"end":288}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"643daffa3d93ce02a7ec63cedc142220","type":"issue","check_name":"NilCheck","description":"ItemsHelper#open_graph_image performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":300,"end":300}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8ec05766572d122e4382380e1ffb32a6","type":"issue","check_name":"NilCheck","description":"ItemsHelper#open_graph_title performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":284,"end":284}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"705c77ee5701b7022ca65a1f33030836","type":"issue","check_name":"TooManyStatements","description":"ItemsHelper#credit_line has approx 18 statements","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":197,"end":197}},"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, &error)\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, &error))[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":"8335e34e888a967c7382cfc5fdaf6556","type":"issue","check_name":"TooManyStatements","description":"ItemsHelper#rights_field has approx 13 statements","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":105,"end":105}},"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, &error)\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, &error))[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":"66720bc189417566aa3f47e4c147f651","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemsHelper#rights_field has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/helpers/items_helper.rb","lines":{"begin":123,"end":123}},"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":"a70114401e762b6f631b9df69b0eb80a","type":"issue","check_name":"DuplicateMethodCall","description":"LibrariesHelper#charges_row calls 'content_tag(:td)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ce7cb24692af7c91ce036a3bcb6ba28d","type":"issue","check_name":"DuplicateMethodCall","description":"LibrariesHelper#charges_row calls 'international.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":19,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d21f04bb79c7393d6fa3c58f3cbba0b","type":"issue","check_name":"DuplicateMethodCall","description":"LibrariesHelper#charges_row calls 'standard.present?' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":19,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d31d8312f0b7a391991f91ebe183abe7","type":"issue","check_name":"NilCheck","description":"LibrariesHelper#generate_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/libraries_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cddab3221a496b28976cebaede21a315","type":"issue","check_name":"ControlParameter","description":"LinkHelper#update_email_links is controlled by argument 'email'","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":29,"end":29}},"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":"4f9021b41359bc5296000fe86c410445","type":"issue","check_name":"DuplicateMethodCall","description":"LinkHelper#generate_mailto_header calls 'options[header]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":38,"end":38}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f99f576ed9e4708680a06cdfb320a6ee","type":"issue","check_name":"DuplicateMethodCall","description":"LinkHelper#update_email_links calls 'anchor.attributes' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":24,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e58a18a4ad27951986eccca0b982cdee","type":"issue","check_name":"DuplicateMethodCall","description":"LinkHelper#update_email_links calls 'anchor.attributes['href']' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/link_helper.rb","lines":{"begin":24,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"398018c02a53ee34cc543cb5b8ec0184","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#thumbnail_tag calls 'ENV['THUMBNAIL_SERVER_URL']' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":11,"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":"64968811815020b07f2ef4aa8adf908a","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#thumbnail_tag calls 'options[:large_size]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":10,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b98e19560d5041fe7424f876ee8b43f9","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#thumbnail_tag calls 'options[:width]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":11,"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":"84f08230b1ff6ad2cae11284599820bf","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#undelivered_order_data_set calls 'order_item.item' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":25,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8330c159fbc751dc0f111e0256fced0c","type":"issue","check_name":"DuplicateMethodCall","description":"OrderDeliveriesHelper#undelivered_order_data_set calls 'order_item.item_id' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":24,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c8c1cab893aba81aba0daf05ffb08b9","type":"issue","check_name":"NilCheck","description":"OrderDeliveriesHelper#undelivered_order_data_set performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/order_deliveries_helper.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"79367caed08441089762925cc253001b","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'download_shop_order_order_item_path(order, order_item)' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":19,"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":"4500b6454e0b05ce98aff307e802cf10","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'link_to(t('shop.orders.available'), download_shop_order_order_item_path(order, order_item), class: button_class)' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"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":"3c0704bec0aed96dcf8158a37a3c2a72","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'order_item.price' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":50,"end":57}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cab5e371bb8ba1f987b3ee5442cf11c3","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 't('shop.orders.available')' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":34,"end":59}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"952cb4cc7a30a938ebba8dfaa1e5e7aa","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 't('shop.orders.download')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":40,"end":41}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"decae5814128209297a74d6f207b043a","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 't('shop.orders.retry')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":19,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d7f99515a8e831369deba414dcad731e","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.button(disabled: true, class: button_class) { t('shop.orders.available') }' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":35,"end":59}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"76dc87e9b161acda5279874befc24fdd","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.button(disabled: true, class: button_class)' 4 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":20,"end":59}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4696fcdf71e81274e4c8d7ff12ca9057","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.p' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":18,"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":"ef6e212623801ffa8d82852d3297c3cb","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.small' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":30,"end":65}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0d974ea6371b4fb95440c9b92fc562fa","type":"issue","check_name":"DuplicateMethodCall","description":"OrdersHelper#order_item_state_column calls 'tag.small(class: 'display-block')' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":23,"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":"7cedcfe10f816b00c30a57d17c4afff3","type":"issue","check_name":"TooManyStatements","description":"OrdersHelper#order_item_state_column has approx 31 statements","categories":["Complexity"],"location":{"path":"app/helpers/orders_helper.rb","lines":{"begin":8,"end":8}},"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, &error)\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, &error))[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":"774b338ec6dee8582b31d00e5a9fc1ae","type":"issue","check_name":"DuplicateMethodCall","description":"PlacesHelper#places_explanation calls 'search_object.text' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":21,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"952b9a0f4b52017385903464551b787b","type":"issue","check_name":"NilCheck","description":"PlacesHelper#current_places_filters performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dbf81aff152b87b2546ac3486870f527","type":"issue","check_name":"NilCheck","description":"PlacesHelper#places_explanation performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"84c4d66728d5fcba5ab1714cb02923a7","type":"issue","check_name":"TooManyStatements","description":"PlacesHelper#places_explanation has approx 13 statements","categories":["Complexity"],"location":{"path":"app/helpers/places_helper.rb","lines":{"begin":10,"end":10}},"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, &error)\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, &error))[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":"50b02de70776e07781ba98c84bc962b5","type":"issue","check_name":"UnusedParameters","description":"QuestionsHelper#display_value has unused parameter 'value'","categories":["Complexity"],"location":{"path":"app/helpers/questions_helper.rb","lines":{"begin":9,"end":9}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9431c09a2a9b838d6fb8b522f7da109e","type":"issue","check_name":"DuplicateMethodCall","description":"RecordsHelper#related_topics_results_path calls 'params[:search]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":17,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c81fe9c9133b15c684146f16538957fa","type":"issue","check_name":"DuplicateMethodCall","description":"RecordsHelper#related_topics_results_path calls 'params[:search][:i]' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":17,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8c73b253ce2c876d4d7431be204d1ab1","type":"issue","check_name":"DuplicateMethodCall","description":"RecordsHelper#view_status_button calls 'item.object_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":31,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c63e6b941ec32ad652ed97311a187006","type":"issue","check_name":"NilCheck","description":"RecordsHelper#text_to_paragraphs performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"40bac9ac1005a229db5235a14b74e3ce","type":"issue","check_name":"UncommunicativeVariableName","description":"RecordsHelper#text_to_paragraphs has the variable name 't'","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":11,"end":11}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8604edafd2a76a79b9af9d7a6fc17b6a","type":"issue","check_name":"UnusedParameters","description":"RecordsHelper#tab_class has unused parameter 'current_tab'","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":28,"end":28}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a80a8b70dcf507967aa8de63f59aad94","type":"issue","check_name":"UnusedParameters","description":"RecordsHelper#tab_class has unused parameter 'type'","categories":["Complexity"],"location":{"path":"app/helpers/records_helper.rb","lines":{"begin":28,"end":28}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d52c98c763615c78e66b198e525e9492","type":"issue","check_name":"ControlParameter","description":"Schools::PagesHelper#secondary_nav_active is controlled by argument 'link_url'","categories":["Complexity"],"location":{"path":"app/helpers/schools/pages_helper.rb","lines":{"begin":7,"end":7}},"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":"50776d716cd94299ae83f85a7f2f565d","type":"issue","check_name":"ControlParameter","description":"Schools::TopicsHelper#topic_active_css_class is controlled by argument 'filter'","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":125,"end":125}},"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":"cef1a2dd7c5566828afd0ecd5e4fb783","type":"issue","check_name":"ControlParameter","description":"Schools::TopicsHelper#topic_active_css_class is controlled by argument 'param'","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":125,"end":125}},"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":"8e7873cd27aeff8ee287218968c58c9b","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsHelper#topic_highlight_css_class calls 'topic.tags' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":13,"end":15}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9d168c069b9be191890df56db416fc3e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsHelper#topic_highlight_filter_class calls 'topic.tags' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d5308da85beab66aaa96b52e2a874685","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsHelper#topics_filter_by_type calls 'type.capitalize' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":44,"end":46}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac05798701f6e26d7e7a0b016a441282","type":"issue","check_name":"TooManyStatements","description":"Schools::TopicsHelper#topics_filter_by_area has approx 14 statements","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":60,"end":60}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"e59a5b4e9e62c8c694338244843f2d00","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::TopicsHelper#topic_css_class has the variable name 't'","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_helper.rb","lines":{"begin":97,"end":97}},"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":"cc2e1cc8d215e6b79443a5b4db073ec5","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_navigation calls 'content.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":141,"end":146}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9a668e3fdbe0658ba82ea16261a422c","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_navigation calls 'tag.span { direction_text }' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":143,"end":147}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2cd4c22996ff4c1d779e39e2b3212c1e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_navigation calls 'tag.span' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":143,"end":147}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3b16c2d244e3d90779e6dd7d259c9a9","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#record_modal_position calls 'topic.content_ids' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":124,"end":124}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5f25c79e5116759a796d9f1fa4956c5f","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#sort_records_by_area calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":98,"end":98}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e8231b7b87dc9e2debd747215dca3800","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#topic_record_image calls 'content.image_url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":51,"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":"a12453063547d58dc1659a675cb6c09b","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::TopicsRecordHelper#topic_record_image calls 'content.title' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.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":"9982f26f336e22175d747aec1d9558f6","type":"issue","check_name":"NilCheck","description":"Schools::TopicsRecordHelper#topic_record_image performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":49,"end":49}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ce7bb2e252edbeb7197e5746fe0b7f2","type":"issue","check_name":"TooManyStatements","description":"Schools::TopicsRecordHelper#record_modal_navigation has approx 12 statements","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":137,"end":137}},"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, &error)\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, &error))[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":"83c132496fe960fa372a87b904fc277a","type":"issue","check_name":"TooManyStatements","description":"Schools::TopicsRecordHelper#topics_filter_by_media_type has approx 13 statements","categories":["Complexity"],"location":{"path":"app/helpers/schools/topics_record_helper.rb","lines":{"begin":12,"end":12}},"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, &error)\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, &error))[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":"61e8e71d4148beea330e025d4b861907","type":"issue","check_name":"ControlParameter","description":"SearchHelper#show_if is controlled by argument 'boolean'","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":20,"end":20}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"48265f62ffeaca9f2874a83024465ac7","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_explanation calls 'search.page' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":11,"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":"a7bb2071e91da0080f97154f80cab468","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_explanation calls 'search.per_page' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":11,"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":"8ae43c03d3c3ce7ccc9584a30e44d4b7","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_explanation calls 'search.total' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":12,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f778f0909cfdaecacfa0011bec2d2f84","type":"issue","check_name":"DuplicateMethodCall","description":"SearchHelper#search_path calls 'search_params[:path]' 3 times","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6c7fc9e5354b17831bca0210217e7754","type":"issue","check_name":"NilCheck","description":"SearchHelper#render_search_filter_facet performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/search_helper.rb","lines":{"begin":51,"end":51}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e83d05db3c88477b55bf471a8b5bd140","type":"issue","check_name":"NilCheck","description":"SecureHttpUrlHelper#secure_http_url performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/secure_http_url_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"78c7314024b07762eb87e9b31d9623e5","type":"issue","check_name":"DuplicateMethodCall","description":"SharePageHelper#tweet_page_on_twitter_link calls 'request.url' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/share_page_helper.rb","lines":{"begin":18,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5eec567b9a83006684bed9afd81088df","type":"issue","check_name":"BooleanParameter","description":"SlideshowImagesHelper#slideshow_image_prev_next_link has boolean parameter 'remote'","categories":["Complexity"],"location":{"path":"app/helpers/slideshow_images_helper.rb","lines":{"begin":4,"end":4}},"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":"0a1d50f542f313e0cfa1401f5ed603f7","type":"issue","check_name":"NilCheck","description":"SlideshowImagesHelper#slideshow_image_prev_next_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/slideshow_images_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff79c0905baa1f468350ef13137603c6","type":"issue","check_name":"ControlParameter","description":"StoriesHelper#image_exhibition_story_record_nav_link is controlled by argument 'direction'","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":20,"end":20}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4fef128a7316443aae024bda216dc819","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#image_exhibition_image_path_for calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":9,"end":10}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2e6f681d4d1e1c45e182cbfe6f91a996","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#image_exhibition_story_record_nav_link calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":21,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ae0cd35d2f86fb33c9aee95aaed57d8","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#image_exhibition_story_record_nav_link calls 'record.content.id' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":21,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b86226938a36e5a2f6f1925350921418","type":"issue","check_name":"DuplicateMethodCall","description":"StoriesHelper#story_record_current_page calls 'story.record_ids' 2 times","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":38,"end":38}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f9c7a1e0ef3968b979a68928c3afee82","type":"issue","check_name":"NilCheck","description":"StoriesHelper#image_exhibition_image_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6c6ba330df52719a9041aa9c19d6ac98","type":"issue","check_name":"NilCheck","description":"StoriesHelper#image_exhibition_story_record_nav_link performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"52a153edde4c7e471ed03031d09a1e3e","type":"issue","check_name":"NilCheck","description":"StoriesHelper#story_record_current_page performs a nil-check","categories":["Complexity"],"location":{"path":"app/helpers/stories_helper.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"20ad174edcdb511abc0a3ca7771190a7","type":"issue","check_name":"ControlParameter","description":"TermsHelper#term_related_header is controlled by argument 'is_msh'","categories":["Complexity"],"location":{"path":"app/helpers/terms_helper.rb","lines":{"begin":5,"end":5}},"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":"9975c9ed53d71628f80d381d2e75b332","type":"issue","check_name":"UnusedParameters","description":"ViewingsHelper#text_to_html_break has unused parameter 'text'","categories":["Complexity"],"location":{"path":"app/helpers/viewings_helper.rb","lines":{"begin":9,"end":9}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"749ad4eaa260aa81d09e349a0823cd0a","type":"issue","check_name":"UnusedParameters","description":"ViewingsHelper#value_and_break has unused parameter 'value'","categories":["Complexity"],"location":{"path":"app/helpers/viewings_helper.rb","lines":{"begin":7,"end":7}},"remediation_points":200000,"content":{"body":"`Unused Parameter` refers to methods with parameters that are unused in scope of the method.\n\nHaving unused parameters in a method is code smell because leaving dead code in a method can never improve the method and it makes the code confusing to read.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n def unused_parameters(x,y,z)\n puts x,y # but not z\n end\nend\n```\n\nReek would emit the following warning:\n\n```\n[2]:Klass#unused_parameters has unused parameter 'z' (UnusedParameters)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2af624ac2cc3980ea1304c15e82626ce","type":"issue","check_name":"FeatureEnvy","description":"AdminOrderMailer#image_ordering_item_error_emails refers to 'emails' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.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":"91b6ee5e665d9320fc063a8cfe7d4e95","type":"issue","check_name":"NilCheck","description":"AdminOrderMailer#item_error performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":26,"end":27}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0badd81b005319e301f84c6b47556d18","type":"issue","check_name":"NilCheck","description":"AdminOrderMailer#new_order performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f5b7b23c085b243b3edebaf0871d6ea0","type":"issue","check_name":"NilCheck","description":"AdminOrderMailer#payment_completed performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4a8b36903b81f125daa7598dd1c88d62","type":"issue","check_name":"TooManyInstanceVariables","description":"AdminOrderMailer has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"df752479ebaf6d87f628d10c242e403e","type":"issue","check_name":"UtilityFunction","description":"AdminOrderMailer#image_ordering_emails doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/admin_order_mailer.rb","lines":{"begin":39,"end":39}},"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":"05cd9a9c571844c510ab6570abbd9c3c","type":"issue","check_name":"NilCheck","description":"EpicAuthorisationMailer#notify_staff performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/epic_authorisation_mailer.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0242096b7482b6d049c1e6cd0274f727","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#cataloguing_in_publication_business calls '@form.attachments' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":15,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e4bb408a601d664f04b39b51c9713d45","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#humanize_attribute calls 'humanize_attribute_value(value)' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":56,"end":58}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ab0f31e58b5454bc2a3e15d5fbce041a","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#humanize_attribute_value calls 'value.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":67,"end":69}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d2831804c2972544909dffc00db84245","type":"issue","check_name":"DuplicateMethodCall","description":"FormMailer#offer_to_donate_business calls '@form.attachments' 2 times","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":38,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"91b3142af9e707ce841a8c69312bb731","type":"issue","check_name":"UtilityFunction","description":"FormMailer#humanize_attribute_value doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/form_mailer.rb","lines":{"begin":62,"end":62}},"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":"0806651ea7938b9cff243230d7b13574","type":"issue","check_name":"UtilityFunction","description":"LegalDepositMailer#boolean_to_yes_no doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/legal_deposit_mailer.rb","lines":{"begin":67,"end":67}},"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":"48541e52d42b646847d12f13aae9aade","type":"issue","check_name":"UtilityFunction","description":"LegalDepositMailer#prettify_digital_access_method doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/mailers/legal_deposit_mailer.rb","lines":{"begin":56,"end":56}},"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":"f2d1f6b7cb027fc7ed7da2e47ba077ec","type":"issue","check_name":"NilCheck","description":"ResearchPaymentMailer#notify_staff performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/research_payment_mailer.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f2d1f6b7cb027fc7ed7da2e47ba077ec","type":"issue","check_name":"NilCheck","description":"ResearchPaymentMailer#payee_receipt performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/research_payment_mailer.rb","lines":{"begin":24,"end":24}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b7a47ab8abf0e85f7cc85e0bf9d147e6","type":"issue","check_name":"NilCheck","description":"ResearchPaymentMailer#payment_instructions performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/research_payment_mailer.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f5c1f6b3e90be5c70270d0bae19c4e56","type":"issue","check_name":"ControlParameter","description":"UserOrderMailer#confirmation is controlled by argument 'undelivered_order_items'","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":12,"end":12}},"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":"789e5dfdfc84b5a72208fdcdb0e267ed","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#confirmation performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"672885d6114f0399ef01aa6a0dee968b","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#delivery performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"672885d6114f0399ef01aa6a0dee968b","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#paid performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":30,"end":30}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"672885d6114f0399ef01aa6a0dee968b","type":"issue","check_name":"NilCheck","description":"UserOrderMailer#rejection performs a nil-check","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":41,"end":41}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d34ddf748046417a5dd5995c74986c65","type":"issue","check_name":"RepeatedConditional","description":"UserOrderMailer tests 'order_delivery.nil?' at least 3 times","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":19,"end":41}},"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":"83a2c2c198e1462cc807151e129c5465","type":"issue","check_name":"TooManyInstanceVariables","description":"UserOrderMailer has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/mailers/user_order_mailer.rb","lines":{"begin":3,"end":3}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cde88ffd299c7220aed904d57b143939","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.chat_ends_at' 2 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":35,"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":"d2b62372672875f8dced7b4ed419f5c8","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.created_at' 2 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e49531a728a84cc9bd022ff493912d4","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.created_at.to_time' 2 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e8f8106b839dfbc21e45b127365142a2","type":"issue","check_name":"DuplicateMethodCall","description":"Admin::AnyQuestions::Metric#self.to_csv calls 'metric.school' 3 times","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":37,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cb7d5fdda4af0774576f908a43e2a316","type":"issue","check_name":"NestedIterators","description":"Admin::AnyQuestions::Metric#self.to_csv contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":31,"end":31}},"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 << 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":"196617190ac6af321c54eea0e410b765","type":"issue","check_name":"NilCheck","description":"Admin::AnyQuestions::Metric#self.to_csv performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/admin/any_questions/metric.rb","lines":{"begin":35,"end":35}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"12abbae01c4df53ece8e3c8e7ace8553","type":"issue","check_name":"DuplicateMethodCall","description":"AdvancedSearch#options calls 'collection.to_sym' 3 times","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":60,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6d5cb27bebd593e4e1492010c9f74a38","type":"issue","check_name":"DuplicateMethodCall","description":"AdvancedSearch#options calls 'hash[:i]' 4 times","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":52,"end":65}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09cff45c99f70c135407100bb8842edc","type":"issue","check_name":"DuplicateMethodCall","description":"AdvancedSearch#options calls 'send(collection.to_sym)' 2 times","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":60,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6239a2ca43ef984e8aca61d5ea9e5efb","type":"issue","check_name":"NilCheck","description":"AdvancedSearch#year performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/advanced_search.rb","lines":{"begin":71,"end":71}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dba00e41a9076f0a71c12b841c942243","type":"issue","check_name":"FeatureEnvy","description":"Attachment#initialize refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/attachment.rb","lines":{"begin":11,"end":14}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0f538b77e7b22e009ec8b68a3f2d9800","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::AtlFacet#build_facets calls 'true_facet_value(free_facet)' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":14,"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":"2edd52bffad01a723b56c62bc9c63c05","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::AtlFacet#build_facets calls 'true_facet_value(purchasable_facet)' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":15,"end":15}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4179d108ac1cbd00d7037ae65cdaceee","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::AtlFacet#true_facet_value calls 'facet.values' 3 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a726caa64f42f3874ae5945bb8c80fcf","type":"issue","check_name":"UtilityFunction","description":"Builders::Search::AtlFacet#true_facet_value doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/atl_facet.rb","lines":{"begin":23,"end":23}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a53d9a109be58b8a1e011082b65d3d8f","type":"issue","check_name":"Attribute","description":"Builders::Search::Base#facets is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/base.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"12c28fa6fa8b7aa462e2afc166ee41d7","type":"issue","check_name":"Attribute","description":"Builders::Search::Base#search is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/base.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3fc21a1315adbf5b4462f1843ec2a2de","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'facet.name' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6e393ad9a697fc5aad46a4e8c5a14507","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'facets.find' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"242c8b534cdc3cd945ef40d55bd48ada","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'facets.reject!' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":11,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"017e338ed9ce94747e0a304ad6040b04","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::CollectionFacet#build_facets calls 'search.primary_collection' 3 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":10,"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":"0a48ca50b9f2bf5ef50a21a4b94764d5","type":"issue","check_name":"FeatureEnvy","description":"Builders::Search::CollectionFacet#build_facets refers to 'facet' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":16}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2a434f4cebe9848d153abdda1e5116ce","type":"issue","check_name":"FeatureEnvy","description":"Builders::Search::CollectionFacet#build_facets refers to 'facets' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":7,"end":16}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a3c9cb98b26a5e27136c5b317e471c7","type":"issue","check_name":"TooManyStatements","description":"Builders::Search::CollectionFacet#build_facets has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":6,"end":6}},"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, &error)\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, &error))[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":"dfc746c5ce12d828ed3b303a3d5fe435","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::CollectionFacet#build_facets has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/collection_facet.rb","lines":{"begin":13,"end":13}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bcd21cdee82a4fa886bf5dfc81cb3453","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facet.name == 'year'' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":12,"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":"7ba8bb27a71500763a5cfbad9e4f88b8","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facet.name' 7 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":10,"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":"6b994de18f56bcebe2a257eb5d09b0cc","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facets.find { |facet| facet.name == 'year' }' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":12,"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":"5c41f25f4b5d734c3ace7ee25a8dacfd","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facets.find' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":10,"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":"313c2c381e07eb0ed1ee51f0c4e317bf","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'facets.reject!' 3 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":16,"end":27}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4b1cb8e8a36430f3b86445bacf25ff36","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'k.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":24,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa6cb28a5a34fc4549756289efea9618","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.century' 7 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2325e53d97c73f7c024405176b0034cd","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.century.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dd0b77690ff159b38ecf49d6cb5a59a0","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.decade' 6 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e87ea4780c56a64a8dac2ebaab975462","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.decade.blank?' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4aa54b9b986a17763f8cb7ff435e7034","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.decade.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":39,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c6c6c073253e843461f662c2fafa5710","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.year' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1cc1f17b04fb8aeec227f04f0e9d527a","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'search.year.blank?' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":15,"end":18}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"99688fcecebd7a7bb6de535a9b6a0439","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'year_facet.values' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":33,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"56919e98847f0b5cef2b2fdc20db25b6","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#build_facets calls 'year_facet.values.select!' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":33,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9b19d62fe73e2c2a1b1e425153198882","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'facet.values' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":55,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a01ba092e2eb3b66922b7ec9f87255a2","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'facet.values.sort_by { |k, _v| k }' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":66,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"408256a5e595beb9ca70f6456fa0599f","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'facet.values.sort_by' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":66,"end":68}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4f683d9c437d8cef708b634815ae048a","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::DateFacet#sanitize_current_facet! calls 'k.to_i' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":58,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b0ee994f97009ba4025e8a5b77c79fef","type":"issue","check_name":"MissingSafeMethod","description":"Builders::Search::DateFacet has missing safe method 'sanitize_current_facet!'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":50,"end":50}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"da4a40b0a874a71df0153ea206efaa7d","type":"issue","check_name":"NilCheck","description":"Builders::Search::DateFacet#sanitize_current_facet! performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":51,"end":51}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2d631381a79d4559d74efebb77b793fd","type":"issue","check_name":"TooManyStatements","description":"Builders::Search::DateFacet#build_facets has approx 28 statements","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"afe7d458314fa2a685b4653a0c7cf2da","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::DateFacet#build_facets has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":24,"end":39}},"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":"b2890d11d7ac2037cab93e582f9eba1c","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::DateFacet#sanitize_current_facet! has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":53,"end":53}},"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":"3c0d9e7d2fe0fda3efb2f1db3399e3c3","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::DateFacet#sanitize_current_facet! has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":57,"end":68}},"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":"9ad4e8ac2315626d3514e21f2e3aa1e6","type":"issue","check_name":"UtilityFunction","description":"Builders::Search::DateFacet#sanitize_current_facet! doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/date_facet.rb","lines":{"begin":50,"end":50}},"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":"1a007b73a808f6b8e32df1827112c583","type":"issue","check_name":"Attribute","description":"Builders::Search::Facet#facets is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/facet.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"41987d888c49c6aab6be2c8e6e248349","type":"issue","check_name":"Attribute","description":"Builders::Search::Facet#filters is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/facet.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"373c5eaa003038a983e359045c8e2ab8","type":"issue","check_name":"Attribute","description":"Builders::Search::Facet#search is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/facet.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b6ec24573b299721c72005c90c8bb4b3","type":"issue","check_name":"Attribute","description":"Builders::Search::ParentFacet#count is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/parent_facet.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4f9f9185d2ee0ca8d344dcdf4595e346","type":"issue","check_name":"Attribute","description":"Builders::Search::ParentFacet#name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/parent_facet.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":"05443cac9b0a72123b55978fce7c81ae","type":"issue","check_name":"Attribute","description":"Builders::Search::ParentFacet#value is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/builders/search/parent_facet.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03e5e608b0557e74c220a9d2a09ff589","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::TagFacet#build_facets calls 'search.total' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":22,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e0e1fdaf8c054de0dd5f30d68747d51f","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::TagFacet#build_facets calls 'tag_facet.values' 4 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":16,"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":"0b31b81d3d3ee5fb599f8755091c91ad","type":"issue","check_name":"DuplicateMethodCall","description":"Builders::Search::TagFacet#build_facets calls 'tag_facet.values[TAG_ONLINE_ITEM]' 2 times","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":21,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cee839b2fc1213c12da0848e2f965af8","type":"issue","check_name":"FeatureEnvy","description":"Builders::Search::TagFacet#build_facets refers to 'tag_facet' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":13,"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":"37c8a263e2f90a88cbd51fbf2172cd9d","type":"issue","check_name":"NilCheck","description":"Builders::Search::TagFacet#build_facets performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"391e6d7029e7409e1cfae9473d91dadb","type":"issue","check_name":"TooManyStatements","description":"Builders::Search::TagFacet#build_facets has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"7aeaa77936b2842a3d7f9d1d3ea655df","type":"issue","check_name":"UncommunicativeVariableName","description":"Builders::Search::TagFacet#build_facets has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/builders/search/tag_facet.rb","lines":{"begin":16,"end":16}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c9c94ba9b21b5b6b942437c2dc9314ab","type":"issue","check_name":"NilCheck","description":"Consyncful::DirectParentEntry#set_direct_child_entries performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/direct_parent_entry.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ebd1a503a9024b377e77ceb3d2fc45bb","type":"issue","check_name":"BooleanParameter","description":"Consyncful::Eventable#events_for has boolean parameter 'include_past'","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":73,"end":73}},"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":"a5e5ace5095aa93c3639c2a7fa823181","type":"issue","check_name":"ControlParameter","description":"Consyncful::Eventable#events_for is controlled by argument 'include_past'","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":85,"end":85}},"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":"5765e73144b92a2debf6699298612346","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#date_range calls 'start_datetime.to_formatted_s(date_format)' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":43,"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":"2fa40d73e639e828aa8a9508e8cb16fa","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#date_time_in_utc calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":100,"end":100}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8051667a436d9cc116de1995b461dd08","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#events_for calls 'date.month' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":80,"end":82}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cd51f6d1d9bc9504239214139f378e2b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Eventable#events_for calls 'date.year' 3 times","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":78,"end":82}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"24578fb78bc2f8309f4fc6fba7a3d074","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Eventable#events_for refers to 'date' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":74,"end":82}},"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":"b40218acb936d65c79d0c72c0acd7524","type":"issue","check_name":"NilCheck","description":"Consyncful::Eventable#end_datetime performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":34,"end":34}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1a9d4c0c86a13c11e2be4e576c66a651","type":"issue","check_name":"NilCheck","description":"Consyncful::Eventable#events_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":74,"end":74}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"20b21bf2e2fc594e45402d683d266d93","type":"issue","check_name":"NilCheck","description":"Consyncful::Eventable#start_datetime performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"40b6d04ea87c1c7fabe895b2aae134ae","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Eventable#date_time_in_utc doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/eventable.rb","lines":{"begin":98,"end":98}},"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":"d08c7594b72ffb2233f76d2cd0cf565f","type":"issue","check_name":"ManualDispatch","description":"Consyncful::Imageable#image_alt_text manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/concerns/consyncful/imageable.rb","lines":{"begin":16,"end":16}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9cab12e7c20915af47f4e77671bad51","type":"issue","check_name":"Attribute","description":"Items::Attachable#attachment_identifier is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c8f738dd39b2ac4d9f3851bb3b0b3d69","type":"issue","check_name":"DuplicateMethodCall","description":"Items::Attachable::ClassMethods#find_items calls 'id.to_i' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":33,"end":34}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a05e37d3578825e6b61797cdbfcf4d2f","type":"issue","check_name":"DuplicateMethodCall","description":"Items::Attachable::ClassMethods#find_items calls 'ids.map' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":20,"end":23}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e1eff7fdb1b47628d1181fa29cf920d4","type":"issue","check_name":"DuplicateMethodCall","description":"Items::Attachable::ClassMethods#find_items calls 'item_ids.is_a?(Array)' 2 times","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":19,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"373233c3df0762c86e032cd5a9838eeb","type":"issue","check_name":"TooManyStatements","description":"Items::Attachable::ClassMethods#find_items has approx 17 statements","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":18,"end":18}},"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, &error)\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, &error))[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":"59e799ee14ef9616cae2341a1828d863","type":"issue","check_name":"UncommunicativeVariableName","description":"Items::Attachable#attachment has the variable name 'a'","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":53,"end":53}},"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":"ecd6e098866ce666a45c426b931a3740","type":"issue","check_name":"UncommunicativeVariableName","description":"Items::Attachable::ClassMethods#find_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/concerns/items/attachable.rb","lines":{"begin":20,"end":21}},"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":"9bce3429859052de950d1dc48a01f4c1","type":"issue","check_name":"FeatureEnvy","description":"Schools::TagCategory#multiple_category refers to 'tag' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/concerns/schools/tag_category.rb","lines":{"begin":32,"end":33}},"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":"7ad0f32293390b342f60851d98fe173c","type":"issue","check_name":"NilCheck","description":"Consyncful::Accordion#display_title? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/accordion.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6ce6140860fb7230284b6a2747355f56","type":"issue","check_name":"NilCheck","description":"Consyncful::BlogCategory#name_and_slug? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_category.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ecbd37e3cdea772bdbf0c1c0421e418","type":"issue","check_name":"MissingSafeMethod","description":"Consyncful::BlogComment has missing safe method 'approve!'","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_comment.rb","lines":{"begin":36,"end":36}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"c99a2145a18536f62eacb5a52add4186","type":"issue","check_name":"MissingSafeMethod","description":"Consyncful::BlogComment has missing safe method 'reject!'","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_comment.rb","lines":{"begin":40,"end":40}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"e5c01a3f8eed56d7b49cba6c05e93a2e","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::BlogPage#episode_file calls 'content.body' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_page.rb","lines":{"begin":81,"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":"8bb5c844b8564504ac98528ecc31181a","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::BlogPage#episode_file refers to 'content' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_page.rb","lines":{"begin":81,"end":83}},"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":"1d9e3dc67c0df18f02accded2fff6e84","type":"issue","check_name":"NilCheck","description":"Consyncful::BlogPage#episode_file performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_page.rb","lines":{"begin":87,"end":87}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"497fc19932908484cdc5e0fd76662c1a","type":"issue","check_name":"NilCheck","description":"Consyncful::BlogTag#name_and_slug? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/blog_tag.rb","lines":{"begin":20,"end":20}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d49f112c472e5fb43e38f3a169b02828","type":"issue","check_name":"NilCheck","description":"Consyncful::ColumnBlock#display_title? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/column_block.rb","lines":{"begin":24,"end":24}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ea392eebf6c4cfdc6f7318904eb94a0a","type":"issue","check_name":"NilCheck","description":"Consyncful::ContentBlock#display_rich_text? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/content_block.rb","lines":{"begin":28,"end":28}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d136cc9ff1195b27c9ef7a5c598a9ca6","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Event#recording_type calls 'recordings.first' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":78,"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":"84e7e5987465a8200f42f57c5b409547","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Event#structured_data calls 'alert.downcase' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":167,"end":167}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"963e3929595f3c5ff3adc11e86fcf806","type":"issue","check_name":"NestedIterators","description":"Consyncful::Event#recording_type contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":80,"end":80}},"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 << 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":"9846d66b58d83050d7c3d4397dcac9da","type":"issue","check_name":"TooManyMethods","description":"Consyncful::Event has at least 18 methods","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.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":"88fa457178a7567befd9cd6ec841e1ef","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Event#recording_type has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/event.rb","lines":{"begin":64,"end":64}},"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, &error)\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, &error))[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":"8d6a136bfd5ca830a0efdff57775021b","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventCard#events calls 'Consyncful::Event.all_upcoming' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_card.rb","lines":{"begin":26,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bfd90fd2f34533fda3da363de4997b8d","type":"issue","check_name":"BooleanParameter","description":"Consyncful::EventGallery#event_cards has boolean parameter 'use_limit'","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":41,"end":41}},"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":"87247bf835c3331cf448ab36891da95d","type":"issue","check_name":"ControlParameter","description":"Consyncful::EventGallery#event_cards is controlled by argument 'use_limit'","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":50,"end":50}},"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":"2a15dad9799406cbb43b0466c07d0a91","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#event_cards calls 'event.event_series_id' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"648d5e2eb1526389ff933e8e2f29e5b4","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#event_cards calls 'event_filter.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":46,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c5fb60d5219b37e509c0174e1508fdf4","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#event_cards calls 'events.select' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":47}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e7858bcb597b624a19d7073eb20f1d2f","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventGallery#serializable_hash calls 'event_cards.map(&:serializable_hash)' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":32,"end":33}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"73db54ddad7a74ec0a9d9b6496da7c18","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventGallery#event_cards refers to 'events' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":50}},"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":"90ccb74b280e243462498d8a5c822985","type":"issue","check_name":"NilCheck","description":"Consyncful::EventGallery#event_cards performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":45,"end":45}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e6458352947fa7c3ae3fb7e13240c0d","type":"issue","check_name":"TooManyStatements","description":"Consyncful::EventGallery#event_cards has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_gallery.rb","lines":{"begin":41,"end":41}},"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, &error)\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, &error))[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":"3c9d567760218e9d161fd1d44e46bdfa","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#image calls 'event[:image]' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":25,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ed0b68217276a0a497199f59de448d5","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#self.series_from_params calls 'params[:day]' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":49,"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":"ff7913a8dcbe8637888bab0aa2fe5e6f","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#self.series_from_params calls 'params[:day].nil?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":51,"end":53}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b8a7011d734c562e5e21526a5187cb4a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::EventSeries#self.series_from_params calls 'params[:month]' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":51,"end":53}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"715b7d99c04e1177a6bd487161ed5a0e","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#image refers to 'event' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":25,"end":25}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"37914176cc45f9d22e05ec463836a034","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#image refers to 'images' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":28,"end":28}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"051804a82ab020b396745ce343d4da9b","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#sorted_events refers to 'event_a' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":45,"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":"102a7f0170f9e85e27f5aa3328ee7b07","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::EventSeries#sorted_events refers to 'event_b' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":45,"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":"def9057b98afdaf3a3fed64946836c84","type":"issue","check_name":"NilCheck","description":"Consyncful::EventSeries#self.series_from_params performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/event_series.rb","lines":{"begin":51,"end":53}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"158b1697b4751e8e571e84a0a5ca2466","type":"issue","check_name":"NilCheck","description":"Consyncful::FullScreenImage#display_fullscreen_caption? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/full_screen_image.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9b5e34eed9341b8eb0e43a605edff9d","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::HomePageColumnBlock#top_level_column? calls 'home_page_content_elements.first' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/home_page_column_block.rb","lines":{"begin":29,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0523dd44e0fd6e187db4ac005ac05063","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::InPageNavigation#parts_with_subheadings calls 'model.content_elements' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":42,"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":"ff493cae10c3e8f9d3799363709ae156","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::InPageNavigation#anchor_links refers to 'part' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":19,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7b320431165c5d32f665fac2f7876a11","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::InPageNavigation#parts_with_subheadings refers to 'model' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":34,"end":44}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"26decd1aa15ae1a41b3a033b4b22d915","type":"issue","check_name":"ManualDispatch","description":"Consyncful::InPageNavigation#anchor_links manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":22,"end":22}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"38ed798c66d08df9f768e7881ff5002f","type":"issue","check_name":"ManualDispatch","description":"Consyncful::InPageNavigation#h2s_in manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":53,"end":53}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f721b7d962038b27dd04e1e9f95b9941","type":"issue","check_name":"ManualDispatch","description":"Consyncful::InPageNavigation#parts_with_subheadings manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":42,"end":42}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"171b3526f5379e9f6401b2742a92df4d","type":"issue","check_name":"NestedIterators","description":"Consyncful::InPageNavigation#parts_with_subheadings contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":44,"end":44}},"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 << 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":"2141c73860371ef3dc178eff68d7dc1e","type":"issue","check_name":"TooManyStatements","description":"Consyncful::InPageNavigation#h2s_in has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":52,"end":52}},"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, &error)\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, &error))[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":"3ad0d2956afbce32d8e0ee5751f1a930","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::InPageNavigation#h2s_in has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":63,"end":63}},"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":"94d9fd0e59118bd7a52cbb66e365d3e2","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::InPageNavigation#h2s_in has the variable name 'h2'","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":72,"end":72}},"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":"2a637317cdd7b67f5eea83260ea8767b","type":"issue","check_name":"UtilityFunction","description":"Consyncful::InPageNavigation#h2s_in doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":52,"end":52}},"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":"d84e90154a3aeecc1ef538a6372ca862","type":"issue","check_name":"UtilityFunction","description":"Consyncful::InPageNavigation#mixed_locale_inline_text doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/in_page_navigation.rb","lines":{"begin":78,"end":78}},"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":"a9874ec63c8278449e9c9693c9881f81","type":"issue","check_name":"NilCheck","description":"Consyncful::MediaAsset#url performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/media_asset.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6be557f95336414caf2b3d648f9f6248","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#blog_categories is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"643690104f6ccafddbb4dbde57b8be89","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#branches is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b8cbdbd6a60dc5cc518cc0f101f762f","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#current_blog_category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9ab4b468d829dba5d155bc2f7a2b0c78","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#current_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a810f8750fb8df7d135dbee20ecaa057","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::BlogTree#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"313a4f06d99724d2e3fae3d52b4cf23a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::BlogTree#initialize calls 'category.slug' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":23,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e1536e4ab5c09e8b3a559fd3e3740c2","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::BlogTree has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/blog_tree.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff993a5c766f6beb14c7d86833f45148","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#crumbs is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.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":"0b6e0c720375692bbd9877a2f61c66ea","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#prefix_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff579b54b52768a1fda339d0e040153e","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"00a5f0a98e1b4e74ef3f90ec60f92489","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#root_page_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"031152791640ae5baf1ed5c3ba44556f","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Breadcrumb#root_page_title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5cb8fc419a6dad0dd964f19d79b2cf0a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Breadcrumb#build_crumbs calls 'page.nil?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":54,"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":"42534998db11b3ad0dd6aa92d3d9e54a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Breadcrumb#build_crumbs calls 'slug.downcase' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.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":"a5b219cb99d80ea55af1aa72526a6ad7","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::Breadcrumb#build_crumbs performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":54,"end":56}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b35261d524da2e2182eb9e5927b95d91","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::Breadcrumb#initialize performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0e3166bfe4b1bede01f136d4f95f1934","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::Breadcrumb has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6c2bd444bef6c519f39826896e1a448e","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Navigation::Breadcrumb#build_crumbs has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/breadcrumb.rb","lines":{"begin":50,"end":50}},"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, &error)\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, &error))[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":"c43eacc9b8a586b2ba42948de64ef3ec","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#branches is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e5c80660c4e4da090b722fc59c72128","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#current_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"de52dff9c85ef945fbdb57e4a397cc9f","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#request is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"02881aa70833e7bad1fca3b2697cda67","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#request_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c6ed1c8d39a153fbcca59ce17df9f690","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::RecordedEventsTree#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8eac77a81f5b98b82e78e014e8dc1e3f","type":"issue","check_name":"BooleanParameter","description":"Consyncful::Navigation::RecordedEventsTree#initialize has boolean parameter 'include_root'","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":14,"end":14}},"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":"b81b0a4d200ded48b4329a66128f1782","type":"issue","check_name":"ControlParameter","description":"Consyncful::Navigation::RecordedEventsTree#initialize is controlled by argument 'include_root'","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":19,"end":19}},"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":"ef44d61929519fac45a895d6febbae30","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::RecordedEventsTree#build_branches calls 'event.slug' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":54,"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":"2e37978440ae045fce7c21d32e68005d","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Navigation::RecordedEventsTree#upcoming_event? refers to 'event' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":70,"end":72}},"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":"d131741073149b07561f07117f20a92b","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::RecordedEventsTree#upcoming_event? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":70,"end":70}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5b0d6be4dbb4b22dfbd3c0c37b32978a","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::RecordedEventsTree has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/recorded_events_tree.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"52ffa30406c2e0276d545b2d601a665a","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#branches is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2abec2ee4a3a4fa826adc911ada47bfa","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#current_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27ec2fb865ee07865d01dee4c264d801","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#current_slugs is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d58e933d4a663d73b56a63e98067d937","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#options is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":20,"end":20}},"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":"255e3ce52043233aab35e49f038c69ba","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#prefix_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":18,"end":18}},"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":"0824997a09437160c1b0561bbbb5f255","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#request_paths is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7081fcfb7127dcea29d6bf0cf6249153","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#root_page is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0613ba6038e84c63b37fc23197b42230","type":"issue","check_name":"Attribute","description":"Consyncful::Navigation::Tree#root_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"155202c47f8b0853928f0f2a58afd1dc","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Tree#build_branch calls 'descendant.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":86,"end":87}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bb818ffff293dd18347106bbf3f1903a","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::Tree#build_branches calls 'descendant.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":70,"end":73}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01475e94e307a46d14bec93365ae1b72","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Navigation::Tree#build_branch refers to 'descendant' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":85,"end":87}},"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":"63816c159980d1d8d0f8b05d7f3c49d2","type":"issue","check_name":"NilCheck","description":"Consyncful::Navigation::Tree#build_branches performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":63,"end":63}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"55883e755a406d0288a7a4deb87deeec","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::Tree has at least 8 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5f5c15cde652ce9707e004c690bdb8ff","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Navigation::Tree#build_branches has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":62,"end":62}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"e23fa8249677e2900adb72e9f5166097","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::Tree#build_href doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":91,"end":91}},"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":"7196184725302f70ae68847d706f41e6","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::Tree#prefix_path_and_href doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/tree.rb","lines":{"begin":97,"end":97}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"980429df5af7eaab4980f8bf220e6a29","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#build_branches calls 'user_policy.admin?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":33,"end":39}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6165904e662029c241ea9373a2435151","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#build_branches calls 'user_policy.epic_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":36,"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":"02f55acbcc704e2cd94faa2a173db6cd","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#build_branches calls 'user_policy.research_payments_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":37,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09cc0f2f11b4aa1d1bfc37d4d3789b06","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#plug_branches calls 'Plug::Engine.routes' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":264,"end":270}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c6bf2e51054daadd0215b94d76c16ba3","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Navigation::UserTree#plug_branches calls 'Plug::Engine.routes.url_helpers' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":264,"end":270}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5d09f00904ab8a7ca58ae883ae22b4c4","type":"issue","check_name":"TooManyInstanceVariables","description":"Consyncful::Navigation::UserTree has at least 6 instance variables","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9e71f0bfe5a593668b7eef7b03fa5f6f","type":"issue","check_name":"TooManyMethods","description":"Consyncful::Navigation::UserTree has at least 20 methods","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Methods` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyMethods:\n max_methods: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyMethods\n def one; end\n def two; end\n def three; end\n def four; end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:TooManyMethods has at least 4 methods (TooManyMethods)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ca7237180bc4df27063ef2b43b2e0b9","type":"issue","check_name":"TooManyStatements","description":"Consyncful::Navigation::UserTree#build_branches has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":29,"end":29}},"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, &error)\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, &error))[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":"843e5c155f90bacd2d03047c133b9b6b","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::UserTree#ls_sso_branch doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":74,"end":74}},"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":"b0d19c2e60548505efb14889fd8c754d","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Navigation::UserTree#plug_branches doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/navigation/user_tree.rb","lines":{"begin":254,"end":254}},"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":"5735ee4cf626035baff1b8f3310c1c88","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::Page#schools_main_page calls 'request_paths.first' 3 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":100,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2b19aff2deb1f2873cf2f061264b9e37","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Page#excludes_form? refers to 'child' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":147,"end":147}},"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":"cc73ccc8b9317157a101cd01d7124178","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::Page#schools_main_page refers to 'request_paths' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":100,"end":105}},"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":"65f75110bf865b4c13f7b439ce0e77c3","type":"issue","check_name":"TooManyMethods","description":"Consyncful::Page has at least 25 methods","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.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":"48e2a0d1516dddd3db2a706bb1b84496","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::Page#formsite_form_children has the variable name 'c'","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":152,"end":152}},"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":"ceb6b58b52ec39b7dbd2983a5b387de4","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::Page#summary_blocks has the variable name 'c'","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":113,"end":113}},"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":"410808d0dbe33071ec0ca92ca86d9fba","type":"issue","check_name":"UtilityFunction","description":"Consyncful::Page#schools_main_sub_pages? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/page.rb","lines":{"begin":87,"end":87}},"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":"2f3fd5872c3a9cba77573387b37a158e","type":"issue","check_name":"FeatureEnvy","description":"Consyncful::RauemiAIpurangi::WhareTupuna#all_pou refers to 'pou_duality' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/rauemi_a_ipurangi/whare_tupuna.rb","lines":{"begin":24,"end":24}},"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":"cdf003211aaa26d9fcd918e70b7f54cc","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::RelatedContentCard#page has the variable name 'b'","categories":["Complexity"],"location":{"path":"app/models/consyncful/related_content_card.rb","lines":{"begin":19,"end":19}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"16837c6ea9c9f80baa223047ee62f2c3","type":"issue","check_name":"ControlParameter","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image is controlled by argument 'direction'","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":47,"end":47}},"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":"34377c9fd7d0f3f8c86be91d6b2a66f7","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image calls 'slideshow_image.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":48,"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":"1d51389f4515ff0eecfc9d486eb5cbd0","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image calls 'slideshow_images.in_order' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":45,"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":"b6de97a7c83496a11ea856dc6c81e8e3","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image calls 'slideshow_images_ids.index(slideshow_image.id)' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":48,"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":"bef66997dd2a39295a60cfb006d58a9a","type":"issue","check_name":"NilCheck","description":"Consyncful::SlideshowGalleryBlock#display_title? performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9ca3a38885ab8df333ef234d36631384","type":"issue","check_name":"NilCheck","description":"Consyncful::SlideshowGalleryBlock#find_previous_next_slideshow_image performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":43,"end":43}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1a3310121f699cef219e5ac95139d3f6","type":"issue","check_name":"UncommunicativeVariableName","description":"Consyncful::SlideshowGalleryBlock#story has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":31,"end":31}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e140a781e43ccf1876bb543a518d0ede","type":"issue","check_name":"UtilityFunction","description":"Consyncful::SlideshowGalleryBlock#sort_story_by_position doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_gallery_block.rb","lines":{"begin":61,"end":61}},"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":"2133a6cc5e7662df5c5d6cd581bc5639","type":"issue","check_name":"DuplicateMethodCall","description":"Consyncful::SlideshowImage#self.find_image_data_by_path calls 'path.split(%r{/})' 2 times","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_image.rb","lines":{"begin":26,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0360f43df7adf04d8ec123a64e07df17","type":"issue","check_name":"NilCheck","description":"Consyncful::SlideshowImage#self.find_image_data_by_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/consyncful/slideshow_image.rb","lines":{"begin":23,"end":34}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"21d50899f6ea51015a25aff55e0b732e","type":"issue","check_name":"UncommunicativeVariableName","description":"DigitalDonation#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/digital_donation.rb","lines":{"begin":60,"end":60}},"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":"c6f7726b2215c6cb47fe8c753e7aa4f5","type":"issue","check_name":"UncommunicativeVariableName","description":"DigitalDonation#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/digital_donation.rb","lines":{"begin":60,"end":60}},"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":"0f1e82166acf711dc33b4ff45dc964fc","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#email is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8a4a1f34a16ea86ff8ce0067b01d5e96","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#first_name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5c8a833bbcf8b66c2f10c0e233d8ea11","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#job_title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3dd9050f96b5d949e7ff900abb910a00","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#last_name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f2e00abdf2a2581e7d50bc9bcb35002f","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#organisation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da76c9c3cfa6fb2b72e4c75015ab8dd5","type":"issue","check_name":"Attribute","description":"Epic::Authorisation#type_of_library is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f014d2909414a755d9360b0e8ffe150d","type":"issue","check_name":"ManualDispatch","description":"Epic::Authorisation#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/epic/authorisation.rb","lines":{"begin":26,"end":26}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"02eaa44d667103b401e91e906f369e3c","type":"issue","check_name":"MissingSafeMethod","description":"Form::CatalogueRegistration has missing safe method 'register_alma_user!'","categories":["Complexity"],"location":{"path":"app/models/form/catalogue_registration.rb","lines":{"begin":28,"end":28}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"b5fffeb33161773fa5bd4d59885372f1","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#date is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5b82e58c08eb53e186f478a1e025ed02","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#email_address is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e356bf1bdd6418eeff3aef95f34ac98","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#email_address_confirmation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c3c71fb5da00c59a8cdf901151545606","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#name is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dab9649513c432f567d9cad4aad6c378","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#phone_number is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac359a5f981538f16fc3c0b558a99c7a","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#question is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d143f7bc4bb4a7523ffadcd6127d8502","type":"issue","check_name":"Attribute","description":"Form::ItemEnquiry#town_or_city is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/form/item_enquiry.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"25863056ee250df736e883854d9ab621","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#content is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b574075e2c805337d8faaae36502de67","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa5b456ce1ca9a2dd22ba445d9bd627f","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#images is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8c9aaa11ff074401b3b39a872b73ac0a","type":"issue","check_name":"Attribute","description":"ImageExhibitionContent#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bad7433c86c81105b7af496042d7ac5c","type":"issue","check_name":"DuplicateMethodCall","description":"ImageExhibitionContent#images_from_source calls 'record.content' 4 times","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":32,"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":"b9c2b13c3049b87eac1fefa92fe1f898","type":"issue","check_name":"DuplicateMethodCall","description":"ImageExhibitionContent#images_from_source calls 'slideshow_image.title' 2 times","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":45,"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":"933048a0295505ae97eda5ec1c85da14","type":"issue","check_name":"FeatureEnvy","description":"ImageExhibitionContent#images_from_source refers to 'slideshow_image' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":43,"end":50}},"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":"7a5a7d41038c3790b98ad4f17f466689","type":"issue","check_name":"ManualDispatch","description":"ImageExhibitionContent#images_from_source manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":50,"end":50}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6f6c68e2422985018ea5ea5326b06e3c","type":"issue","check_name":"NilCheck","description":"ImageExhibitionContent#initialize performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/image_exhibition_content.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"221ff045541d9e01a7420ddc866e364f","type":"issue","check_name":"Attribute","description":"Item#book_cover_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"754fa6b328a987339f56aed88acea36b","type":"issue","check_name":"BooleanParameter","description":"Item#respond_to_missing? has boolean parameter 'include_private'","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":286,"end":286}},"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":"057430ff477584983992c4ff4653345e","type":"issue","check_name":"DuplicateMethodCall","description":"Item#build_authorities calls '@attributes[:authorities]' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":170,"end":171}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1d772ba373b4fcf3110e1f7373a11f43","type":"issue","check_name":"DuplicateMethodCall","description":"Item#heading? calls 'params[:path]' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.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":"7091d336c6497d31f3aaad3e38307653","type":"issue","check_name":"DuplicateMethodCall","description":"Item#method_missing calls 'Regexp.last_match(1)' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":277,"end":278}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9582cb391be92e760072ad58c2345a36","type":"issue","check_name":"DuplicateMethodCall","description":"Item#method_missing calls 'method_name.to_s' 3 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":277,"end":279}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"65339d4002335a8e2d15d098eb25d3af","type":"issue","check_name":"DuplicateMethodCall","description":"Item#ndha_access_level calls 'attachment.ndha_rights' 3 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":62,"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":"26d8344ca482b4faa51ac2ffcb9450b2","type":"issue","check_name":"DuplicateMethodCall","description":"Item#related_items_link calls 'authority_field.values' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":48,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"342050af90176e00a8adc8b8afeccaaa","type":"issue","check_name":"DuplicateMethodCall","description":"Item#respond_to_missing? calls 'method_name.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":287,"end":288}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aab4b2db6441ff362f7105972f9c6367","type":"issue","check_name":"FeatureEnvy","description":"Item#attachments refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":159,"end":159}},"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":"fe35c39e59ca949380884eecbd5d75b5","type":"issue","check_name":"FeatureEnvy","description":"Item#group? refers to 'categories' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":21,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9861077a72904b8ccaf7a6bf45185e9a","type":"issue","check_name":"FeatureEnvy","description":"Item#heading? refers to 'params' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.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":"2bc8321f2f88df3b3be6e426695bfaab","type":"issue","check_name":"FeatureEnvy","description":"Item#ndha_access_level refers to 'attachment' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":62,"end":62}},"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":"67e6ecac79e6dbff93b932a572384a46","type":"issue","check_name":"FeatureEnvy","description":"Item#relation_url refers to 'relation_values' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":97,"end":100}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fbfc36d7a9379d8230a1d90b1018dbb3","type":"issue","check_name":"FeatureEnvy","description":"Item#tapuhi_id refers to 'tap_id' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":253,"end":255}},"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":"7f9c0efa82193ff41c353c9fd9c06bfe","type":"issue","check_name":"NilCheck","description":"Item#attachments performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":159,"end":159}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e784e36de5593c67bda79dac0daf58e4","type":"issue","check_name":"NilCheck","description":"Item#ndha_access_level performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":62,"end":62}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"683694235e10e42f19d23b45f99ed7c6","type":"issue","check_name":"TooManyMethods","description":"Item has at least 56 methods","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":3,"end":3}},"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":"373128ad8b61ca922cc3c988506ec485","type":"issue","check_name":"TooManyStatements","description":"Item#related_items_link has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":43,"end":43}},"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, &error)\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, &error))[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":"310cd0093da5c6c4f7e3f3a91ab05ef7","type":"issue","check_name":"TooManyStatements","description":"Item#relation_url has approx 14 statements","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"4ac1ce1a7a2eedeb4bc7eb173aea3829","type":"issue","check_name":"UncommunicativeVariableName","description":"Item#tapuhi_id has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":252,"end":252}},"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":"66717d3df8261a31cfb0d631c209d7ed","type":"issue","check_name":"UtilityFunction","description":"Item#findnzarticles_logo? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/item.rb","lines":{"begin":225,"end":225}},"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":"b362f93530509d5bc0eb6dd350fc7c0a","type":"issue","check_name":"Attribute","description":"Library::Score#libraries is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":240,"end":240}},"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":"8c005d26850a31c3054ca2b3f606fa17","type":"issue","check_name":"Attribute","description":"Library::Score#map is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":240,"end":240}},"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":"ecb42deb609922f7bfb85ce22d4c45d9","type":"issue","check_name":"DuplicateMethodCall","description":"Library#search_by_location calls 'city.present?' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":116,"end":118}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a428c674794404227c5d1bb13037b645","type":"issue","check_name":"DuplicateMethodCall","description":"Library#search_by_location calls 'region.present?' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":116,"end":120}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e4971d34bd3b050fd03412c356f31cc0","type":"issue","check_name":"DuplicateMethodCall","description":"Library#search_by_location calls 'where(city: city)' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":117,"end":119}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d4892eacada9c91df9488ea007611f75","type":"issue","check_name":"DuplicateMethodCall","description":"Library::Score#update_map calls 'library.symbol' 2 times","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":251,"end":251}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8e4cf89abcdc65efada944732711a78f","type":"issue","check_name":"FeatureEnvy","description":"Library#with_staff_details? refers to 'staff_fields' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":103,"end":109}},"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":"a282d83d1d7159866aba7df2af80197a","type":"issue","check_name":"NestedIterators","description":"Library#self.to_csv contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":85,"end":85}},"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 << 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":"fd0fb18149ed8b2766298e3c35986cf8","type":"issue","check_name":"NestedIterators","description":"Library#sort_results contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":206,"end":213}},"remediation_points":500000,"content":{"body":"A `Nested Iterator` occurs when a block contains another block.\n\n## Example\n\nGiven\n\n```Ruby\nclass Duck\n class << 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":"619dcf8e387a7a5d3d6a1449521b9901","type":"issue","check_name":"NilCheck","description":"Library#search_by_exact_term performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":160,"end":160}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5f82dd212fabb920448abf7f6d2c868","type":"issue","check_name":"NilCheck","description":"Library#search_by_keywords performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":130,"end":130}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b8f961be0b32c5dc188395adcf145561","type":"issue","check_name":"NilCheck","description":"Library::Score#update_map performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":248,"end":248}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"733fbfd52b5dd93e7ec33c3626a72919","type":"issue","check_name":"TooManyStatements","description":"Library#self.search has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":36,"end":36}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"f4bc941346d413c2fe19786a3bdd4093","type":"issue","check_name":"TooManyStatements","description":"Library#sort_results has approx 19 statements","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":187,"end":187}},"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, &error)\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, &error))[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":"792faf34350454631cead60c4fb307be","type":"issue","check_name":"UncommunicativeVariableName","description":"Library#self.to_csv has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":79,"end":79}},"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":"9780b0a80b5ec34a6858b709bdf470ce","type":"issue","check_name":"UncommunicativeVariableName","description":"Library#sort_results has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":207,"end":207}},"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":"0384d8198d249cc2bcd3e855cae8a26d","type":"issue","check_name":"UncommunicativeVariableName","description":"Library#sort_results has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/library.rb","lines":{"begin":202,"end":207}},"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":"d3a5c136c0f0fdfb4cbe8147d41b0c9d","type":"issue","check_name":"MissingSafeMethod","description":"ResearchPayment has missing safe method 'generate_uid!'","categories":["Complexity"],"location":{"path":"app/models/research_payment.rb","lines":{"begin":61,"end":61}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"f10d9e9c24c79272f012113189435a94","type":"issue","check_name":"UncommunicativeVariableName","description":"ResearchPayment#payment_url has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/research_payment.rb","lines":{"begin":54,"end":54}},"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":"fb7730d117486de7fe29022c96ef4677","type":"issue","check_name":"UncommunicativeVariableName","description":"ResearchPayment#send_payment_url has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/research_payment.rb","lines":{"begin":72,"end":72}},"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":"2c6f3844fb742c6bd755acdbc82be223","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#attribution is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"63faf5995807548d6c950c1f7305bd21","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7ce2c68aec0427f35736e5ac13f564df","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#content_partner is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"936104d698128ae0e6f0c682b091b413","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#creator is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":18,"end":18}},"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":"240da01eeb03b8881a9d4cca0dac1462","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5c96c5075233e53d4e42828da59aad1c","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#display_collection is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"371a15fd95840b65c0dbe8981f83a373","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.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":"91a4b15552bab82c4844c2e6f6c82abb","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#image_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"848c508f2570a6b9a16bb8791e387e3d","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#landing_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ada2a02c959df28f28831bc59cf6112d","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#rights is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f87240648f2f04d2ff3c1e44f041635a","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#source_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d66b332777e4134a1ab72adbc23a023d","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#status is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"322ab134ba857deed7bb77ad40a558bb","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#tags is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c4094427a08ee8265f947e181ec5a6be","type":"issue","check_name":"Attribute","description":"Schools::Topics::Content#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a730c1c84249a71af836fad5921dbd22","type":"issue","check_name":"ManualDispatch","description":"Schools::Topics::Content#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":25,"end":25}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da1d493f520f85007dc20f8e2900229e","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Content#self.find_by performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":67,"end":67}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c524bf7f5fb365ea2f47a5815e867396","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Content#use_alternate_metadata performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":99,"end":99}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ab55203b067dc2f94ad14d760ea8607f","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Content#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":24,"end":24}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0ed23a3ec933cf2163dd7a2ed8794d11","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Content#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":24,"end":24}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"eec3822555930df2c2b2a1a62b38e10e","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Content#self.find_by has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":69,"end":69}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3e4ae6c86017cbab6c779e448bbd1e35","type":"issue","check_name":"UtilityFunction","description":"Schools::Topics::Content#map_alternate_metadata doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/content.rb","lines":{"begin":110,"end":110}},"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":"cea46bf45a2d67ba5dcafe4239991c25","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#align_mode is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"335df4304e759060661a1105b9c8a929","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#caption is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27fa430d1c3ebab343ba1a2c6781eafa","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0ea423dc66338522073de2c2e42b8dca","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#is_cover is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.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":"c0d058d527fa2673c734302fa95d3fce","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#multiple_category is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f134598ff4403c4a9e147e5ca6aba031","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#tags is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1504608767743807df4c97d566c807ce","type":"issue","check_name":"Attribute","description":"Schools::Topics::Meta#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"139686cf0b6f42b660a96a8f668b25d7","type":"issue","check_name":"ManualDispatch","description":"Schools::Topics::Meta#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":18,"end":18}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1ebbde443924b25ff2a907b02fe4b895","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Meta#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":17,"end":17}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ad604f39c1c7ef26822b4b8dc1812854","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Meta#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/meta.rb","lines":{"begin":17,"end":17}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2afdc6a3222d3f46e5a9328cc7faae28","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#content is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"82aa227e9c58d5efca51f32a702205c9","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.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":"4f27f33ac929eb613e797039a5f06e61","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#meta is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0fc7b23805ee2e4bccc89b1bfd7f85ef","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#position is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0944fbc1c1596ea7fd9d69f6eaf11cc8","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#record_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"65bd5bff5e0b1b0535404272f2020e09","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#sub_type is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4e1da22ee8bb6a831002a1b489982c37","type":"issue","check_name":"Attribute","description":"Schools::Topics::Record#type is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3ab2e2b5b9d6791c87a8cbe51c842ecf","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#image_description calls 'content.content_partner' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2c39abce1c6574674ca0bcac5684b107","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#image_description calls 'content.creator' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":25,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b0020d419e930bf53371da4c144c3d2","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#initialize calls 'k.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":16,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a24507cc13facc95c74f5acd84b4c4e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#meta_description calls 'meta.caption' 3 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":59,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d59f8a542f79ce19e582cee3a9ea3fcb","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Record#meta_title calls 'meta.title' 3 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":55,"end":55}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"81dfc0c66bc5a06da9b5db30d8921e5b","type":"issue","check_name":"ManualDispatch","description":"Schools::Topics::Record#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":18,"end":18}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8fd44ffa43f6833983d4b6343463cdab","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Record#meta_description performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":59,"end":59}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"89b1ee6511d6fad169e526fd1247157d","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Record#meta_title performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":55,"end":55}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c1a64f74256290f79cc0b9240569db9d","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Record#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":15,"end":15}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4bbf2758aeed600dfdc37691bdf2d6ed","type":"issue","check_name":"UncommunicativeVariableName","description":"Schools::Topics::Record#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/schools/topics/record.rb","lines":{"begin":16,"end":15}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5e9283a2dbf76e0efbc794914dc23fd5","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::RelatedDnzSearch#topics refers to 'result' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_dnz_search.rb","lines":{"begin":21,"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":"876b4b71e2b118091b3d18bfd7147709","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::RelatedManyAnswersSearch#topics refers to 'result' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_many_answers_search.rb","lines":{"begin":20,"end":24}},"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":"b50751c7fbb08f9b5d4d52ca43ab8894","type":"issue","check_name":"Attribute","description":"Schools::Topics::RelatedTopic#records is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f3024750f5db6905f704947e6e698fc9","type":"issue","check_name":"Attribute","description":"Schools::Topics::RelatedTopic#topic is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.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":"86c808a4376a2ef4c95642bc646f2b6b","type":"issue","check_name":"Attribute","description":"Schools::Topics::RelatedTopic#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ac576ed46285d8b0486a97c607b268a6","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::RelatedTopic#subjects refers to 'subject' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":35,"end":36}},"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":"64d060ee5605eff0ace9c8e41c2d1710","type":"issue","check_name":"NilCheck","description":"Schools::Topics::RelatedTopic#self.find_by performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/related_topic.rb","lines":{"begin":40,"end":40}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a567f63bdd60ef65d774d9d4377f3e05","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Story#find_by calls 'story.contents' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":72,"end":75}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0b4c6ab4c708e5fe8e6273abf8a15a7e","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Story#sanitise_stories calls 'stories.select!' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":100,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d7739c40417cba9344232ff0b05aa5c9","type":"issue","check_name":"DuplicateMethodCall","description":"Schools::Topics::Story#sanitise_stories calls 'story.name' 2 times","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":94,"end":109}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"544e36680e155c9c58732ffbae46e509","type":"issue","check_name":"FeatureEnvy","description":"Schools::Topics::Story#subject_names refers to 'subject' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":21,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a6a05a6ec3a3d1111133519dd24fdc13","type":"issue","check_name":"NilCheck","description":"Schools::Topics::Story#find_by performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/schools/topics/story.rb","lines":{"begin":60,"end":60}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6522e8e246eefd2f038cc462fc9284e9","type":"issue","check_name":"Attribute","description":"Search#ghost_filters is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"df22cbf921f8b3e742d7bdd9a620e01a","type":"issue","check_name":"DuplicateMethodCall","description":"Search#initialize calls 'params[:controller]' 2 times","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":34,"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":"4408829a9ee357844936e2dc6e566c44","type":"issue","check_name":"DuplicateMethodCall","description":"Search#initialize calls 'params[:i]' 2 times","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ec9c313d7d9a65c07bdbf81ce3a7b7cc","type":"issue","check_name":"DuplicateMethodCall","description":"Search#initialize calls 'params[filter_type]' 2 times","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":14,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4c31f4e205f013bf989e0e5ae3029bfe","type":"issue","check_name":"ManualDispatch","description":"Search#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/search.rb","lines":{"begin":14,"end":14}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fb58bfcaf829f3cacc9e7a89c78c7e2b","type":"issue","check_name":"Attribute","description":"Shop::CartConfirmation#items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/cart_confirmation.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"22c01a8cfd690d8de917103fc250ac9b","type":"issue","check_name":"ControlParameter","description":"Shop::CartConfirmation#initialize is controlled by argument 'cart_items'","categories":["Complexity"],"location":{"path":"app/models/shop/cart_confirmation.rb","lines":{"begin":23,"end":23}},"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":"365a600dd559cbf9320abb5974f60ff6","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::CartConfirmation#cart_contains_no_placeholders has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/cart_confirmation.rb","lines":{"begin":42,"end":42}},"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":"27b577d5ba2a7e801cca1a44b1aa6102","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::Checkout has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/shop/checkout.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"50b853e5e8e61e686e0102bff2dfa193","type":"issue","check_name":"Attribute","description":"Shop::Order#items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":32,"end":32}},"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":"b66f5dfc305c51f4cb3f782b02c730f4","type":"issue","check_name":"Attribute","description":"Shop::Order#organisation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":30,"end":30}},"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":"4b1e24b0a7167798dacb8c635b11f44f","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::Order#generate_order_items calls 'attachment.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":174,"end":175}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"69267ea3288ae0a5a533da6aeececfa0","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::Order#process_paid_order_deliveries! calls 'Hash.from_xml(response)' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":141,"end":143}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9731e6efb8eb11366b20f402f4f93f3","type":"issue","check_name":"FeatureEnvy","description":"Shop::Order#generate_order_items refers to 'item' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":158,"end":173}},"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":"9a73457492df3121aedd936ad9fd4926","type":"issue","check_name":"FeatureEnvy","description":"Shop::Order#process_paid_order_deliveries! refers to 'order_delivery' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":146,"end":147}},"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":"fa875c5970ae52a7e8eef17b5eebd327","type":"issue","check_name":"MissingSafeMethod","description":"Shop::Order has missing safe method 'process_paid_order_deliveries!'","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":140,"end":140}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"cc47f4389840e1ab1e200091f22a7445","type":"issue","check_name":"NilCheck","description":"Shop::Order#send_payment_completed_emails performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":204,"end":204}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c951a0758b7d1d499570b8bbbc7619ea","type":"issue","check_name":"RepeatedConditional","description":"Shop::Order tests 'Rails.env.test?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":185,"end":203}},"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":"72a947bc59c156e2a7383648e73d2138","type":"issue","check_name":"TooManyMethods","description":"Shop::Order has at least 20 methods","categories":["Complexity"],"location":{"path":"app/models/shop/order.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":"0bfeecc6234e054fde7b7615208f17a9","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::Order#item_ids has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":110,"end":110}},"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":"df56124296d57e55276da95bcbf472c5","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::Order#size has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":85,"end":85}},"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":"612e930e22c7e9cf7c6808b14d4fd039","type":"issue","check_name":"UtilityFunction","description":"Shop::Order#send_payment_completed_emails doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order.rb","lines":{"begin":202,"end":202}},"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":"87e476acd91a7f84ca5408f9318a6022","type":"issue","check_name":"Attribute","description":"Shop::OrderDelivery#approved_items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"77bf204786b8373bc838f1dc3fc70b33","type":"issue","check_name":"ControlParameter","description":"Shop::OrderDelivery#link_items is controlled by argument 'action'","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":40,"end":38}},"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":"3c63b870f39b81387a73b2674adb8113","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderDelivery#link_items calls 'action == :deliver' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.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":"ee8cddad21e632a8d93df9ab2e620dbc","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderDelivery#order_items_attachments calls 'order.order_items' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":62,"end":63}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"daad45eba9a5a4e3d556635919bf22b7","type":"issue","check_name":"FeatureEnvy","description":"Shop::OrderDelivery#link_items refers to 'order_item' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":35,"end":43}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1d2945be91f4ccd44a0b2d77916533d6","type":"issue","check_name":"MissingSafeMethod","description":"Shop::OrderDelivery has missing safe method 'download_approved_items!'","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":108,"end":108}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"31e59bf9be2f16e482de69af359cc89d","type":"issue","check_name":"NilCheck","description":"Shop::OrderDelivery#save_pxpay_transaction performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":88,"end":88}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3f6117a3250c319b1e3dbd22cc14212b","type":"issue","check_name":"TooManyStatements","description":"Shop::OrderDelivery#save_pxpay_transaction has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/shop/order_delivery.rb","lines":{"begin":87,"end":87}},"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, &error)\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, &error))[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":"3c8549612761f5419debc64d5cc63348","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderItem#fetch_and_process_image calls 'Dragonfly.app' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":150,"end":152}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5bea6d64e367fc53be8be6659fb084ae","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::OrderItem#price calls 'self[:price]' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":90,"end":90}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"295b390ef03b127aacc2f431896e8bc8","type":"issue","check_name":"NilCheck","description":"Shop::OrderItem#price performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":90,"end":90}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7c91ded0b6f927285ab1bcc52be23b8b","type":"issue","check_name":"NilCheck","description":"Shop::OrderItem#send_item_error_email performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":219,"end":219}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bd772188934b0971f66f7faa4e85ead5","type":"issue","check_name":"RepeatedConditional","description":"Shop::OrderItem tests 'Rails.env.test?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":45,"end":218}},"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":"95344a63f91b7fd51c4d8abb7798934e","type":"issue","check_name":"TooManyMethods","description":"Shop::OrderItem has at least 18 methods","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.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":"b76d11bf86c7784de35353d0901edfa0","type":"issue","check_name":"TooManyStatements","description":"Shop::OrderItem#store_image has approx 12 statements","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":160,"end":160}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"14c08df94f53cf6166981221ceb69c54","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::OrderItem#local_image_missing? has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":123,"end":123}},"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":"a6ea9fe41e197c64e58d556c9f7d65c7","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::OrderItem#store_image has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":175,"end":175}},"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":"2ab7ef85ec5935f86e8134979f6f7dd4","type":"issue","check_name":"UtilityFunction","description":"Shop::OrderItem#can_download_high_resolution_images? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/order_item.rb","lines":{"begin":139,"end":139}},"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":"afd2125e945c878bf4bb053042093946","type":"issue","check_name":"Attribute","description":"Shop::SessionArray#error is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"81eacc4ce6ece784a47169c3faa74221","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#add calls '@session[@name]' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":20,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"493e3e14e78848b71c33ed7d6c836b82","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#include? calls 'id.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":72,"end":74}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"67a2c9f3a6382781f79bdc89fe8d70b3","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#initialize calls '@session[@name]' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":11,"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":"c950fed6e47ba8002817f2785e8ce287","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::SessionArray#items calls 'item_ids.map' 2 times","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.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":"6090c96accf9f3dc4088101823751cfd","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#approved_items refers to 'i' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":111,"end":111}},"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":"1db8978ab8e0fedf03013f654aba63cf","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#approved_total refers to 'i' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":40,"end":40}},"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":"6b22cf49a3ddd6d50fd11322d242b0cf","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#include? refers to 'item' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":71,"end":74}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6378955f736e8444a4575bb721127b37","type":"issue","check_name":"FeatureEnvy","description":"Shop::SessionArray#unapproved_items refers to 'i' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":116,"end":116}},"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":"84da300e80ac317fb6a6d757ab11965c","type":"issue","check_name":"MissingSafeMethod","description":"Shop::SessionArray has missing safe method 'empty!'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":51,"end":51}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"d608b35ca1ffd2d1ce29e5385ca12090","type":"issue","check_name":"SubclassedFromCoreClass","description":"Shop::SessionArray inherits from core class 'Array'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":4,"end":4}},"remediation_points":250000,"content":{"body":"Subclassing core classes in Ruby can lead to unexpected side effects.\n\nKnowing that Ruby has a core library, which is written in C,\nand a standard library, which is written in Ruby,\nif you do not know exactly how these core classes operate at the C level,\nyou are gonna have a bad time.\n\nSource: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"689a52ff9abf176cd5e73a0523a54471","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::SessionArray has at least 5 instance variables","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"952e059eb93c8fdf0a2de2a70c67fe5c","type":"issue","check_name":"TooManyMethods","description":"Shop::SessionArray has at least 16 methods","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.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":"e779dfa3c5ceb62e2a695f3ae160ea4b","type":"issue","check_name":"TooManyStatements","description":"Shop::SessionArray#items has approx 14 statements","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":83,"end":83}},"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, &error)\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, &error))[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":"9a9427b30e115694f2ee1a1026181fcd","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#approved_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":111,"end":111}},"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":"6705988b931c9100c08dc09d553056fc","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#approved_total has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":40,"end":40}},"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":"353cb52db08c8a82d8946f8c4dd544c8","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":87,"end":87}},"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":"58a27ed65510e7d61fa9c4a5ffef3c42","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::SessionArray#unapproved_items has the variable name 'i'","categories":["Complexity"],"location":{"path":"app/models/shop/session_array.rb","lines":{"begin":116,"end":116}},"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":"268c83c47e7f516bff2fec262d9d7d4e","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#approved is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8c69b5ab81eea49e4d5b2b4d08f94804","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#cart is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":7,"end":7}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"debe2935ee950c7d2fd304751d1723c6","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#id is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.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":"bda335d8b8024433fa97ed91750c0fca","type":"issue","check_name":"Attribute","description":"Shop::SessionCartItem#item is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"50fd9b853cc80cb5a2859b423205ab69","type":"issue","check_name":"BooleanParameter","description":"Shop::SessionCartItem#respond_to_missing? has boolean parameter 'include_private'","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":35,"end":35}},"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":"4f29ce0af279259b190129abf7a9bbe8","type":"issue","check_name":"ManualDispatch","description":"Shop::SessionCartItem#method_missing manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":28,"end":28}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2ee3caae3fced6838ece855bfdcc6177","type":"issue","check_name":"ManualDispatch","description":"Shop::SessionCartItem#respond_to_missing? manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_item.rb","lines":{"begin":36,"end":36}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09fed0ad31bbd0b554e0d6db8609fc89","type":"issue","check_name":"UtilityFunction","description":"Shop::SessionCartPlaceholder#price doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_placeholder.rb","lines":{"begin":11,"end":11}},"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":"9af2ad4fc63dc4d9cf1d522ee95f07c0","type":"issue","check_name":"UtilityFunction","description":"Shop::SessionCartPlaceholder#title doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/shop/session_cart_placeholder.rb","lines":{"begin":19,"end":19}},"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":"39d0ec38781a4b82f087331abbd841ce","type":"issue","check_name":"Attribute","description":"Sitemap::Page#root_slug is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":70,"end":70}},"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":"966a52de770e37960d4cb36dc40dd9e5","type":"issue","check_name":"Attribute","description":"Sitemap::Page#sites is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":71,"end":71}},"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":"32278306655d4bfc71f7cb9bd3dbbc16","type":"issue","check_name":"Attribute","description":"Sitemap::Page#sites_array is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":72,"end":72}},"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":"0d0e594e60d17e286b336031fdc80945","type":"issue","check_name":"DuplicateMethodCall","description":"Sitemap::Page#add_slideshow_gallery_block_pages calls 'slideshow_gallery_block.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":144,"end":146}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"28c669b364240aad21959b42346361c1","type":"issue","check_name":"DuplicateMethodCall","description":"Sitemap::Page#image_exhibition_image_path_for calls 'record.content' 2 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":178,"end":179}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e3f5c19bd5805533bb69fc30e0f2b7c1","type":"issue","check_name":"DuplicateMethodCall","description":"Sitemap::Page#initialize calls '@root_page.slug' 2 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":81,"end":85}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aecae7ea3e9b448ff61d2e0e9dd36827","type":"issue","check_name":"FeatureEnvy","description":"Sitemap::Page#add_imaage_exhibition_images refers to 'image' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":164,"end":164}},"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":"1e5e5f2a4df8aad4ff30f66b1b9ec30a","type":"issue","check_name":"FeatureEnvy","description":"Sitemap::Page#add_slideshow_gallery_block_pages refers to 'descendant' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":135,"end":146}},"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":"82570934ebb43d6910bd3dc012e5aa9f","type":"issue","check_name":"NestedIterators","description":"Sitemap#self.page_videos contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":43,"end":43}},"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 << 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":"633945d8ce91f32d605e8ae2cefe692f","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#add_imaage_exhibition_images performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":158,"end":158}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fa1ea59f1a53dcd65cbd063af72ae086","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#add_slideshow_gallery_block_pages performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":135,"end":144}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fba495ccfe9291c08e60c17db1ca7ff5","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#build_sites performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":94,"end":94}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"daa4ff761cd707d23a1bea0ec8d9c437","type":"issue","check_name":"NilCheck","description":"Sitemap::Page#image_exhibition_image_path_for performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":174,"end":174}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2e357754d4580920505028919fcbccc8","type":"issue","check_name":"RepeatedConditional","description":"Sitemap tests 'sitemaps.any?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":9,"end":32}},"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":"36f54876be49c4b15e534fb419c6584e","type":"issue","check_name":"TooManyStatements","description":"Sitemap::Page#build_sites has approx 14 statements","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":93,"end":93}},"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, &error)\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, &error))[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":"7cd04d2b08f8de03d0b6591f816b101c","type":"issue","check_name":"UtilityFunction","description":"Sitemap::Page#image_exhibition_image_path_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":173,"end":173}},"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":"b183b3b5c1e932732bbe31673b4451d3","type":"issue","check_name":"UtilityFunction","description":"Sitemap::Page#video_page? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/sitemap.rb","lines":{"begin":126,"end":126}},"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":"8a0629097d7f79aba9f4c4b206e1134b","type":"issue","check_name":"Attribute","description":"SlideshowImage#child is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1047bcce4071b332c3873b1b803407ef","type":"issue","check_name":"Attribute","description":"SlideshowImage#creator is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":17,"end":17}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"46b050f5a6a266631db6c90d99d53391","type":"issue","check_name":"Attribute","description":"SlideshowImage#current_page_index_text is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":26,"end":26}},"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":"809fba6ae662db87579dfdde00dd2116","type":"issue","check_name":"Attribute","description":"SlideshowImage#description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":18,"end":18}},"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":"7085e30079a93575519099c3033eb950","type":"issue","check_name":"Attribute","description":"SlideshowImage#description_mi_nz is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":19,"end":19}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"df885b3dda99d64b2a013edb74fea66b","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_credit is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":23,"end":23}},"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":"38873fca686db5db678fd489c336af55","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_credit_mi_nz is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":24,"end":24}},"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":"06f87a8104bdf0f73a2708c4a78f7ece","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_from_dnz_api is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"22084cb45929634e6f0a7fcda7040cc8","type":"issue","check_name":"Attribute","description":"SlideshowImage#image_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"02c3cccdcf9af05e93bccd4c7edb1039","type":"issue","check_name":"Attribute","description":"SlideshowImage#landing_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":21,"end":21}},"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":"bd814dec70abca73b43ad85ab8e7a9e9","type":"issue","check_name":"Attribute","description":"SlideshowImage#meta_description is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":20,"end":20}},"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":"3bcddb6dcd2068faba7771c0014b71c8","type":"issue","check_name":"Attribute","description":"SlideshowImage#next_image_link_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":27,"end":27}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8d2c6c76eefa63b245c072fb4b3dc164","type":"issue","check_name":"Attribute","description":"SlideshowImage#previous_image_link_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":28,"end":28}},"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":"652a3f594eb04938a693323686e4c026","type":"issue","check_name":"Attribute","description":"SlideshowImage#related_content is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":25,"end":25}},"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":"4414b5571115798613697e5fe40806a3","type":"issue","check_name":"Attribute","description":"SlideshowImage#remote is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":14,"end":14}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2024c0800bbe50c4ce883f18c16ef3e3","type":"issue","check_name":"Attribute","description":"SlideshowImage#request_path is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":10,"end":10}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e6e43a5308b7c06069bea2ee009fb5a5","type":"issue","check_name":"Attribute","description":"SlideshowImage#slideshow_gallery_block is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":11,"end":11}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e0f8347543f96ef48ccb2a021edd3dcd","type":"issue","check_name":"Attribute","description":"SlideshowImage#title is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c90d06a7aaed3c2e1d99ab62af817f35","type":"issue","check_name":"Attribute","description":"SlideshowImage#title_mi_nz is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"972b27ed168d309c11add4f2547c2f1f","type":"issue","check_name":"BooleanParameter","description":"SlideshowImage#initialize has boolean parameter 'remote'","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":32,"end":32}},"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":"ba044e149b484ea543b5ab36e175a74f","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#initialize calls '@child.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":54,"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":"56aecca13a75bbe623d2a325f5b158b2","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#initialize calls '@parent.record_ids' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":54,"end":54}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b3e70f61473bdd0fcbb5f2b4bdb9fc1","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#initialize calls '@parent.slideshow_images' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":62,"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":"b51e787b62d473b3b8e8a3277dda5a7c","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#slideshow_image_link_path calls 'next_prev_slideshow_image.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":106,"end":110}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cae3ea267d98b70fd44bb8e633657cbf","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#slideshow_image_link_path calls 'next_prev_slideshow_image.title' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":110,"end":110}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"48cf785272f71f6b2fa200665dbd9192","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#story_image_link_path calls 'child.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":119,"end":120}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7391b23db7cdf44b4f696cbf690c91dc","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#story_image_link_path calls 'next_prev_record.content' 3 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":124,"end":131}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"73c8b7ff0bd5c977cb4eff9516c39c27","type":"issue","check_name":"DuplicateMethodCall","description":"SlideshowImage#story_image_link_path calls 'next_prev_record.content.id' 2 times","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":124,"end":130}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9725c6c83faca3d0bd835b728f26e80e","type":"issue","check_name":"ManualDispatch","description":"SlideshowImage#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":45,"end":59}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fac74ddaed0d18e7a86229c3a8de558c","type":"issue","check_name":"NilCheck","description":"SlideshowImage#initialize performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":33,"end":33}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"34d54950d236d392fc2aaebb819b89b8","type":"issue","check_name":"NilCheck","description":"SlideshowImage#slideshow_image_link_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":101,"end":101}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d633850ed8ede37bb0fca04c87f9d50d","type":"issue","check_name":"NilCheck","description":"SlideshowImage#story_image_link_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":116,"end":116}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fe326a8ab5c312cf54729d8ad172c523","type":"issue","check_name":"TooManyInstanceVariables","description":"SlideshowImage has at least 20 instance variables","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":7,"end":7}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fb25c5215316ae2c032d8dc818a7828c","type":"issue","check_name":"UtilityFunction","description":"SlideshowImage#block_with_markdown_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/slideshow_image.rb","lines":{"begin":72,"end":72}},"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":"fc1022de628211facb964489178be7dd","type":"issue","check_name":"ManualDispatch","description":"Stories::Base#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/stories/base.rb","lines":{"begin":7,"end":7}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4d6276f83ba11d37b7591b99f366c400","type":"issue","check_name":"DuplicateMethodCall","description":"Stories::Record#initialize calls 'key.to_sym' 2 times","categories":["Complexity"],"location":{"path":"app/models/stories/record.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"},{"engine_name":"reek","fingerprint":"aa8d0bfe457cfd0a5ee9ccd237d43d24","type":"issue","check_name":"ManualDispatch","description":"Stories::Record#initialize manually dispatches method call","categories":["Complexity"],"location":{"path":"app/models/stories/record.rb","lines":{"begin":26,"end":26}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"918dd1e7a1a09b718b32aa5aaac7543e","type":"issue","check_name":"DuplicateMethodCall","description":"Stories::Story#records calls 'content.content' 2 times","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":70,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"55116a2226fdba66bc4e88d770916f0b","type":"issue","check_name":"FeatureEnvy","description":"Stories::Story#find_content_by_id refers to 'id' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":56,"end":58}},"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":"7585c02a4f086a0692e3b965e1b381b8","type":"issue","check_name":"FeatureEnvy","description":"Stories::Story#find_record_by_content_id refers to 'id' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":63,"end":65}},"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":"08c31534755e46bc71d8345c79347acc","type":"issue","check_name":"FeatureEnvy","description":"Stories::Story#records refers to 'content' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":70,"end":70}},"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":"30488c6b15ade0aee4ca8feb9813323a","type":"issue","check_name":"NilCheck","description":"Stories::Story#find_content_by_id performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":56,"end":56}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"30488c6b15ade0aee4ca8feb9813323a","type":"issue","check_name":"NilCheck","description":"Stories::Story#find_record_by_content_id performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":63,"end":63}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5a5db5c1cb2579d752518d7bc9a163d","type":"issue","check_name":"NilCheck","description":"Stories::Story#records performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":70,"end":70}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"30488c6b15ade0aee4ca8feb9813323a","type":"issue","check_name":"NilCheck","description":"Stories::Story#self.find_by_id performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":8,"end":8}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b560b63a3c5113521fc7f923c558578","type":"issue","check_name":"NilCheck","description":"Stories::Story#self.find_image_data_by_path performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":37,"end":46}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3f941fe3a938b6df2ea81bea4f77b6e5","type":"issue","check_name":"RepeatedConditional","description":"Stories::Story tests 'id.nil?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":8,"end":63}},"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":"5b75d1c4acaab7686cf61f7d5dc1a5cb","type":"issue","check_name":"TooManyStatements","description":"Stories::Story#self.find_image_data_by_path has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":25,"end":25}},"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, &error)\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, &error))[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":"af4f53e24f73fe5b384a336e13645492","type":"issue","check_name":"UncommunicativeVariableName","description":"Stories::Story#find_content_by_id has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":58,"end":58}},"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":"3588afe09a7903a15b17bd547a19af62","type":"issue","check_name":"UncommunicativeVariableName","description":"Stories::Story#find_record has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":80,"end":80}},"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":"73a74bd9cdd2fdd757a942531a3a8b99","type":"issue","check_name":"UncommunicativeVariableName","description":"Stories::Story#find_record_by_content_id has the variable name 'r'","categories":["Complexity"],"location":{"path":"app/models/stories/story.rb","lines":{"begin":65,"end":65}},"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":"1ea9929d25a0b57cd12495911f465edf","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::Authority#initialize refers to 'attributes' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/supplejack/authority.rb","lines":{"begin":8,"end":12}},"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":"daa40ec5fa8047f3b953780633e57e06","type":"issue","check_name":"TooManyStatements","description":"TapuhiGeo#self.find_or_create_by_tap_id has approx 11 statements","categories":["Complexity"],"location":{"path":"app/models/tapuhi_geo.rb","lines":{"begin":6,"end":6}},"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, &error)\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, &error))[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":"aae8954bb3824b634a624abf350f4b33","type":"issue","check_name":"UncommunicativeVariableName","description":"TePunaDonation#initialize has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/te_puna_donation.rb","lines":{"begin":27,"end":27}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bf30e78715aec877a4b979910b95b61f","type":"issue","check_name":"UncommunicativeVariableName","description":"TePunaDonation#initialize has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/models/te_puna_donation.rb","lines":{"begin":27,"end":27}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"92ca5a2e24285770d62a5f1355e2bef2","type":"issue","check_name":"NilCheck","description":"Term#self.starts_with performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/term.rb","lines":{"begin":57,"end":57}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"738859b38c479daf5257b260e436d174","type":"issue","check_name":"UncommunicativeVariableName","description":"Tweets::Account#latest_tweet has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/tweets/account.rb","lines":{"begin":22,"end":22}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5487c61da38edf4b3584ab8b10597042","type":"issue","check_name":"UncommunicativeVariableName","description":"Tweets::Account#tweet_api_response has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/tweets/account.rb","lines":{"begin":54,"end":54}},"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":"ca1a4ad3572de6eba0fbac344075930d","type":"issue","check_name":"DuplicateMethodCall","description":"Tweets::Tweet#fetch_thumbnail_url calls 'item.large_thumbnail_url' 2 times","categories":["Complexity"],"location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":70,"end":70}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8b8c601adc8573a47da432b0a7155b56","type":"issue","check_name":"DuplicateMethodCall","description":"Tweets::Tweet#fetch_thumbnail_url calls 'url[:expanded_url]' 2 times","categories":["Complexity"],"location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":61,"end":63}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"66f85eaa41ff1e6e964d30044071c21e","type":"issue","check_name":"FeatureEnvy","description":"Tweets::Tweet#display_tweet_text refers to 'text' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/tweets/tweet.rb","lines":{"begin":34,"end":38}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"bc466e3004e95c83daa8166f167c2dfc","type":"issue","check_name":"Attribute","description":"User#epic_authorisation is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":42,"end":42}},"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":"c8e51d1f953fee93f4f8561d046d6ab4","type":"issue","check_name":"DuplicateMethodCall","description":"User#create_or_update_lending_services_account! calls 'profile.email' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":227,"end":235}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c5789d246f844e9f97f7fb6b55f4abb6","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.admin?' 3 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":75,"end":86}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f16d460b37048c786826f05cc08e42e3","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.epic_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":72,"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":"5c8bd60a610404606d0b9c9c5283ac01","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.image_ordering_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":73,"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":"3fd60eef173707cdc7e86c5d463980c9","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.lending_service_admin?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":74,"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":"9e50e24cdca05904c65cfc7042dab44a","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'current_user.research_payments_staff?' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":73,"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":"457766e78ed32bba576df12c94b27d98","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'params[:group_filter]' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":88,"end":88}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8e5893ccf5a5dbc4aa1a6d9a781caef6","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'params[:role_filter]' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.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":"31e77c976d73d2f08b09c388d03c9aa7","type":"issue","check_name":"DuplicateMethodCall","description":"User#self.search_by_current_user calls 'search(keyword: keyword, roles: %w[user staff])' 2 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":73,"end":74}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7317d72add1afb7b45fcfb946d1080f4","type":"issue","check_name":"FeatureEnvy","description":"User#update_approved_organisation! refers to 'flag' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":185,"end":187}},"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":"b572a894ec017fdfef78a042459917fa","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'create_or_update_lending_services_account!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":223,"end":223}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"2f674462af265503adeb44460fb57eed","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'require_otp!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":208,"end":208}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"a79c5bab98a4f9d33350491a4f0a9d66","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'reset_otp!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":214,"end":214}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"f0bd589caebbb4f11280902341274c54","type":"issue","check_name":"MissingSafeMethod","description":"User has missing safe method 'update_approved_organisation!'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":184,"end":184}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"a55e84cc33e4a32f410c50b98e99d991","type":"issue","check_name":"NilCheck","description":"User#self.from_omniauth performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":47,"end":47}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"70ca8233782f090e6b1b307950363b9b","type":"issue","check_name":"NilCheck","description":"User#update_approved_organisation! performs a nil-check","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":185,"end":185}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f7b24c6e8c05836474967f559eb73f40","type":"issue","check_name":"RepeatedConditional","description":"User tests 'current_user.admin?' at least 3 times","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":75,"end":86}},"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":"753d128930cd695d125f19d38ab7e337","type":"issue","check_name":"TooManyMethods","description":"User has at least 27 methods","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":3,"end":3}},"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":"61785f54c6efb723819f72ab67836b7a","type":"issue","check_name":"TooManyStatements","description":"User#self.search_by_current_user has approx 13 statements","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":67,"end":67}},"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, &error)\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, &error))[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":"4e53ad832a2a441327fd4fe925920d87","type":"issue","check_name":"UncommunicativeVariableName","description":"User#create_or_update_lending_services_account! has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":239,"end":239}},"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":"ae120fce430cb5326f2504e47308fc19","type":"issue","check_name":"UncommunicativeVariableName","description":"User#self.roles_for_select has the variable name 'k'","categories":["Complexity"],"location":{"path":"app/models/user.rb","lines":{"begin":177,"end":177}},"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":"0ff89f260712ea7b54befe666c55a33b","type":"issue","check_name":"Attribute","description":"UserFavourite#items is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/user_favourite.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"88fdc911cc52545a2aeb956a91a2e3a7","type":"issue","check_name":"Attribute","description":"UserFavourite#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/models/user_favourite.rb","lines":{"begin":4,"end":4}},"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":"622e71fd5557b5972cbf91e343aefcd6","type":"issue","check_name":"FeatureEnvy","description":"ApplicationPresenter#render_haml refers to 'haml' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/presenters/application_presenter.rb","lines":{"begin":21,"end":21}},"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":"e7fb8c8e4833e7dc38bb1c568b3494fa","type":"issue","check_name":"BooleanParameter","description":"ItemPresenter#child_item_counts has boolean parameter 'show_total'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":111,"end":111}},"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":"9f58b47a848f106f33ba7d823da5e47f","type":"issue","check_name":"ControlParameter","description":"ItemPresenter#child_item_counts is controlled by argument 'show_total'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":121}},"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":"739612e303f7713599b0a5d818b9c1bc","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#byline calls '@model.contributor' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.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":"3048dbdc01bb734e2d7773b7b842e29e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#byline calls '@model.display_date' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":75,"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":"da082fb36db280279a41f12e4cf1dbe1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls '@model.related_items_link' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2a069dd0e9d5c9701ae46ff8806a04f1","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls '@model.series?' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":113,"end":120}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"3741d8a071c73355445e62ec2a004bdc","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls 'item_count.positive?' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"01cf204e05754bbfd92e3a2e00101741","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls 'item_count.to_s(:delimited)' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"016111e59d4bb0ebb543d25f7d61e66e","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_item_counts calls 'link_to \"#{item_count.to_s(:delimited)} items\", @model.related_items_link' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":121,"end":122}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a43471f224d951dbb03453e9b968ddac","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#child_items_link calls '@model.series?' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":129,"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":"144bea58f05947339c2c06f5e2646cf9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'attribute.to_s' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":291,"end":294}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9a84a45582ea1973b49a687d9125ea43","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'attribute.to_s.capitalize' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":291,"end":294}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"8bb58d88e4398757084ccd71348fd050","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:limit]' 6 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":270,"end":283}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27f7ac542ae99359238e9e0807fa3f56","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:limit].to_i' 3 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":270,"end":283}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a2d6e122a74ab58dd8805628e1b78b98","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:link]' 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":273,"end":284}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"768eea4716f41d9e2ecc3f6ed89aadfc","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:link_path]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":271,"end":271}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cf3ea466e39de3e92aae93eecb11d170","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:tag]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":302,"end":304}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"451bc82ac8b59db5b14c5052d863dd11","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'options[:trans_key]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":290,"end":291}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f73575d4aff0cc092e3f127e5e039fab","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#dynamic_attribute calls 'value.map' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":271,"end":274}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e08248bb5b33d306ed981fe488570be9","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#nz_libraries_external_link calls '@model.is_version_of' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":172,"end":176}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5ae768cda4b4aa48c4594cfe6e82e688","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#original_record_link calls 'link_options[:text]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":156,"end":157}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6179d8f2be261ed9ab12a154ed257932","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_parent' 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":96,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da26f6f0a06fd0ab0534fb6a9c66ab2f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_parent.first' 3 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":103,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"180561957b0dc1ae4b8ca7b77ab851f6","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_parent.first.text' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":103,"end":105}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ee5b75c378281bf1bae033bb6ff8fa65","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_root' 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":96,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"c21dc5040be2ba39c2a87186c261ecc2","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_root.first' 3 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":101,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d4c2f7cecb32e7495cc1c4e23d71ed20","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#part_of calls '@model.collection_root.first.text' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":101,"end":103}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"55afa29f31ada44773c514dacf12a59f","type":"issue","check_name":"DuplicateMethodCall","description":"ItemPresenter#simple_attribute calls 'options[:delimiter]' 2 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":323,"end":323}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f3f669638cf7e7af6c21228c0a3cd67c","type":"issue","check_name":"FeatureEnvy","description":"ItemPresenter#dynamic_attribute refers to 'options' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":235,"end":304}},"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":"67d8a788c452ccf26e05ebefe344163a","type":"issue","check_name":"FeatureEnvy","description":"ItemPresenter#text_to_paragraphs refers to 'value' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":189,"end":193}},"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":"470535df9046f6a96af3d9021690c2a6","type":"issue","check_name":"InstanceVariableAssumption","description":"ItemPresenter assumes too much for instance variable '@model'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":3,"end":3}},"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 < 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 < 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 < 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":"1be81b0f86449fba5ee6fbc673ca51cd","type":"issue","check_name":"RepeatedConditional","description":"ItemPresenter tests 'value.is_a?(Array)' at least 4 times","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":191,"end":321}},"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":"0b9cd991e0b368eea029ca242bc4a5be","type":"issue","check_name":"TooManyMethods","description":"ItemPresenter has at least 27 methods","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":3,"end":3}},"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":"9e935074c1fac2731fdd708e77aca381","type":"issue","check_name":"TooManyStatements","description":"ItemPresenter#dynamic_attribute has approx 32 statements","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":234,"end":234}},"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, &error)\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, &error))[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":"c8f64d8bf696053063ce7414f0cca8ff","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#attribute_link_replacement has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":204,"end":204}},"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":"eb1cd6bb3fdc52c3c4944853a43456ac","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#byline has the variable name 'c'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":72,"end":72}},"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":"a97f9243d472a58fd5c5589f5817e326","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#dynamic_attribute has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":254,"end":274}},"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":"72315678d5706106968a17b7e150aea7","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#simple_attribute has the variable name 'v'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":322,"end":322}},"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":"b0edbb76b020751c678797d6f131ed65","type":"issue","check_name":"UncommunicativeVariableName","description":"ItemPresenter#text_to_paragraphs has the variable name 't'","categories":["Complexity"],"location":{"path":"app/presenters/item_presenter.rb","lines":{"begin":193,"end":193}},"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":"16b7d359de53939dd5d1b2033b4c472e","type":"issue","check_name":"InstanceVariableAssumption","description":"Items::NlnzcatPresenter assumes too much for instance variable '@model'","categories":["Complexity"],"location":{"path":"app/presenters/items/nlnzcat_presenter.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 < 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 < 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 < 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":"9e645928a52213adf1b56cbe31d9de62","type":"issue","check_name":"TooManyStatements","description":"Embedded::Audio#transform_if_applicable has approx 12 statements","categories":["Complexity"],"location":{"path":"app/renderers/embedded/audio.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, &error)\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, &error))[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":"fb63c9cebe0cba379ff93605dd985354","type":"issue","check_name":"UncommunicativeVariableName","description":"Embedded::Audio#transform_if_applicable has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/renderers/embedded/audio.rb","lines":{"begin":38,"end":38}},"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":"4100547d0f797dac41a81a0c0f0ab94e","type":"issue","check_name":"DuplicateMethodCall","description":"Embedded::Button#transform_if_applicable calls 'node_value.match(REGEX)' 2 times","categories":["Complexity"],"location":{"path":"app/renderers/embedded/button.rb","lines":{"begin":14,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"4c6609a8e95bee429db89472b71eca70","type":"issue","check_name":"UncommunicativeVariableName","description":"PartRenderer#render has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/renderers/part_renderer.rb","lines":{"begin":12,"end":12}},"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":"ad01271231bbb6201aa3717f7f04a0ac","type":"issue","check_name":"UtilityFunction","description":"PartRenderer#render doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/renderers/part_renderer.rb","lines":{"begin":4,"end":4}},"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":"b3385d7c9cc746b2c7fb6eff68928a7a","type":"issue","check_name":"UtilityFunction","description":"TextRenderer#transform_embedded_contents doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/renderers/text_renderer.rb","lines":{"begin":17,"end":17}},"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":"c77c1b499d7acdb76416e45d27c6bb71","type":"issue","check_name":"UtilityFunction","description":"TextRenderer#transform_new_lines doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/renderers/text_renderer.rb","lines":{"begin":13,"end":13}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"47b829e750ca4874a5c1d8ac059882db","type":"issue","check_name":"Attribute","description":"Alma::CreateUserService#alma_request_url is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a7fc941241aef0b4c38eeeeb2d4b292c","type":"issue","check_name":"Attribute","description":"Alma::CreateUserService#error_code is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1fdd47e50bd158682be3dabf0ad2de7b","type":"issue","check_name":"Attribute","description":"Alma::CreateUserService#payload is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d8e4f4bc84bc8a431f8a5a49e5fe5b66","type":"issue","check_name":"UtilityFunction","description":"Alma::CreateUserService#find_error_code_from doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/alma/create_user_service.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2b0696405d3a4dee739f12cb6139500a","type":"issue","check_name":"FeatureEnvy","description":"Alma::Payload#initialize refers to 'registration' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/alma/payload.rb","lines":{"begin":16,"end":40}},"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":"ae4407be7d244f4f6b2fa9b682eaf526","type":"issue","check_name":"UncommunicativeVariableName","description":"CampaignMonitor::SubscribeService#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/campaign_monitor/subscribe_service.rb","lines":{"begin":19,"end":19}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"2ffb994af708b2dc98ea483b2f1b110f","type":"issue","check_name":"Attribute","description":"Contentful::ContentParsers::Base#output_buffer is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":16,"end":16}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"1b7e892de273834a9e2c6fc2bde7156d","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#find_audio_from calls 'element.attributes' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":61,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dcfc1566383b2a08c9e69ddf121572c8","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#find_audio_from calls 'element.attributes['href']' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":61,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03a7074b4e558fa279191665ed740ee7","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativize_site_urls calls 'anchor.attributes' 4 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":135,"end":144}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dd6c5f95b351246373f9aa210ea95fb6","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativize_site_urls calls 'anchor.attributes['href']' 4 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":135,"end":144}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"27077a520698e8cdf5dafc9f2803e41d","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativize_site_urls calls 'uri.host' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":142,"end":142}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9d135a50f63f13d317d7e11c8255c6c8","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativized_url calls 'uri.path' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":151,"end":151}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"28b606e4783b0708340cfc7fe9723813","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::ContentParsers::Base#relativized_url calls 'uri.query' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":151,"end":151}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a9b0eea3846fccda192fd168a37934d5","type":"issue","check_name":"FeatureEnvy","description":"Contentful::ContentParsers::Base#figure_caption_for refers to 'parts' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":110,"end":113}},"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":"cb097535bb5b160dc082d71de536a2fb","type":"issue","check_name":"FeatureEnvy","description":"Contentful::ContentParsers::Base#relativize_site_urls refers to 'anchor' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":135,"end":144}},"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":"75fcd454e3225bb412710d494c9f2847","type":"issue","check_name":"NestedIterators","description":"Contentful::ContentParsers::Base#find_audio_from contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":63,"end":63}},"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 << 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":"8ba42beae1262a9439884e6529ab4c30","type":"issue","check_name":"NilCheck","description":"Contentful::ContentParsers::Base#convert_greater_than performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":119,"end":119}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e5b905bd627db273a9f1c18d578ccd0a","type":"issue","check_name":"UncommunicativeVariableName","description":"Contentful::ContentParsers::Base#audio_tag_for has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":83,"end":83}},"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":"4a2efeb7bf8b8f16d6915969b400bfb6","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#convert_greater_than doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":118,"end":118}},"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":"691698d9f80207fd8d5bd7988ea2dd48","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#figure_image_for doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":96,"end":96}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aa54f9e9e3c95fc2723d9d807f9533d9","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#find_audio_from doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":59,"end":59}},"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":"c59de266f39fe15a414d00af59384419","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#find_button_from doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":42,"end":42}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff2bf7bf2fb06add733d1955b08c42bb","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#html? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":30,"end":30}},"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":"6ca383121fcb5a1a9185ff317d1fb399","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#image_tag? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":34,"end":34}},"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":"7d8d0b13fb105a4015ffcc10be48b8d3","type":"issue","check_name":"UtilityFunction","description":"Contentful::ContentParsers::Base#relativized_url doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/base.rb","lines":{"begin":150,"end":150}},"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":"f7e2edb4a902789921b905a72ec09362","type":"issue","check_name":"FeatureEnvy","description":"Contentful::ContentParsers::Video#thumbnail_from_url refers to 'url' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/contentful/content_parsers/video.rb","lines":{"begin":22,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5eb48fdae55f7be14de130139f12242c","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::EventCalendar#call calls 'model.slug' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/event_calendar.rb","lines":{"begin":23,"end":29}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"322ac85314bc75687dabb422e5a1bf7e","type":"issue","check_name":"UncommunicativeVariableName","description":"Contentful::EventCalendar#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/contentful/event_calendar.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":"b65c8725db21b672c07347e1ec890fe8","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::Metatag#website_logo calls 'ActionController::Base.helpers' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/metatag.rb","lines":{"begin":61,"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":"a9d1c2238b14029a74dd69954613b7b4","type":"issue","check_name":"TooManyInstanceVariables","description":"Contentful::Metatag has at least 9 instance variables","categories":["Complexity"],"location":{"path":"app/services/contentful/metatag.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e7bd454b4dbf750f422c899bdfbb5fd0","type":"issue","check_name":"ControlParameter","description":"Contentful::NewsletterSubscribe#initialize is controlled by argument 'events_newsletter'","categories":["Complexity"],"location":{"path":"app/services/contentful/newsletter_subscribe.rb","lines":{"begin":9,"end":9}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"020e88b0adf09d046f684ab2f0604f6e","type":"issue","check_name":"DuplicateMethodCall","description":"Contentful::NewsletterSubscribe#call calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"app/services/contentful/newsletter_subscribe.rb","lines":{"begin":15,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"fbd507905df91ac4627f9be05d2e8791","type":"issue","check_name":"UncommunicativeVariableName","description":"Contentful::NewsletterSubscribe#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/contentful/newsletter_subscribe.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":"90554044fde7cb78c5e6fc74dd6c1d1e","type":"issue","check_name":"TooManyStatements","description":"Directories::GenerateAuthToken#self.call has approx 12 statements","categories":["Complexity"],"location":{"path":"app/services/directories/generate_auth_token.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, &error)\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, &error))[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":"72a005825298a93eb03c3f8926fb943a","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GenerateAuthToken#self.call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/generate_auth_token.rb","lines":{"begin":27,"end":27}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d62514074b8257f512618bb0505a0c90","type":"issue","check_name":"Attribute","description":"Directories::GetAccountContacts#account_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.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":"6c8097e85c0a32e17edec36108b76aa4","type":"issue","check_name":"Attribute","description":"Directories::GetAccountContacts#auth_token is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b4beb0303b400f881c74190fd673b283","type":"issue","check_name":"FeatureEnvy","description":"Directories::GetAccountContacts#call refers to 'contacts' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":20,"end":22}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"893e16fb6239daa92b7415da16654a3f","type":"issue","check_name":"FeatureEnvy","description":"Directories::GetAccountContacts#get_account_contact_by_role refers to 'contact_data' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":38,"end":38}},"remediation_points":500000,"content":{"body":"_Feature Envy_ occurs when a code fragment references another object more often than it references itself, or when several clients do the same series of manipulations on a particular type of object.\n\n_Feature Envy_ reduces the code's ability to communicate intent: code that \"belongs\" on one class but which is located in another can be hard to find, and may upset the \"System of Names\" in the host class.\n\n_Feature Envy_ also affects the design's flexibility: A code fragment that is in the wrong class creates couplings that may not be natural within the application's domain, and creates a loss of cohesion in the unwilling host class.\n\n_Feature Envy_ often arises because it must manipulate other objects (usually its arguments) to get them into a useful form, and one force preventing them (the arguments) doing this themselves is that the common knowledge lives outside the arguments, or the arguments are of too basic a type to justify extending that type. Therefore there must be something which 'knows' about the contents or purposes of the arguments. That thing would have to be more than just a basic type, because the basic types are either containers which don't know about their contents, or they are single objects which can't capture their relationship with their fellows of the same type. So, this thing with the extra knowledge should be reified into a class, and the utility method will most likely belong there.\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Warehouse\n def sale_price(item)\n (item.price - item.rebate) * @vat\n end\nend\n```\n\nwould report:\n\n```Bash\nWarehouse#total_price refers to item more than self (FeatureEnvy)\n```\n\nsince this:\n\n```Ruby\n(item.price - item.rebate)\n```\n\nbelongs to the Item class, not the Warehouse.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff44bcc605db6abd858a7dbfd51991f1","type":"issue","check_name":"FeatureEnvy","description":"Directories::GetAccountContacts#get_account_contact_by_role refers to 'contact_ids' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":31,"end":35}},"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":"a0abe9098fa0cfea7eebb82c0ae9536e","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GetAccountContacts#fetch_contact_id_value_by_role has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/get_account_contacts.rb","lines":{"begin":61,"end":61}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ec9af3e152e2157fda4e012a09a1dbda","type":"issue","check_name":"Attribute","description":"Directories::GetAllAccounts#auth_token is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_accounts.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f807930003c2c2d502331e12109c03fe","type":"issue","check_name":"NilCheck","description":"Directories::GetAllAccounts#call performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_accounts.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"84779e780bce21f0e77dfbd4e3d28de3","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GetAllAccounts#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_accounts.rb","lines":{"begin":26,"end":26}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0029eed2f5fe6e5acb6eef3a7d76f810","type":"issue","check_name":"Attribute","description":"Directories::GetAllContacts#auth_token is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_contacts.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"5cb34bacdcd419ead869cebdd78c950e","type":"issue","check_name":"NilCheck","description":"Directories::GetAllContacts#call performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_contacts.rb","lines":{"begin":12,"end":12}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7a1c30ed13817c5d454a53baeec8f97c","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::GetAllContacts#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/get_all_contacts.rb","lines":{"begin":24,"end":24}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ba060d1f13e9b9ef26a2d8002c934f97","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ImportLibraries#call calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":16,"end":16}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cab3441de27e10e1b0737fa09cfce18f","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ImportLibraries#import_contacts_temp_data calls 'DateTime.now' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":31,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"556c9dab60809797b57372e828bb9cd6","type":"issue","check_name":"NilCheck","description":"Directories::ImportLibraries#import_accounts performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":41,"end":53}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"dae890e24fd0f3bd3f00e08e4bc26e1a","type":"issue","check_name":"NilCheck","description":"Directories::ImportLibraries#import_contacts_temp_data performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":22,"end":22}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7a9e41cb6baff094d79f651c3fb72437","type":"issue","check_name":"UncommunicativeVariableName","description":"Directories::ImportLibraries#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":12,"end":12}},"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":"9b1f83461733e3e31422290aec806aa9","type":"issue","check_name":"UtilityFunction","description":"Directories::ImportLibraries#clean_up_temp_data doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":60,"end":60}},"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":"b261eb0695598d9f65e6b1c096f8cb9f","type":"issue","check_name":"UtilityFunction","description":"Directories::ImportLibraries#import_accounts doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":40,"end":40}},"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":"cfbf2f0fca0061d56b03cf49e49bf21d","type":"issue","check_name":"UtilityFunction","description":"Directories::ImportLibraries#import_contacts_temp_data doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/import_libraries.rb","lines":{"begin":21,"end":21}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b8e2303fe885a0a19c94e17b72769428","type":"issue","check_name":"Attribute","description":"Directories::ObjectMap#data_struct is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":61,"end":61}},"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":"37e8a4ba792b34b412d637722eeb7163","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ObjectMap#contacts= calls 'contact.role' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":120,"end":121}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"858798ba3b4cecc33b84f12ef3f79c8a","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ObjectMap#contacts= calls 'contacts.find' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":120,"end":121}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"641dbaaea4e9f7250fb4e84a78e48e3f","type":"issue","check_name":"DuplicateMethodCall","description":"Directories::ObjectMap#initialize calls 'data_struct.iks_nzinterloanmember' 2 times","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":89,"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":"70e35ec371ad1de3a6f965b05b62f991","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#contacts= performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":131,"end":131}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cc12fc77f303a2d127c9bb49933f861e","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#fetch_account_type performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":159,"end":159}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"848074e4e9cc44e320b7935c6f86e202","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#fetch_library_status performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":174,"end":174}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6258244c2e29ba04f1dda64f12e4f715","type":"issue","check_name":"NilCheck","description":"Directories::ObjectMap#fetch_library_type performs a nil-check","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":143,"end":143}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"f006b6292f1a693cfdd0f60b8f77972a","type":"issue","check_name":"TooManyStatements","description":"Directories::ObjectMap#contacts= has approx 14 statements","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":117,"end":117}},"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, &error)\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, &error))[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":"bee79686fd4c7f85f808651c0e8b12a2","type":"issue","check_name":"UtilityFunction","description":"Directories::ObjectMap#fetch_account_type doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":158,"end":158}},"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":"7e4e19be58a5ad29fc9de2b903ad7692","type":"issue","check_name":"UtilityFunction","description":"Directories::ObjectMap#fetch_library_status doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":173,"end":173}},"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":"131d5c76a94fe5b051814caec0c7050d","type":"issue","check_name":"UtilityFunction","description":"Directories::ObjectMap#fetch_library_type doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/directories/object_map.rb","lines":{"begin":142,"end":142}},"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":"27d3636306b61105e6300a8fb69756c5","type":"issue","check_name":"Attribute","description":"Favourites::AddFavourite#item_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/add_favourite.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":"c77ea281870732acbc0a090df74b332b","type":"issue","check_name":"Attribute","description":"Favourites::AddFavourite#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/add_favourite.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03625bb7c4dad432df8e92510c406f3f","type":"issue","check_name":"Attribute","description":"Favourites::RemoveFavourite#item_id is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/remove_favourite.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":"28c61eabf405362ca8409537eda066da","type":"issue","check_name":"Attribute","description":"Favourites::RemoveFavourite#user is a writable attribute","categories":["Complexity"],"location":{"path":"app/services/favourites/remove_favourite.rb","lines":{"begin":5,"end":5}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"25d942a8c1a4aacf7c4315cb32a7acb4","type":"issue","check_name":"MissingSafeMethod","description":"Forms::SanitizeAttachmentsService has missing safe method 'sanitize_filename!'","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.rb","lines":{"begin":26,"end":26}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"4a2abb7bf8e01e6ceadf6f527f51b007","type":"issue","check_name":"UncommunicativeVariableName","description":"Forms::SanitizeAttachmentsService#call has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.rb","lines":{"begin":16,"end":16}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0f73308fcf809135494fb2fe285f732a","type":"issue","check_name":"UncommunicativeVariableName","description":"Forms::SanitizeAttachmentsService#sanitize_filename! has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.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":"c5ec95225d72caa983f040563470800c","type":"issue","check_name":"UtilityFunction","description":"Forms::SanitizeAttachmentsService#sanitize_filename! doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/forms/sanitize_attachments_service.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"07016e36cb2cbfe1a1b3e975d9ff0411","type":"issue","check_name":"InstanceVariableAssumption","description":"LendingServices::RegisterCookieService assumes too much for instance variable '@account'","categories":["Complexity"],"location":{"path":"app/services/lending_services/register_cookie_service.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 < 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 < 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 < 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":"58f0c69fbed0c35a4a27027ba97ded59","type":"issue","check_name":"InstanceVariableAssumption","description":"LendingServices::RegisterCookieService assumes too much for instance variable '@cookies'","categories":["Complexity"],"location":{"path":"app/services/lending_services/register_cookie_service.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 < 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 < 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 < 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":"84c9d165bbe7320d9aa1a8a6f0552881","type":"issue","check_name":"UtilityFunction","description":"LendingServices::RegisterCookieService#encrypt_data doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/lending_services/register_cookie_service.rb","lines":{"begin":11,"end":11}},"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":"797b758f184ccb4728d200e7801d9794","type":"issue","check_name":"DuplicateMethodCall","description":"LibraryCsvService#generate_row calls 'row[index]' 4 times","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":39,"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":"dc99cbabcf65dab6d992003d9d9390e2","type":"issue","check_name":"FeatureEnvy","description":"LibraryCsvService#generate_row refers to 'row' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":39,"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":"4d3cd573788282f83d6eff4d49abeb10","type":"issue","check_name":"UtilityFunction","description":"LibraryCsvService#add_http doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":52,"end":52}},"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":"f148288b6833be43df3692d980478e4f","type":"issue","check_name":"UtilityFunction","description":"LibraryCsvService#to_boolean doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/library_csv_service.rb","lines":{"begin":61,"end":61}},"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":"fc0cc0017d9fd10ef522c0df4b66b379","type":"issue","check_name":"DuplicateMethodCall","description":"ReadingRoomsCookieService#valid_cookie? calls 'Time.zone' 2 times","categories":["Complexity"],"location":{"path":"app/services/reading_rooms_cookie_service.rb","lines":{"begin":18,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"d33c6c7e65482e9f45cd1a8f8fb9008f","type":"issue","check_name":"DuplicateMethodCall","description":"ReadingRoomsCookieService#valid_cookie? calls 'cookies[:reading_rooms_session]' 2 times","categories":["Complexity"],"location":{"path":"app/services/reading_rooms_cookie_service.rb","lines":{"begin":15,"end":17}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"ff7ccd98e1d3af1fe28bc90f05f63501","type":"issue","check_name":"UtilityFunction","description":"ReadingRoomsCookieService#valid_path? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/reading_rooms_cookie_service.rb","lines":{"begin":24,"end":24}},"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":"11aa9d0da2b8a7136b94f7234539e1f4","type":"issue","check_name":"InstanceVariableAssumption","description":"SharedSystemCookieService assumes too much for instance variable '@account_hash'","categories":["Complexity"],"location":{"path":"app/services/shared_system_cookie_service.rb","lines":{"begin":5,"end":5}},"remediation_points":350000,"content":{"body":"Classes should not assume that instance variables are set or present outside of the current class definition.\n\nGood:\n\n```Ruby\nclass Foo\n def initialize\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\nGood as well:\n\n```Ruby\nclass Foo\n def foo?\n bar == :foo\n end\n\n def bar\n @bar ||= :foo\n end\nend\n```\n\nBad:\n\n```Ruby\nclass Foo\n def go_foo!\n @bar = :foo\n end\n\n def foo?\n @bar == :foo\n end\nend\n```\n\n## Example\n\nRunning Reek on:\n\n```Ruby\nclass Dummy\n def test\n @ivar\n end\nend\n```\n\nwould report:\n\n```Bash\n [1]:InstanceVariableAssumption: Dummy assumes too much for instance variable @ivar\n```\n\nNote that this example would trigger this smell warning as well:\n\n```Ruby\nclass Parent\n def initialize(omg)\n @omg = omg\n end\nend\n\nclass Child < 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 < 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 < 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":"e0e17251dbbad99108cadd754fb042d4","type":"issue","check_name":"UtilityFunction","description":"SharedSystemCookieService#key doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/shared_system_cookie_service.rb","lines":{"begin":34,"end":34}},"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":"a3d2a9d4a8b8b168a0762f74bb3388dd","type":"issue","check_name":"TooManyConstants","description":"Terms::BaseService has 7 constants","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Constants` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyConstants:\n max_constants: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyConstants\n CONST_1 = :dummy\n CONST_2 = :dummy\n CONST_3 = :dummy\n CONST_4 = :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warnings:\n [1]:TooManyConstants has 4 constants (TooManyConstants)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"e0358fb1fd3a10b0917c5a0dbd4ed3a0","type":"issue","check_name":"TooManyInstanceVariables","description":"Terms::BaseService has at least 11 instance variables","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"03f0e1a0be8e7bc0eed62e676e9f2e34","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#retrieve_associated_terms doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":93,"end":93}},"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":"ce6ce1f3e08a48e2926f44973b19a39a","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#term_attr doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":88,"end":88}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b6ca0cbe8c691e9f2021e84d7a61746a","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#term_title doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":84,"end":84}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"650010f1e4d4afc1facd50205220e812","type":"issue","check_name":"UtilityFunction","description":"Terms::BaseService#update_regional_groupings doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/base_service.rb","lines":{"begin":101,"end":101}},"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":"abb2a02f59e156b03ad30e687980ec9e","type":"issue","check_name":"UncommunicativeVariableName","description":"Terms::FixMacronService#call has the variable name 'f'","categories":["Complexity"],"location":{"path":"app/services/terms/fix_macron_service.rb","lines":{"begin":31,"end":31}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"78b347bff6ea0dd6dfa741f9fff9c780","type":"issue","check_name":"TooManyInstanceVariables","description":"Terms::ImportIwiHapuService has at least 7 instance variables","categories":["Complexity"],"location":{"path":"app/services/terms/import_iwi_hapu_service.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a8a081d5766be0dfb5d13f0a8746debc","type":"issue","check_name":"InstanceVariableAssumption","description":"Terms::ImportMshService assumes too much for instance variable '@prefered_dialect_term'","categories":["Complexity"],"location":{"path":"app/services/terms/import_msh_service.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 < 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 < 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 < 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":"174f9d501ada82f3ec7a701fffd48b75","type":"issue","check_name":"TooManyInstanceVariables","description":"Terms::ImportMshService has at least 10 instance variables","categories":["Complexity"],"location":{"path":"app/services/terms/import_msh_service.rb","lines":{"begin":6,"end":6}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"697d66b92bec7620e9bb21da905a6e01","type":"issue","check_name":"UtilityFunction","description":"Terms::ImportMshService#top_level_term? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/services/terms/import_msh_service.rb","lines":{"begin":36,"end":36}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"0c3c16151d5115ef8b5c32f046195359","type":"issue","check_name":"NilCheck","description":"NdhaImageDownloadWorker#perform performs a nil-check","categories":["Complexity"],"location":{"path":"app/sidekiq/ndha_image_download_worker.rb","lines":{"begin":20,"end":20}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"522b45abfffec1e7338e5d71accf9011","type":"issue","check_name":"UtilityFunction","description":"NdhaImageDownloadWorker#perform doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/sidekiq/ndha_image_download_worker.rb","lines":{"begin":17,"end":17}},"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":"98954796a0a02ddfb03d372de9b22a06","type":"issue","check_name":"FeatureEnvy","description":"FileContentTypeValidator#validate_each refers to 'attachment' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/validators/file_content_type_validator.rb","lines":{"begin":19,"end":24}},"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":"b72641752c5e59f9e153cece4a5cd5d1","type":"issue","check_name":"ManualDispatch","description":"FileContentTypeValidator#validate_each manually dispatches method call","categories":["Complexity"],"location":{"path":"app/validators/file_content_type_validator.rb","lines":{"begin":19,"end":19}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"9627393c3c2a44352dddd720a4c56ca3","type":"issue","check_name":"DuplicateMethodCall","description":"VirusFreeFileValidator#scan_for_viruses calls 'attachment.original_filename' 2 times","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":31,"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":"0bf3b393c84d1112f7232e145fb9a361","type":"issue","check_name":"DuplicateMethodCall","description":"VirusFreeFileValidator#scan_for_viruses calls 'record.errors' 2 times","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":33,"end":41}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"433399fa6e347b0270c385576f14968e","type":"issue","check_name":"ManualDispatch","description":"VirusFreeFileValidator#scan_for_viruses manually dispatches method call","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":24,"end":24}},"remediation_points":350000,"content":{"body":"Reek reports a _Manual Dispatch_ smell if it finds source code that manually checks whether an object responds to a method before that method is called. Manual dispatch is a type of Simulated Polymorphism which leads to code that is harder to reason about, debug, and refactor.\n\n## Example\n\n```Ruby\nclass MyManualDispatcher\n attr_reader :foo\n\n def initialize(foo)\n @foo = foo\n end\n\n def call\n foo.bar if foo.respond_to?(:bar)\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [9]: MyManualDispatcher manually dispatches method call (ManualDispatch)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"760c1a88fa96f3a6bf0c33d346716d4c","type":"issue","check_name":"TooManyStatements","description":"VirusFreeFileValidator#scan_for_viruses has approx 12 statements","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":20,"end":20}},"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, &error)\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, &error))[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":"99a2f772bca1c717f65796b58e6148b2","type":"issue","check_name":"UncommunicativeVariableName","description":"VirusFreeFileValidator#scan_for_viruses has the variable name 'e'","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":38,"end":38}},"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":"f41b570e8f7bb51c345eacecf7ca8aff","type":"issue","check_name":"UtilityFunction","description":"VirusFreeFileValidator#scan_for_viruses doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"app/validators/virus_free_file_validator.rb","lines":{"begin":20,"end":20}},"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":"86bf55a392be77ec848b17164362ae66","type":"issue","check_name":"Attribute","description":"ClamAv#filepath is a writable attribute","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"6a397a2ed67d8670c707a817a855b14c","type":"issue","check_name":"Attribute","description":"ClamAv#results is a writable attribute","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":9,"end":9}},"remediation_points":250000,"content":{"body":"A class that publishes a setter for an instance variable invites client classes to become too intimate with its inner workings, and in particular with its representation of state.\n\nThe same holds to a lesser extent for getters, but Reek doesn't flag those.\n\n## Example\n\nGiven:\n\n```Ruby\nclass Klass\n attr_accessor :dummy\nend\n```\n\nReek would emit the following warning:\n\n```\nreek test.rb\n\ntest.rb -- 1 warning:\n [2]:Klass declares the writable attribute dummy (Attribute)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"09a3b85eae67dee1a096cccbc0e18467","type":"issue","check_name":"DuplicateMethodCall","description":"ClamAv#scan calls 'Rails.logger' 2 times","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":19,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"da0b183751fcf428848144b09df9bab5","type":"issue","check_name":"DuplicateMethodCall","description":"ClamAv#send_file_to_clam_av calls 'sleep 0.0001' 2 times","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":43,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"235c8d1b2dcf1c38726d1df8a5b5de16","type":"issue","check_name":"FeatureEnvy","description":"ClamAv#send_file_to_clam_av refers to 'socket' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":35,"end":56}},"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":"87532135095a7f633462b70c4c517c9a","type":"issue","check_name":"InstanceVariableAssumption","description":"ClamAv assumes too much for instance variable '@results'","categories":["Complexity"],"location":{"path":"lib/clam_av.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 < 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 < 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 < 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":"d24110cbcb7043afc5318a6880c1bc6d","type":"issue","check_name":"NilCheck","description":"ClamAv#virus_found? performs a nil-check","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":26,"end":26}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"aa53a3524d74b03c2ffa940c749c8cba","type":"issue","check_name":"TooManyStatements","description":"ClamAv#send_file_to_clam_av has approx 15 statements","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":33,"end":33}},"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, &error)\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, &error))[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":"7c998c72996d0c0e51433c75369a4b07","type":"issue","check_name":"UncommunicativeVariableName","description":"ClamAv#send_file_to_clam_av has the variable name 'e'","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":59,"end":59}},"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":"c67b6ef2a04c8cde88ebaa7864eab5a4","type":"issue","check_name":"UncommunicativeVariableName","description":"ClamAv#send_file_to_clam_av has the variable name 'f'","categories":["Complexity"],"location":{"path":"lib/clam_av.rb","lines":{"begin":37,"end":37}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"07700a682cafd5f1944d443d66d4a491","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls '@allowed_ips.any?' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":21,"end":31}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"76ed1af6b3edcc446eb62944572f6d83","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'Rails.env' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a0bb432e0eec6fcb9a9dff6e221997a7","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'Rails.env.production?' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"b9e53ca6bd2b584a0bd99331abaa4d3e","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'request.env' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"13029aba0d77f5f382ec18fe60987f17","type":"issue","check_name":"DuplicateMethodCall","description":"Constraints::ReadingRooms#matches? calls 'request.env['HTTP_INCAP_CLIENT_IP']' 2 times","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":25,"end":28}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"7c637d636052ba2b018295e18ddaf8d0","type":"issue","check_name":"NestedIterators","description":"Constraints::ReadingRooms#matches? contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":31,"end":31}},"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 << 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":"906ed36cc701fb53630f6d7020a9ad14","type":"issue","check_name":"UtilityFunction","description":"Constraints::ReadingRooms#allowed_environment? doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/constraints/reading_rooms.rb","lines":{"begin":15,"end":15}},"remediation_points":250000,"content":{"body":"A _Utility Function_ is any instance method that has no dependency on the state of the instance.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"eb5f679fb55a0ef9cfaf8c064a656709","type":"issue","check_name":"UtilityFunction","description":"CustomLogger::Logger#create_formatter doesn't depend on instance state (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/custom_logger/logger.rb","lines":{"begin":10,"end":10}},"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":"6b519b0d639a0bd1981146c606e17ea1","type":"issue","check_name":"MissingSafeMethod","description":"Devise::Strategies::Uid has missing safe method 'authenticate!'","categories":["Complexity"],"location":{"path":"lib/devise/strategies/uid.rb","lines":{"begin":6,"end":6}},"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>>\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 < Parent\n include Dangerous\nend\n\nclass Daughter < 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":"61bff8d81c935570ece56578bf9a1d42","type":"issue","check_name":"UncommunicativeVariableName","description":"Processors::ImageDensity#self.call has the variable name 'e'","categories":["Complexity"],"location":{"path":"lib/processors/image_density.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":"2d555f54132ffb7adccda61939cffdec","type":"issue","check_name":"DuplicateMethodCall","description":"Shop::PaymentExpressGenerateRequest#call calls 'response.body' 2 times","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":37,"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":"e4979c21ccb3a87e3fe80d7719da2260","type":"issue","check_name":"NilCheck","description":"Shop::PaymentExpressGenerateRequest#call performs a nil-check","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":39,"end":39}},"remediation_points":250000,"content":{"body":"A `NilCheck` is a type check. Failures of `NilCheck` violate the [\"tell, don't ask\"](http://robots.thoughtbot.com/tell-dont-ask) principle.\n\nAdditionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.\n\n## Example\n\nGiven\n\n```Ruby\nclass Klass\n def nil_checker(argument)\n if argument.nil?\n puts \"argument isn't nil!\"\n end\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [3]:Klass#nil_checker performs a nil-check. (NilCheck)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"cc7a13b6246c5c4b6fe0c0d17bdd4d4c","type":"issue","check_name":"TooManyInstanceVariables","description":"Shop::PaymentExpressGenerateRequest has at least 9 instance variables","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":4,"end":4}},"remediation_points":500000,"content":{"body":"`Too Many Instance Variables` is a special case of `LargeClass`.\n\n## Example\n\nGiven this configuration\n\n```yaml\nTooManyInstanceVariables:\n max_instance_variables: 3\n```\n\nand this code:\n\n```Ruby\nclass TooManyInstanceVariables\n def initialize\n @arg_1 = :dummy\n @arg_2 = :dummy\n @arg_3 = :dummy\n @arg_4 = :dummy\n end\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 5 warnings:\n [1]:TooManyInstanceVariables has at least 4 instance variables (TooManyInstanceVariables)\n```\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"45ce650ec1795f4534a5f6774cbc368d","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::PaymentExpressGenerateRequest has the variable name '@txndata1'","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":10,"end":10}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"853d924583e05f3f21b50f7b50929e72","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::PaymentExpressGenerateRequest has the variable name '@txndata2'","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":11,"end":11}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"83708435d10efdf62315dd63ae403d18","type":"issue","check_name":"UncommunicativeVariableName","description":"Shop::PaymentExpressGenerateRequest has the variable name '@txndata3'","categories":["Complexity"],"location":{"path":"lib/shop/payment_express_generate_request.rb","lines":{"begin":12,"end":12}},"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":"5672cb685e1d17a5b6a85da692f0db32","type":"issue","check_name":"DuplicateMethodCall","description":"Supplejack::UrlFormats::RecordHash#to_api_hash calls 'hash[:and]' 3 times","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/record_hash.rb","lines":{"begin":8,"end":8}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"},{"engine_name":"reek","fingerprint":"a07945fb8efc6ef4d5fddefde256e0f3","type":"issue","check_name":"FeatureEnvy","description":"Supplejack::UrlFormats::RecordHash#to_api_hash refers to 'hash' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/supplejack/url_formats/record_hash.rb","lines":{"begin":8,"end":8}},"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":"11d6a56107dde0ba4841f1e971485e42","type":"issue","check_name":"FeatureEnvy","description":"ActiveSupport::TaggedLogging::Formatter#call refers to 'data' more than self (maybe move it to another class?)","categories":["Complexity"],"location":{"path":"lib/tagged_logging/formatter.rb","lines":{"begin":9,"end":11}},"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":"structure","fingerprint":"f8ccebfc07d1a0c9fa77b6325a61b82c","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 `refresh_baseline_if_configured` has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":7,"end":39}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"}, +{"engine_name":"structure","fingerprint":"4890c3e24aa5f22bc928ccddd6a60a14","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `sort_issues` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":33,"end":73}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"}, +{"engine_name":"structure","fingerprint":"5989a7d02618f9eba49266f1c5473861","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `print_category` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":20,"end":20}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"}, +{"engine_name":"structure","fingerprint":"79ec8f3ef3737357ed2c43ab0a065ef3","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 `calculate_issues_in_changed_files` has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":22,"end":54}},"other_locations":[],"remediation_points":1550000,"severity":"minor","type":"issue"}, +{"name":"ruby.parse.succeeded","type":"measurement","value":7,"engine_name":"structure"}, +{"engine_name":"reek","fingerprint":"054589dd54a8aef188941b688d099978","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::CodeclimateWrapper has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/codeclimate_wrapper.rb","lines":{"begin":7,"end":7}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"0ab3c6e125bef6686b3c821c59933e08","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'CodeclimateDiff.configuration' 6 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":8,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"585621642e3917aabb584a8dee9dc5b9","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'CodeclimateDiff.configuration[\"gitlab\"]' 5 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":8,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"a90c8153eeb16896f80233d15786037a","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'puts \"Using current baseline.\"' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":33,"end":38}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"4dade4b82ae3a3c900dd5cbd4baa48c0","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'response.body' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":29,"end":32}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"eb7c72ed624bdafbdbfee6ceed64db54","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'response.code' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.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":"f54441e8533c9bf76e64b72596931f02","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::Downloader has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":6,"end":6}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"d2ddd39e281760ccf0b0918fe08e7e7c","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured has approx 19 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.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":"211287e4b5857d557ac53a56826d6fa0","type":"issue","check_name":"UncommunicativeVariableName","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured has the variable name 'e'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":36,"end":36}},"remediation_points":150000,"content":{"body":"An `Uncommunicative Variable Name` is a variable name that doesn't communicate its intent well enough.\n\nPoor names make it hard for the reader to build a mental picture of what's going on in the code. They can also be mis-interpreted; and they hurt the flow of reading, because the reader must slow down to interpret the names.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"6387eea8958bb1f9b03eb1a4d1a7d3d7","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'issue[\"description\"] == issue_to_match[\"description\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":10,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"26e97835cc4b485f5758c3fcf6c9aaea","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'issue[\"description\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":10,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"22d5da8bce52124b5a9c808004f82019","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'issue[\"fingerprint\"] == issue_to_match[\"fingerprint\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":8,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"cc510276d86e62d3aaf8388d5bfa2b19","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'issue[\"fingerprint\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":8,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"0b23ee28cb8bdc33b6f2f06a482b5267","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'issue_to_match[\"description\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":10,"end":21}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"30a514924733303a35f7ae8c8de71a95","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'issue_to_match[\"fingerprint\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":8,"end":20}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"e1a894e2e680a8948d6a5bee61911741","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'list.delete_at(index)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":14,"end":25}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"2fefd889dbaf81b11b2bea400c8d6deb","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list calls 'list.index' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":7,"end":19}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"ca6ea3faac869baf424f72669048c899","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.sort_issues calls 'baseline_issues.count' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":50,"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":"fe0d4f54334ad664a42b1018ae44a8ca","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.sort_issues calls 'current_issues.count' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":50,"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":"26083f936211b5167cc5f6809b9c9ade","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.sort_issues calls 'issue[\"fingerprint\"] == fingerprint' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":47,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"e879665bca8ca2a6bc3f789248ff8b39","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::IssueSorter#self.sort_issues calls 'issue[\"fingerprint\"]' 3 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":44,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"d90684590df5d9e0fe73c8b42d49fb87","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::IssueSorter has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":4,"end":4}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"980375b6536d455e110ca4c16fb8385a","type":"issue","check_name":"NestedIterators","description":"CodeclimateDiff::IssueSorter#self.sort_issues contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":47,"end":61}},"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":"c43a4fd2dc6f9f2900cf0b0a0702294e","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::IssueSorter#self.remove_closest_match_from_list has approx 9 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":5,"end":5}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"c8711ff1c512044d0e938787698e5f45","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::IssueSorter#self.sort_issues has approx 22 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":33,"end":33}},"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":"7b8cb5858d38666042143f4f0ad0e173","type":"issue","check_name":"ControlParameter","description":"CodeclimateDiff::ResultPrinter#self.print_category is controlled by argument 'color'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":23,"end":23}},"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":"83771ef70121c9192872a09a66ee7b0c","type":"issue","check_name":"ControlParameter","description":"CodeclimateDiff::ResultPrinter#self.print_result is controlled by argument 'show_preexisting'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":52,"end":52}},"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":"f188df8774fe06f10f92ea3ced203a90","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_issues calls 'issue[\"check_name\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":36,"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":"da9c16763266a2ee7c4acd27b473f431","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_issues calls 'issue[\"engine_name\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":36,"end":42}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"e9462c1d7525075446ba64f4bf4ddc2b","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_issues calls 'issue[\"severity\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":36,"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":"a6d4b886f1137834a7895847fda2a405","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_issues_in_category calls 'issue[\"location\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":10,"end":11}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"c426eed4fc2a91238bf2a338dc0ac631","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_result calls 'fixed_issues.count' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":71,"end":72}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"9f6643562758be7d65fc46249ba74212","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_result calls 'new_issues.count' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":63,"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":"66c9f93f83039d5ff8b90e5f5f57156a","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::ResultPrinter#self.print_result calls 'preexisting_issues.count' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.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":"524d4bedfc2cef6b38a753be561516ef","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::ResultPrinter has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":7,"end":7}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"b96b36b5b941ac84266107f82a75ecb6","type":"issue","check_name":"LongParameterList","description":"CodeclimateDiff::ResultPrinter#self.print_category has 5 parameters","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":20,"end":20}},"remediation_points":500000,"content":{"body":"A `Long Parameter List` occurs when a method has a lot of parameters.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n def long_list(foo,bar,baz,fling,flung)\n puts foo,bar,baz,fling,flung\n end\nend\n```\n\nReek would report the following warning:\n\n```\ntest.rb -- 1 warning:\n [2]:Dummy#long_list has 5 parameters (LongParameterList)\n```\n\nA common solution to this problem would be the introduction of parameter objects.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"24256875bc239c7ee72e7bf5162a5cf1","type":"issue","check_name":"NestedIterators","description":"CodeclimateDiff::ResultPrinter#self.print_issues contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":41,"end":41}},"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":"dba788bce2d4037f442a07834141f748","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_call_to_action has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":79,"end":79}},"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":"847c6524aee19aaaa5c9f75d2af55034","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_issues has approx 10 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":35,"end":35}},"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":"0e1b58c41f946011380b520b782497f6","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_issues_in_category has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":8,"end":8}},"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":"659011304f57ba6821ee6ecd179e2fe3","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_result has approx 12 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":51,"end":51}},"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":"eebfb3495de5ce6c32cdbdedd3733169","type":"issue","check_name":"BooleanParameter","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has boolean parameter 'always_analyze_all_files'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":74,"end":74}},"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":"f69f9414e9b677df0fe0fa88a56e09e6","type":"issue","check_name":"BooleanParameter","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has boolean parameter 'show_preexisting'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":74,"end":74}},"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":"c9d1604f71aa792148908051a6c30a03","type":"issue","check_name":"ControlParameter","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files is controlled by argument 'always_analyze_all_files'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":26,"end":28}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"3ff6caf742702e28c65517be34dc4a90","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'JSON.parse(result)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":32,"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":"2ace891a3d054cd1d6b178902b0aa4b9","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'JSON.parse(result).each' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":32,"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":"ec3e2cc4884fd40b46e5fcd406caed9d","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'changed_file_issues.append(issue)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":36,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"974a71566e027ab872e3496e1782f85a","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'issue[\"type\"] != \"issue\"' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":33,"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":"ececcf3944ab70f551f1c57fc5f8989f","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'issue[\"type\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":33,"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":"cd318842f19b32d930607d78221cf5c5","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::Runner has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":12,"end":12}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"e5fe8233608d51d516fe9c9662f3bce0","type":"issue","check_name":"NestedIterators","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":45,"end":45}},"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":"545f4e2fbe74902028bcf6c047db975b","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.calculate_changed_filenames has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":13,"end":13}},"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":"911d8c2cd9713eb42fe09220efd48ca7","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files has approx 19 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":22,"end":22}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"b3db1a66f15bef1e6a1a5d9bbb519f26","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":74,"end":74}},"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":"91c4af205f1f773f532585f9dd580548","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":6,"end":6}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}] diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index bd445a4..91ec8fd 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -2,6 +2,7 @@ require "json" require "colorize" +require "pry-byebug" require_relative "./codeclimate_wrapper" require_relative "./result_printer" require_relative "./issue_sorter" From c78515f55958d07385b633a265613d0e4ad32e44 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 13:40:35 +1300 Subject: [PATCH 10/29] feat: initial feature implementation --- .codeclimate.yml | 3 ++- codeclimate_diff_baseline.json | 16 +--------------- lib/codeclimate_diff/runner.rb | 24 +++++++++++++++++++++--- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index f7134fb..0cec9f9 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -13,4 +13,5 @@ checks: threshold: 10 # defaults to 5. Cognitive complexity rather than cyclomatic complexity exclude_patterns: - - "**/spec/" \ No newline at end of file + - "**/spec/" + - "lib/codeclimate_diff/runner.rb" # just testing \ No newline at end of file diff --git a/codeclimate_diff_baseline.json b/codeclimate_diff_baseline.json index 8454bf1..973766c 100644 --- a/codeclimate_diff_baseline.json +++ b/codeclimate_diff_baseline.json @@ -1,8 +1,7 @@ [{"engine_name":"structure","fingerprint":"f8ccebfc07d1a0c9fa77b6325a61b82c","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 `refresh_baseline_if_configured` has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":7,"end":39}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"}, {"engine_name":"structure","fingerprint":"4890c3e24aa5f22bc928ccddd6a60a14","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `sort_issues` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":33,"end":73}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"}, {"engine_name":"structure","fingerprint":"5989a7d02618f9eba49266f1c5473861","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `print_category` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":20,"end":20}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"}, -{"engine_name":"structure","fingerprint":"79ec8f3ef3737357ed2c43ab0a065ef3","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 `calculate_issues_in_changed_files` has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":22,"end":54}},"other_locations":[],"remediation_points":1550000,"severity":"minor","type":"issue"}, -{"name":"ruby.parse.succeeded","type":"measurement","value":7,"engine_name":"structure"}, +{"name":"ruby.parse.succeeded","type":"measurement","value":6,"engine_name":"structure"}, {"engine_name":"reek","fingerprint":"054589dd54a8aef188941b688d099978","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::CodeclimateWrapper has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/codeclimate_wrapper.rb","lines":{"begin":7,"end":7}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, {"engine_name":"reek","fingerprint":"0ab3c6e125bef6686b3c821c59933e08","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'CodeclimateDiff.configuration' 6 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":8,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, {"engine_name":"reek","fingerprint":"585621642e3917aabb584a8dee9dc5b9","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'CodeclimateDiff.configuration[\"gitlab\"]' 5 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":8,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, @@ -44,17 +43,4 @@ {"engine_name":"reek","fingerprint":"847c6524aee19aaaa5c9f75d2af55034","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_issues has approx 10 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":35,"end":35}},"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":"0e1b58c41f946011380b520b782497f6","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_issues_in_category has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":8,"end":8}},"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":"659011304f57ba6821ee6ecd179e2fe3","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_result has approx 12 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":51,"end":51}},"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":"eebfb3495de5ce6c32cdbdedd3733169","type":"issue","check_name":"BooleanParameter","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has boolean parameter 'always_analyze_all_files'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":74,"end":74}},"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":"f69f9414e9b677df0fe0fa88a56e09e6","type":"issue","check_name":"BooleanParameter","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has boolean parameter 'show_preexisting'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":74,"end":74}},"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":"c9d1604f71aa792148908051a6c30a03","type":"issue","check_name":"ControlParameter","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files is controlled by argument 'always_analyze_all_files'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":26,"end":28}},"remediation_points":500000,"content":{"body":"`Control Parameter` is a special case of `Control Couple`\n\n## Example\n\nA simple example would be the \"quoted\" parameter in the following method:\n\n```Ruby\ndef write(quoted)\n if quoted\n write_quoted @value\n else\n write_unquoted @value\n end\nend\n```\n\nFixing those problems is out of the scope of this document but an easy solution could be to remove the \"write\" method alltogether and to move the calls to \"write_quoted\" / \"write_unquoted\" in the initial caller of \"write\".\n"},"severity":"minor"}, -{"engine_name":"reek","fingerprint":"3ff6caf742702e28c65517be34dc4a90","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'JSON.parse(result)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":32,"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":"2ace891a3d054cd1d6b178902b0aa4b9","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'JSON.parse(result).each' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":32,"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":"ec3e2cc4884fd40b46e5fcd406caed9d","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'changed_file_issues.append(issue)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":36,"end":48}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, -{"engine_name":"reek","fingerprint":"974a71566e027ab872e3496e1782f85a","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'issue[\"type\"] != \"issue\"' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":33,"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":"ececcf3944ab70f551f1c57fc5f8989f","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'issue[\"type\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":33,"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":"cd318842f19b32d930607d78221cf5c5","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::Runner has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":12,"end":12}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, -{"engine_name":"reek","fingerprint":"e5fe8233608d51d516fe9c9662f3bce0","type":"issue","check_name":"NestedIterators","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":45,"end":45}},"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":"545f4e2fbe74902028bcf6c047db975b","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.calculate_changed_filenames has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":13,"end":13}},"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":"911d8c2cd9713eb42fe09220efd48ca7","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files has approx 19 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":22,"end":22}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"}, -{"engine_name":"reek","fingerprint":"b3db1a66f15bef1e6a1a5d9bbb519f26","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":74,"end":74}},"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":"91c4af205f1f773f532585f9dd580548","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":6,"end":6}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}] diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index 91ec8fd..7524ab5 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -13,9 +13,27 @@ class Runner def self.calculate_changed_filenames(pattern) extra_grep_filter = pattern ? " | grep '#{pattern}'" : "" branch_name = CodeclimateDiff.configuration["main_branch_name"] || "main" - files_changed_str = `git diff --name-only #{branch_name} | grep --invert-match spec/ | grep --extended-regexp '.js$|.rb$'#{extra_grep_filter}` - files_changed_str.split("\n") - .filter { |filename| File.exist?(filename) } + all_files_changed_str = `git diff --name-only #{branch_name} | grep --extended-regexp '.js$|.rb$'#{extra_grep_filter}` + all_files_changed = all_files_changed_str.split("\n") + .filter { |filename| File.exist?(filename) } + + # load the exclude patterns list from .codeclimate.yml + exclude_patterns = [] + if File.exist?(".codeclimate.yml") + config = YAML.load_file(".codeclimate.yml") + exclude_patterns = config["exclude_patterns"] + end + + files_and_directories_excluded = exclude_patterns.map { |exclude_pattern| Dir.glob(exclude_pattern) }.flatten + + # filter out any files that match the excluded ones + all_files_changed.map do |filename| + next if files_and_directories_excluded.include? filename + + next if files_and_directories_excluded.any? { |excluded_filename| filename.start_with?(excluded_filename) } + + filename + end end def self.calculate_issues_in_changed_files(changed_filenames, always_analyze_all_files) From c259943c76e9e5fb1d51f933144d5914063b0adc Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 13:52:37 +1300 Subject: [PATCH 11/29] fix: should be using filter not map --- lib/codeclimate_diff/runner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index 7524ab5..49d0b99 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -27,12 +27,12 @@ def self.calculate_changed_filenames(pattern) files_and_directories_excluded = exclude_patterns.map { |exclude_pattern| Dir.glob(exclude_pattern) }.flatten # filter out any files that match the excluded ones - all_files_changed.map do |filename| + all_files_changed.filter do |filename| next if files_and_directories_excluded.include? filename next if files_and_directories_excluded.any? { |excluded_filename| filename.start_with?(excluded_filename) } - filename + true end end From 597e9ce4a28721c519d0ec39206547031ef0b7eb Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 13:54:53 +1300 Subject: [PATCH 12/29] chore: bumped the version number --- Gemfile.lock | 2 +- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 892798f..3511f59 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.8) + codeclimate_diff (0.1.9) colorize json optparse diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index 455215a..03209d0 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.8" + VERSION = "0.1.9" end From 5e3085b4b417fa49509811924e818d68acf192cd Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 13:56:27 +1300 Subject: [PATCH 13/29] docs: removing old md file from before it was a gem --- lib/codeclimate_diff.md | 96 ----------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 lib/codeclimate_diff.md diff --git a/lib/codeclimate_diff.md b/lib/codeclimate_diff.md deleted file mode 100644 index 202d554..0000000 --- a/lib/codeclimate_diff.md +++ /dev/null @@ -1,96 +0,0 @@ -# Codeclimate Dev - -This tool lets you see how your branch is affecting the code quality (what issues you've added, fixed, and what issues are outstanding in the files you've touched.) - -It covers 2/3 of our code quality metrics (code smells, cyclomatic complexity, but not similar code). -Codeclimate supports 'duplication' as a plugin, but it takes twice as long to run on everything and only really works if you run it on everything. - - -## First setup - -1. Install the codeclimate cli: - ``` - brew tap codeclimate/formulae - brew install codeclimate - ``` - -2. Add a `.codeclimate.yml` config file eg: - - ``` - --- - version: "2" - plugins: - rubocop: - enabled: true - channel: rubocop-1-36-0 - reek: - enabled: true - - exclude_patterns: - - config/ - - db/ - - dist/ - - features/ - - public/ - - "**/node_modules/" - - script/ - - "**/spec/" - - "**/test/" - - "**/tests/" - - Tests/ - - "**/vendor/" - - "**/*_test.go" - - "**/*.d.ts" - - "**/*.min.js" - - "**/*.min.css" - - "**/__tests__/" - - "**/__mocks__/" - - "/.gitlab/" - - coverage/ - ``` - - 3. Give execute permission for `codeclimate_diff` - - ``` - chmod a+x ./codeclimate_diff - ``` - - 4. Run the baseline and commit the result to the repo - - ``` - ./codeclimate_diff --baseline - ``` - -## Normal workflow - -1. Create a feature branch for your work, and reset the baseline + commit (5 mins) - -2. Do some work - -3. Check if you've added any issues (about 10 secs per code file changed on your branch) - - ``` - # runs on all code files changed in your branch - ./codeclimate_diff - - OR - - # filters the changed files in your branch futher - ./codeclimate_diff --pattern places - - OR - - # only shows the new and fixed issues - ./codeclimate_diff --new-only - ``` -4. Now you have time to fix the issues yay! - - -## Next Steps - -- Extract into a Gem -- See if we can improve performance (it spins up a docker container per file) -- Plug into the pipeline and fail if we've introduced more issues than fixed -- Run duplication in the pipeline. -- Run the baseline in the pipeline and download it from the artifact instead of running locally? - From 4d31cf5fb80052e5e2123270786d12c0a94ade6f Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 13:59:34 +1300 Subject: [PATCH 14/29] refactor: removing code not needed any more --- lib/codeclimate_diff/runner.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index 49d0b99..d2e4f24 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -55,8 +55,6 @@ def self.calculate_issues_in_changed_files(changed_filenames, always_analyze_all else changed_filenames.each do |filename| - next if filename == "codeclimate_diff.rb" # TODO: fix this file's code quality issues when we make a Gem! - puts "Analysing '#{filename}'..." result = CodeclimateWrapper.new.run_codeclimate(filename) JSON.parse(result).each do |issue| From 788a8dd47d63619804d3df97147c293a6006b1ae Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 14:14:41 +1300 Subject: [PATCH 15/29] fix: removed debugging pattern and regenerated the baseline --- .codeclimate.yml | 3 +-- codeclimate_diff_baseline.json | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 0cec9f9..f7134fb 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -13,5 +13,4 @@ checks: threshold: 10 # defaults to 5. Cognitive complexity rather than cyclomatic complexity exclude_patterns: - - "**/spec/" - - "lib/codeclimate_diff/runner.rb" # just testing \ No newline at end of file + - "**/spec/" \ No newline at end of file diff --git a/codeclimate_diff_baseline.json b/codeclimate_diff_baseline.json index 973766c..39763cd 100644 --- a/codeclimate_diff_baseline.json +++ b/codeclimate_diff_baseline.json @@ -1,7 +1,8 @@ [{"engine_name":"structure","fingerprint":"f8ccebfc07d1a0c9fa77b6325a61b82c","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 `refresh_baseline_if_configured` has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":7,"end":39}},"other_locations":[],"remediation_points":450000,"severity":"minor","type":"issue"}, {"engine_name":"structure","fingerprint":"4890c3e24aa5f22bc928ccddd6a60a14","categories":["Complexity"],"check_name":"method_lines","content":{"body":""},"description":"Method `sort_issues` has 26 lines of code (exceeds 25 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/issue_sorter.rb","lines":{"begin":33,"end":73}},"other_locations":[],"remediation_points":624000,"severity":"minor","type":"issue"}, {"engine_name":"structure","fingerprint":"5989a7d02618f9eba49266f1c5473861","categories":["Complexity"],"check_name":"argument_count","content":{"body":""},"description":"Method `print_category` has 5 arguments (exceeds 4 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":20,"end":20}},"other_locations":[],"remediation_points":375000,"severity":"minor","type":"issue"}, -{"name":"ruby.parse.succeeded","type":"measurement","value":6,"engine_name":"structure"}, +{"engine_name":"structure","fingerprint":"79ec8f3ef3737357ed2c43ab0a065ef3","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 `calculate_issues_in_changed_files` has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring.","location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":39,"end":69}},"other_locations":[],"remediation_points":1150000,"severity":"minor","type":"issue"}, +{"name":"ruby.parse.succeeded","type":"measurement","value":7,"engine_name":"structure"}, {"engine_name":"reek","fingerprint":"054589dd54a8aef188941b688d099978","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::CodeclimateWrapper has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/codeclimate_wrapper.rb","lines":{"begin":7,"end":7}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, {"engine_name":"reek","fingerprint":"0ab3c6e125bef6686b3c821c59933e08","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'CodeclimateDiff.configuration' 6 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":8,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, {"engine_name":"reek","fingerprint":"585621642e3917aabb584a8dee9dc5b9","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Downloader#self.refresh_baseline_if_configured calls 'CodeclimateDiff.configuration[\"gitlab\"]' 5 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/downloader.rb","lines":{"begin":8,"end":22}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, @@ -43,4 +44,18 @@ {"engine_name":"reek","fingerprint":"847c6524aee19aaaa5c9f75d2af55034","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_issues has approx 10 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":35,"end":35}},"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":"0e1b58c41f946011380b520b782497f6","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_issues_in_category has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":8,"end":8}},"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":"659011304f57ba6821ee6ecd179e2fe3","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::ResultPrinter#self.print_result has approx 12 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/result_printer.rb","lines":{"begin":51,"end":51}},"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":"eebfb3495de5ce6c32cdbdedd3733169","type":"issue","check_name":"BooleanParameter","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has boolean parameter 'always_analyze_all_files'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":89,"end":89}},"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":"f69f9414e9b677df0fe0fa88a56e09e6","type":"issue","check_name":"BooleanParameter","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has boolean parameter 'show_preexisting'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":89,"end":89}},"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":"c9d1604f71aa792148908051a6c30a03","type":"issue","check_name":"ControlParameter","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files is controlled by argument 'always_analyze_all_files'","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":43,"end":45}},"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":"3ff6caf742702e28c65517be34dc4a90","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'JSON.parse(result)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":49,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"2ace891a3d054cd1d6b178902b0aa4b9","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'JSON.parse(result).each' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":49,"end":60}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"ec3e2cc4884fd40b46e5fcd406caed9d","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'changed_file_issues.append(issue)' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":53,"end":63}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"974a71566e027ab872e3496e1782f85a","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'issue[\"type\"] != \"issue\"' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":50,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"ececcf3944ab70f551f1c57fc5f8989f","type":"issue","check_name":"DuplicateMethodCall","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files calls 'issue[\"type\"]' 2 times","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":50,"end":61}},"remediation_points":350000,"content":{"body":"Duplication occurs when two fragments of code look nearly identical, or when two fragments of code have nearly identical effects at some conceptual level.\n\nReek implements a check for _Duplicate Method Call_.\n\n## Example\n\nHere's a very much simplified and contrived example. The following method will report a warning:\n\n```Ruby\ndef double_thing()\n @other.thing + @other.thing\nend\n```\n\nOne quick approach to silence Reek would be to refactor the code thus:\n\n```Ruby\ndef double_thing()\n thing = @other.thing\n thing + thing\nend\n```\n\nA slightly different approach would be to replace all calls of `double_thing` by calls to `@other.double_thing`:\n\n```Ruby\nclass Other\n def double_thing()\n thing + thing\n end\nend\n```\n\nThe approach you take will depend on balancing other factors in your code.\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"cd318842f19b32d930607d78221cf5c5","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff::Runner has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":12,"end":12}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"eaaa4ef4913d7d7dedf4596bf06edb8b","type":"issue","check_name":"NestedIterators","description":"CodeclimateDiff::Runner#self.calculate_changed_filenames contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":33,"end":33}},"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":"e5fe8233608d51d516fe9c9662f3bce0","type":"issue","check_name":"NestedIterators","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files contains iterators nested 2 deep","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":60,"end":60}},"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":"545f4e2fbe74902028bcf6c047db975b","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.calculate_changed_filenames has approx 16 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":13,"end":13}},"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":"911d8c2cd9713eb42fe09220efd48ca7","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.calculate_issues_in_changed_files has approx 18 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":39,"end":39}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"}, +{"engine_name":"reek","fingerprint":"b3db1a66f15bef1e6a1a5d9bbb519f26","type":"issue","check_name":"TooManyStatements","description":"CodeclimateDiff::Runner#self.run_diff_on_branch has approx 7 statements","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff/runner.rb","lines":{"begin":89,"end":89}},"remediation_points":500000,"content":{"body":"A method with `Too Many Statements` is any method that has a large number of lines.\n\n`Too Many Statements` warns about any method that has more than 5 statements. Reek's smell detector for `Too Many Statements` counts +1 for every simple statement in a method and +1 for every statement within a control structure (`if`, `else`, `case`, `when`, `for`, `while`, `until`, `begin`, `rescue`) but it doesn't count the control structure itself.\n\nSo the following method would score +6 in Reek's statement-counting algorithm:\n\n```Ruby\ndef parse(arg, argv, \u0026error)\n if !(val = arg) and (argv.empty? or /\\A-/ =~ (val = argv[0]))\n return nil, block, nil # +1\n end\n opt = (val = parse_arg(val, \u0026error))[1] # +2\n val = conv_arg(*val) # +3\n if opt and !arg\n argv.shift # +4\n else\n val[0] = nil # +5\n end\n val # +6\nend\n```\n\n(You might argue that the two assigments within the first @if@ should count as statements, and that perhaps the nested assignment should count as +2.)\n"},"severity":"minor"}, {"engine_name":"reek","fingerprint":"91c4af205f1f773f532585f9dd580548","type":"issue","check_name":"IrresponsibleModule","description":"CodeclimateDiff has no descriptive comment","categories":["Complexity"],"location":{"path":"lib/codeclimate_diff.rb","lines":{"begin":6,"end":6}},"remediation_points":350000,"content":{"body":"Classes and modules are the units of reuse and release. It is therefore considered good practice to annotate every class and module with a brief comment outlining its responsibilities.\n\n## Example\n\nGiven\n\n```Ruby\nclass Dummy\n # Do things...\nend\n```\n\nReek would emit the following warning:\n\n```\ntest.rb -- 1 warning:\n [1]:Dummy has no descriptive comment (IrresponsibleModule)\n```\n\nFixing this is simple - just an explaining comment:\n\n```Ruby\n# The Dummy class is responsible for ...\nclass Dummy\n # Do things...\nend\n```\n"},"severity":"minor"}] From 6c27935598e84987169ccaa5dbe54df733be8328 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 17 Mar 2023 14:15:23 +1300 Subject: [PATCH 16/29] conf: Add .codeclimate_diff.yml --- .codeclimate_diff.yml | 2 ++ .gitignore | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .codeclimate_diff.yml diff --git a/.codeclimate_diff.yml b/.codeclimate_diff.yml new file mode 100644 index 0000000..165c40f --- /dev/null +++ b/.codeclimate_diff.yml @@ -0,0 +1,2 @@ +main_branch_name: main +threshold_to_run_on_all_files: 10 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9c17945..b04a8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ # rspec failure tracking .rspec_status -.codeclimate_diff.yml From 69b1d86df7dcf786aba29bfbfd83635127d728fe Mon Sep 17 00:00:00 2001 From: Izzi <100389760+isabel-anastasiadis-boost@users.noreply.github.com> Date: Wed, 3 May 2023 13:35:52 +1200 Subject: [PATCH 17/29] Update README.md The gem isn't on rubygems yet, so fixed instructions and a typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cff8a17..316b7e1 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under enabled: false ``` -4. Add a `.codecimate_diff.yml` configuration file +4. Add a `.codeclimate_diff.yml` configuration file ``` main_branch_name: master # defaults to main threshold_to_run_on_all_files: 8 # when you reach a certain number of files changed, it becomes faster to analyze all files rather than analyze them one by one. @@ -93,7 +93,7 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under Add this line to your application's Gemfile: ```ruby - gem 'codeclimate_diff' + gem 'codeclimate_diff', github: 'boost/codeclimate_diff' ``` Install the gem: From 0d3baba30f9b3c5280d722f7b2c88f4fd8e7c7ee Mon Sep 17 00:00:00 2001 From: Richard Matthews Date: Fri, 7 Jul 2023 09:32:45 +1200 Subject: [PATCH 18/29] allow specifying the docker platform to support different mac processors --- .codeclimate_diff.yml | 4 +++- lib/codeclimate_diff/codeclimate_wrapper.rb | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.codeclimate_diff.yml b/.codeclimate_diff.yml index 165c40f..0f32f9c 100644 --- a/.codeclimate_diff.yml +++ b/.codeclimate_diff.yml @@ -1,2 +1,4 @@ main_branch_name: main -threshold_to_run_on_all_files: 10 \ No newline at end of file +threshold_to_run_on_all_files: 10 +# For ARM based processors, use linux/x86_64 +docker_platform: linux/amd64 \ No newline at end of file diff --git a/lib/codeclimate_diff/codeclimate_wrapper.rb b/lib/codeclimate_diff/codeclimate_wrapper.rb index b15d158..458f3ed 100644 --- a/lib/codeclimate_diff/codeclimate_wrapper.rb +++ b/lib/codeclimate_diff/codeclimate_wrapper.rb @@ -5,13 +5,17 @@ module CodeclimateDiff class CodeclimateWrapper + def run_codeclimate(filename = "") + docker_platform = CodeclimateDiff.configuration["docker_platform"] || "linux/amd64" + `docker run \ --interactive --tty --rm \ --env CODECLIMATE_CODE="$PWD" \ --volume "$PWD":/code \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume /tmp/cc:/tmp/cc \ + --platform #{docker_platform} \ codeclimate/codeclimate analyze -f json #{filename}` end From 52c59adc15f50fafb68bab807f7cc74755c9ead8 Mon Sep 17 00:00:00 2001 From: Isabel Anastasiadis Date: Fri, 7 Jul 2023 09:57:46 +1200 Subject: [PATCH 19/29] upgrade: incremented version --- Gemfile.lock | 2 +- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3511f59..0abe462 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.9) + codeclimate_diff (0.1.10) colorize json optparse diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index 03209d0..63ee355 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.9" + VERSION = "0.1.10" end From f53333ad2879cb3a50dc362a559333a88f099e23 Mon Sep 17 00:00:00 2001 From: Izzi <100389760+isabel-anastasiadis-boost@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:29:11 +1300 Subject: [PATCH 20/29] Update README.md Excluding utility function if it is private --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 316b7e1..42796a5 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,9 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under TooManyStatements: max_statements: 10 # defaults to 5. You want this number realistic but stretchy so we can move it down + UtilityFunction: + public_methods_only: true + directories: "app/controllers": IrresponsibleModule: From 6030bf3841081f850773f65fce667726500f5967 Mon Sep 17 00:00:00 2001 From: Izzi <100389760+isabel-anastasiadis-boost@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:05:01 +1300 Subject: [PATCH 21/29] Update README.md Add UncommunicativeVariableName config --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 42796a5..4264f21 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under UtilityFunction: public_methods_only: true + UncommunicativeVariableName: + accept: + - e + directories: "app/controllers": IrresponsibleModule: From 32e3101935976eecd8ac59b65a205cba3c85d933 Mon Sep 17 00:00:00 2001 From: Izzi <100389760+isabel-anastasiadis-boost@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:48:03 +1300 Subject: [PATCH 22/29] Update README.md We don't think NilCheck and ManualDispatch help us write better code --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 4264f21..f87026f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,12 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under IrresponsibleModule: enabled: false + NilCheck: + enabled: false + + ManualDispatch: + enabled: false + LongParameterList: max_params: 4 # defaults to 3. You want this number realistic but stretchy so we can move it down From 2b21409343d5f5bc518b130fc1db6b87ccaf99a7 Mon Sep 17 00:00:00 2001 From: lun Date: Fri, 30 Aug 2024 15:40:23 +1200 Subject: [PATCH 23/29] feat: set up automated baseline generation --- lib/codeclimate_diff/runner.rb | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index d2e4f24..16f1d46 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -86,8 +86,29 @@ def self.generate_baseline puts "Done!" end + def self.setup_baseline_for_branch + main_branch = CodeclimateDiff.configuration["main_branch_name"] || "main" + + project_repo = `basename $(pwd)`.strip + + puts "Creating a temp worktree to generate the baseline..." + system("git worktree add ../temp-codeclimate #{main_branch}") + + Dir.chdir("../temp-codeclimate") do + # Execute shell command in the '../temp-codeclimate' directory + generate_baseline + + puts "Copying the baseline to #{project_repo}..." + system("cp codeclimate_diff_baseline.json ../#{project_repo}") + end + + puts("Removing the temp worktree...") + system("git worktree remove ../temp-codeclimate") + end + def self.run_diff_on_branch(pattern, always_analyze_all_files: false, show_preexisting: true) - CodeclimateWrapper.new.pull_latest_image + # CodeclimateWrapper.new.pull_latest_image + setup_baseline_for_branch changed_filenames = calculate_changed_filenames(pattern) From 47823f0a9524b1b3304f7845ed30f3b82fc977c2 Mon Sep 17 00:00:00 2001 From: lun Date: Fri, 30 Aug 2024 15:54:07 +1200 Subject: [PATCH 24/29] feat: only generate baseline if it hasn't already been generated --- exe/codeclimate_diff | 10 +++++----- lib/codeclimate_diff/runner.rb | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/exe/codeclimate_diff b/exe/codeclimate_diff index e232476..1ac8731 100755 --- a/exe/codeclimate_diff +++ b/exe/codeclimate_diff @@ -23,10 +23,10 @@ OptionParser.new do |opts| "Grep pattern to filter files. If provided, will filter the files changed on your branch further.") end.parse!(into: options) -if options[:baseline] - CodeclimateDiff::Runner.generate_baseline -elsif options[:"new-only"] - CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], always_analyze_all_files: options[:all], show_preexisting: false) +if options[:"new-only"] + CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], always_analyze_all_files: options[:all], + show_preexisting: false) else - CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], always_analyze_all_files: options[:all], show_preexisting: true) + CodeclimateDiff::Runner.run_diff_on_branch(options[:pattern], always_analyze_all_files: options[:all], + show_preexisting: true) end diff --git a/lib/codeclimate_diff/runner.rb b/lib/codeclimate_diff/runner.rb index 16f1d46..1816710 100644 --- a/lib/codeclimate_diff/runner.rb +++ b/lib/codeclimate_diff/runner.rb @@ -95,7 +95,6 @@ def self.setup_baseline_for_branch system("git worktree add ../temp-codeclimate #{main_branch}") Dir.chdir("../temp-codeclimate") do - # Execute shell command in the '../temp-codeclimate' directory generate_baseline puts "Copying the baseline to #{project_repo}..." @@ -107,8 +106,7 @@ def self.setup_baseline_for_branch end def self.run_diff_on_branch(pattern, always_analyze_all_files: false, show_preexisting: true) - # CodeclimateWrapper.new.pull_latest_image - setup_baseline_for_branch + setup_baseline_for_branch unless File.exist?("codeclimate_diff_baseline.json") changed_filenames = calculate_changed_filenames(pattern) From 42c80afd926a2a998cbe3ccdbf3d381049be65a2 Mon Sep 17 00:00:00 2001 From: lun Date: Fri, 30 Aug 2024 15:59:30 +1200 Subject: [PATCH 25/29] chore: update readme --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f87026f..a3ee640 100644 --- a/README.md +++ b/README.md @@ -120,15 +120,12 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under $ bundle binstubs codeclimate_diff -6. Run the baseline and commit the result to the repo + Add codeclimate_diff_baseline.json to .gitignore - ``` - ./bin/codeclimate_diff --baseline - ``` ## Usage -1. Create a feature branch for your work, and reset the baseline + commit (5 mins) +1. Create a feature branch for your work 2. Do some work @@ -137,7 +134,7 @@ It runs the https://hub.docker.com/r/codeclimate/codeclimate docker image under ```bash # runs on each file changed in your branch (about 10 secs per code file changed on your branch) ./bin/codeclimate_diff - + # baseline is now generated on first run, to generate new baseline, delete the existing. OR # filters the changed files in your branch futher by a grep pattern From 0cb87e4a49647979cf4fe55a6d7bc094f8af3e1a Mon Sep 17 00:00:00 2001 From: Daniela Lemow Date: Tue, 24 Sep 2024 16:16:11 +1200 Subject: [PATCH 26/29] fix: Update json gem which has bug --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0abe462..aa75b5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -21,7 +21,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - json (2.6.2) + json (2.7.2) method_source (1.0.0) mime-types (3.4.1) mime-types-data (~> 3.2015) @@ -92,4 +92,4 @@ DEPENDENCIES rubocop (~> 1.21) BUNDLED WITH - 2.3.7 + 2.5.11 From 4ecbede2cc7c6a127b9b5c188649c2dad5d97f30 Mon Sep 17 00:00:00 2001 From: Paul Mesnilgrente Date: Mon, 30 Sep 2024 22:08:11 +0200 Subject: [PATCH 27/29] conf: created a version bump --- Gemfile.lock | 4 ++-- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index aa75b5c..d9de55c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - codeclimate_diff (0.1.10) + codeclimate_diff (0.1.13) colorize json optparse @@ -92,4 +92,4 @@ DEPENDENCIES rubocop (~> 1.21) BUNDLED WITH - 2.5.11 + 2.5.20 diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index 63ee355..a5dfa15 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.10" + VERSION = "0.1.13" end From f474a59c7e5a8ccd744ccd675e3823ba084dc820 Mon Sep 17 00:00:00 2001 From: Paul Mesnilgrente Date: Mon, 30 Sep 2024 22:13:13 +0200 Subject: [PATCH 28/29] conf: upgraded rexml to fix CVE --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d9de55c..494c3a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.5) + rexml (3.3.8) rspec (3.11.0) rspec-core (~> 3.11.0) rspec-expectations (~> 3.11.0) From 466dced92eaee306ba007e08c9f519e634ea96fc Mon Sep 17 00:00:00 2001 From: Andy Anastasiadis-Gray Date: Tue, 19 Nov 2024 14:03:01 +1300 Subject: [PATCH 29/29] fix: remove the warning from docker image output --- lib/codeclimate_diff/codeclimate_wrapper.rb | 4 +++- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/codeclimate_diff/codeclimate_wrapper.rb b/lib/codeclimate_diff/codeclimate_wrapper.rb index 458f3ed..02b5cb7 100644 --- a/lib/codeclimate_diff/codeclimate_wrapper.rb +++ b/lib/codeclimate_diff/codeclimate_wrapper.rb @@ -9,7 +9,7 @@ class CodeclimateWrapper def run_codeclimate(filename = "") docker_platform = CodeclimateDiff.configuration["docker_platform"] || "linux/amd64" - `docker run \ + output = `docker run \ --interactive --tty --rm \ --env CODECLIMATE_CODE="$PWD" \ --volume "$PWD":/code \ @@ -17,6 +17,8 @@ def run_codeclimate(filename = "") --volume /tmp/cc:/tmp/cc \ --platform #{docker_platform} \ codeclimate/codeclimate analyze -f json #{filename}` + + output.gsub(/.*?(?=\[{)/im, "") # remove everything before the first json object (ie WARNINGS) end def pull_latest_image diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index a5dfa15..6ed8235 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.13" + VERSION = "0.1.14" end