{"action":"created","comment":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/comments/42158022","id":42158022,"diff_hunk":"@@ -30,16 +30,23 @@ def paths\n         end\n \n         def engine_paths\n-          engine_language =  engine_config.\n-            fetch(\"config\", {}).\n-            fetch(\"languages\", {}).\n-            fetch(language, {})\n+          if current_language.is_a?(Hash)\n+            current_language[\"paths\"]\n+          end\n+        end\n \n-          if engine_language.is_a?(Hash)\n-            engine_language[\"paths\"]\n+        def current_language\n+          if engine_languages.is_a?(Hash)\n+            @current_language ||= engine_languages.fetch(language, {})\n           end\n         end\n \n+        def engine_languages\n+          @engine_language ||= languages = engine_config.","path":"lib/cc/engine/analyzers/file_list.rb","position":22,"original_position":22,"commit_id":"98e40f0596b8ad56cf0640a4a1eb825e47d05f9f","original_commit_id":"98e40f0596b8ad56cf0640a4a1eb825e47d05f9f","user":{"login":"GordonDiggs","id":245083,"avatar_url":"https://avatars.githubusercontent.com/u/245083?v=3","gravatar_id":"","url":"https://api.github.com/users/GordonDiggs","html_url":"https://github.com/GordonDiggs","followers_url":"https://api.github.com/users/GordonDiggs/followers","following_url":"https://api.github.com/users/GordonDiggs/following{/other_user}","gists_url":"https://api.github.com/users/GordonDiggs/gists{/gist_id}","starred_url":"https://api.github.com/users/GordonDiggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GordonDiggs/subscriptions","organizations_url":"https://api.github.com/users/GordonDiggs/orgs","repos_url":"https://api.github.com/users/GordonDiggs/repos","events_url":"https://api.github.com/users/GordonDiggs/events{/privacy}","received_events_url":"https://api.github.com/users/GordonDiggs/received_events","type":"User","site_admin":false},"body":"what is `languages` used for?","created_at":"2015-10-15T18:00:12Z","updated_at":"2015-10-15T18:00:12Z","html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/10#discussion_r42158022","pull_request_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/comments/42158022"},"html":{"href":"https://github.com/codeclimate/codeclimate-duplication/pull/10#discussion_r42158022"},"pull_request":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10","id":47819763,"html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/10","diff_url":"https://github.com/codeclimate/codeclimate-duplication/pull/10.diff","patch_url":"https://github.com/codeclimate/codeclimate-duplication/pull/10.patch","issue_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/10","number":10,"state":"open","locked":false,"title":"Make config fetching safer","user":{"login":"BlakeWilliams","id":342554,"avatar_url":"https://avatars.githubusercontent.com/u/342554?v=3","gravatar_id":"","url":"https://api.github.com/users/BlakeWilliams","html_url":"https://github.com/BlakeWilliams","followers_url":"https://api.github.com/users/BlakeWilliams/followers","following_url":"https://api.github.com/users/BlakeWilliams/following{/other_user}","gists_url":"https://api.github.com/users/BlakeWilliams/gists{/gist_id}","starred_url":"https://api.github.com/users/BlakeWilliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlakeWilliams/subscriptions","organizations_url":"https://api.github.com/users/BlakeWilliams/orgs","repos_url":"https://api.github.com/users/BlakeWilliams/repos","events_url":"https://api.github.com/users/BlakeWilliams/events{/privacy}","received_events_url":"https://api.github.com/users/BlakeWilliams/received_events","type":"User","site_admin":false},"body":"The current code makes a few assumptions about the format of your\n`.codeclimate.yml` which can cause the engine to crash.\n\nThis changes the way we fetch the configuration to consider that not\nonly may the keys not be present, but they might also not always be the\ntype we expect.","created_at":"2015-10-15T17:55:56Z","updated_at":"2015-10-15T18:00:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3110d242e6e571a3b6750eda59e69df54582b84d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10/commits","review_comments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10/comments","review_comment_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/10/comments","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/statuses/98e40f0596b8ad56cf0640a4a1eb825e47d05f9f","head":{"label":"codeclimate:bmw-config-tweaks","ref":"bmw-config-tweaks","sha":"98e40f0596b8ad56cf0640a4a1eb825e47d05f9f","user":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"repo":{"id":41421994,"name":"codeclimate-duplication","full_name":"codeclimate/codeclimate-duplication","owner":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeclimate/codeclimate-duplication","description":"Code Climate engine for code duplication analysis","fork":false,"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication","forks_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/forks","keys_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/teams","hooks_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/hooks","issue_events_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/events{/number}","events_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/events","assignees_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/assignees{/user}","branches_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/branches{/branch}","tags_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/tags","blobs_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/statuses/{sha}","languages_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/languages","stargazers_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/stargazers","contributors_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/contributors","subscribers_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/subscribers","subscription_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/subscription","commits_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/contents/{+path}","compare_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/merges","archive_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/downloads","issues_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues{/number}","pulls_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls{/number}","milestones_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/milestones{/number}","notifications_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/labels{/name}","releases_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/releases{/id}","created_at":"2015-08-26T11:29:43Z","updated_at":"2015-10-13T20:35:37Z","pushed_at":"2015-10-15T17:58:32Z","git_url":"git://github.com/codeclimate/codeclimate-duplication.git","ssh_url":"git@github.com:codeclimate/codeclimate-duplication.git","clone_url":"https://github.com/codeclimate/codeclimate-duplication.git","svn_url":"https://github.com/codeclimate/codeclimate-duplication","homepage":"http://codeclimate.com","size":278,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"codeclimate:master","ref":"master","sha":"874486b303710421576073b3d58fa5650a3c970a","user":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"repo":{"id":41421994,"name":"codeclimate-duplication","full_name":"codeclimate/codeclimate-duplication","owner":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeclimate/codeclimate-duplication","description":"Code Climate engine for code duplication analysis","fork":false,"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication","forks_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/forks","keys_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/teams","hooks_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/hooks","issue_events_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/events{/number}","events_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/events","assignees_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/assignees{/user}","branches_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/branches{/branch}","tags_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/tags","blobs_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/statuses/{sha}","languages_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/languages","stargazers_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/stargazers","contributors_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/contributors","subscribers_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/subscribers","subscription_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/subscription","commits_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/contents/{+path}","compare_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/merges","archive_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/downloads","issues_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues{/number}","pulls_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls{/number}","milestones_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/milestones{/number}","notifications_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/labels{/name}","releases_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/releases{/id}","created_at":"2015-08-26T11:29:43Z","updated_at":"2015-10-13T20:35:37Z","pushed_at":"2015-10-15T17:58:32Z","git_url":"git://github.com/codeclimate/codeclimate-duplication.git","ssh_url":"git@github.com:codeclimate/codeclimate-duplication.git","clone_url":"https://github.com/codeclimate/codeclimate-duplication.git","svn_url":"https://github.com/codeclimate/codeclimate-duplication","homepage":"http://codeclimate.com","size":278,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10"},"html":{"href":"https://github.com/codeclimate/codeclimate-duplication/pull/10"},"issue":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/10"},"comments":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/statuses/98e40f0596b8ad56cf0640a4a1eb825e47d05f9f"}}}}