{"action":"created","comment":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/comments/50611476","id":50611476,"diff_hunk":"@@ -27,13 +29,13 @@\n         \"path\" => \"foo.js\",\n         \"lines\" => { \"begin\" => 1, \"end\" => 1 },\n       })\n-      expect(json[\"remediation_points\"]).to eq(297000)\n+      expect(json[\"remediation_points\"]).to eq(33000)","path":"spec/cc/engine/analyzers/javascript/main_spec.rb","position":16,"original_position":16,"commit_id":"d78e903c33f2f84b4b819818c686838acae52ef3","original_commit_id":"d78e903c33f2f84b4b819818c686838acae52ef3","user":{"login":"wfleming","id":188402,"avatar_url":"https://avatars.githubusercontent.com/u/188402?v=3","gravatar_id":"","url":"https://api.github.com/users/wfleming","html_url":"https://github.com/wfleming","followers_url":"https://api.github.com/users/wfleming/followers","following_url":"https://api.github.com/users/wfleming/following{/other_user}","gists_url":"https://api.github.com/users/wfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/wfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfleming/subscriptions","organizations_url":"https://api.github.com/users/wfleming/orgs","repos_url":"https://api.github.com/users/wfleming/repos","events_url":"https://api.github.com/users/wfleming/events{/privacy}","received_events_url":"https://api.github.com/users/wfleming/received_events","type":"User","site_admin":false},"body":":lipstick: `33_000`","created_at":"2016-01-23T01:06:54Z","updated_at":"2016-01-23T01:06:54Z","html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/78#discussion_r50611476","pull_request_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/comments/50611476"},"html":{"href":"https://github.com/codeclimate/codeclimate-duplication/pull/78#discussion_r50611476"},"pull_request":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78","id":56535255,"html_url":"https://github.com/codeclimate/codeclimate-duplication/pull/78","diff_url":"https://github.com/codeclimate/codeclimate-duplication/pull/78.diff","patch_url":"https://github.com/codeclimate/codeclimate-duplication/pull/78.patch","issue_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/78","number":78,"state":"open","locked":false,"title":"Tune python duplication remediation points","user":{"login":"ABaldwinHunter","id":8718443,"avatar_url":"https://avatars.githubusercontent.com/u/8718443?v=3","gravatar_id":"","url":"https://api.github.com/users/ABaldwinHunter","html_url":"https://github.com/ABaldwinHunter","followers_url":"https://api.github.com/users/ABaldwinHunter/followers","following_url":"https://api.github.com/users/ABaldwinHunter/following{/other_user}","gists_url":"https://api.github.com/users/ABaldwinHunter/gists{/gist_id}","starred_url":"https://api.github.com/users/ABaldwinHunter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ABaldwinHunter/subscriptions","organizations_url":"https://api.github.com/users/ABaldwinHunter/orgs","repos_url":"https://api.github.com/users/ABaldwinHunter/repos","events_url":"https://api.github.com/users/ABaldwinHunter/events{/privacy}","received_events_url":"https://api.github.com/users/ABaldwinHunter/received_events","type":"User","site_admin":false},"body":"- Reduce AST threshold from 40 to 31 (classic is 28)\r\n- update point formula to match classic computation\r\n\r\nChange from\r\n     `remediations_points = n * score`\r\nto\r\n    `remediation_points = x + (score-threshold) * y`\r\n\r\nThis change increases parity with classic and overall increases the number of duplication issues reported.\r\n\r\n[link to grade comparisons](https://gist.github.com/ABaldwinHunter/e280310b4987766efd8c)\r\n\r\n**Note**: @GordonDiggs and I are exploring exactly why there are parser differences between Classic and Platform - there are a number of relevant factors, including likely differences between versions of Python. \r\n\r\nNote on mass difference:\r\n\r\nThe mass of node corresponds to its size. Specifying a minimum threshold tells Code Climate to ignore duplication in nodes below a certain size (e.g. one liners).\r\n\r\nThe issue's Flay score is the result of its **mass** * **number of occurrences** (or number of occurrences ^ 2, if the code is identical).\r\n\r\nComparing issue **mass** between parser in Platform and Classic:\r\n\r\n| Platform  | Classic |  Platform / Classic    |\r\n------------ | --------------- | ------------\r\n 42      |  39   |  1.07\r\n 45      |  40   |  1.125\r\n 66      |  57   |  1.15789\r\n 123      |  109  | 1.1284\r\n  126    |  93  | 1.3548\r\n  246      |  218  | 1.1284\r\n\r\nI've estimated the factor of mass difference to be ~ 1.15\r\nSince the default Python duplication mass threshold on Classic was 28, and  `28 * 1.15 = 32.19999`, I've lowered our current default threshold for Python on Platform from 40 to 32.\r\n\r\nOn Classic, Python duplication issues were penalized in terms of remediation points as follows:\r\n\r\n`1_500_000 + overage * 50_000`\r\nwhere overage = **score** - **threshold**\r\n( and score = f(mass) ) \r\n\r\nI've kept the base points but lowered the per_cost to 30_000 to account for the difference in mass parsing (which gets amplified in the points calculation. \r\n\r\n@codeclimate/review \r\n","created_at":"2016-01-19T22:24:42Z","updated_at":"2016-01-23T01:06:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3af9958f34bfa2b65c0381611b0e2008c779eda9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78/commits","review_comments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78/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/78/comments","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/statuses/d78e903c33f2f84b4b819818c686838acae52ef3","head":{"label":"codeclimate:abh-python-tuning","ref":"abh-python-tuning","sha":"d78e903c33f2f84b4b819818c686838acae52ef3","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}","deployments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/deployments","created_at":"2015-08-26T11:29:43Z","updated_at":"2016-01-21T18:30:45Z","pushed_at":"2016-01-22T23:50:07Z","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":199,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":4,"default_branch":"master"}},"base":{"label":"codeclimate:master","ref":"master","sha":"4e3426e0c2a65b81b845c78ef112b347ef919b7b","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}","deployments_url":"https://api.github.com/repos/codeclimate/codeclimate-duplication/deployments","created_at":"2015-08-26T11:29:43Z","updated_at":"2016-01-21T18:30:45Z","pushed_at":"2016-01-22T23:50:07Z","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":199,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78"},"html":{"href":"https://github.com/codeclimate/codeclimate-duplication/pull/78"},"issue":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/78"},"comments":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/pulls/78/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/78/commits"},"statuses":{"href":"https://api.github.com/repos/codeclimate/codeclimate-duplication/statuses/d78e903c33f2f84b4b819818c686838acae52ef3"}}}}