{"action":"opened","number":51,"pull_request":{"url":"https://api.github.com/repos/cfpb/front-end/pulls/51","id":36214143,"html_url":"https://github.com/cfpb/front-end/pull/51","diff_url":"https://github.com/cfpb/front-end/pull/51.diff","patch_url":"https://github.com/cfpb/front-end/pull/51.patch","issue_url":"https://api.github.com/repos/cfpb/front-end/issues/51","number":51,"state":"open","locked":false,"title":"Relaxes complexity setting to 4","user":{"login":"anselmbradford","id":704760,"avatar_url":"https://avatars.githubusercontent.com/u/704760?v=3","gravatar_id":"","url":"https://api.github.com/users/anselmbradford","html_url":"https://github.com/anselmbradford","followers_url":"https://api.github.com/users/anselmbradford/followers","following_url":"https://api.github.com/users/anselmbradford/following{/other_user}","gists_url":"https://api.github.com/users/anselmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/anselmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anselmbradford/subscriptions","organizations_url":"https://api.github.com/users/anselmbradford/orgs","repos_url":"https://api.github.com/users/anselmbradford/repos","events_url":"https://api.github.com/users/anselmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/anselmbradford/received_events","type":"User","site_admin":false},"body":"Relaxes complexity setting to 4 to allow for switch statements and certain if statement structures.\r\n\r\nA cyclomatic complexity of 3 allows:\r\n\r\n```js\r\nif (arg1 === true) { … }\r\nelse if (arg2 === true { … }\r\nelse { … }\r\n```\r\n\r\nHowever, there are circumstances where it's not desirable to have a catch-all else block at the end, and instead the following is needed:\r\n\r\n```js\r\nif (arg1 === true) { … }\r\nelse if (arg2 === true) { … }\r\nelse if (arg3 === true) { … }\r\n```\r\n\r\nThis has a cyclomatic complexity of 4, presumably because there's an implicit ending else statement that could be present. This also applies to `switch` statements, which have an implicit \"default\" block that will increment the complexity by one.\r\n\r\nThis PR proposes raising the cyclomatic complexity threshold to 4 to allow for three route if/else blocks without a catch-all else block at the end.\r\n\r\n## Changes\r\n\r\n- Changes ESLint `complexity` threshold from `3` to `4`.\r\n\r\n## Testing\r\n\r\n```js\r\nif (arg1 === true) { … }\r\nelse if (arg2 === true) { … }\r\nelse if (arg3 === true) { … }\r\n```\r\n\r\nShould not throw an ESLint warning.\r\n\r\n## Review\r\n\r\n- @ascott1 \r\n- @wpears \r\n- @mistergone \r\n","created_at":"2015-05-26T15:25:25Z","updated_at":"2015-05-26T15:25:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cfpb/front-end/pulls/51/commits","review_comments_url":"https://api.github.com/repos/cfpb/front-end/pulls/51/comments","review_comment_url":"https://api.github.com/repos/cfpb/front-end/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfpb/front-end/issues/51/comments","statuses_url":"https://api.github.com/repos/cfpb/front-end/statuses/7792644c2b81a2d9149cdbdb0b1400b69e224846","head":{"label":"anselmbradford:relax-complexity","ref":"relax-complexity","sha":"7792644c2b81a2d9149cdbdb0b1400b69e224846","user":{"login":"anselmbradford","id":704760,"avatar_url":"https://avatars.githubusercontent.com/u/704760?v=3","gravatar_id":"","url":"https://api.github.com/users/anselmbradford","html_url":"https://github.com/anselmbradford","followers_url":"https://api.github.com/users/anselmbradford/followers","following_url":"https://api.github.com/users/anselmbradford/following{/other_user}","gists_url":"https://api.github.com/users/anselmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/anselmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anselmbradford/subscriptions","organizations_url":"https://api.github.com/users/anselmbradford/orgs","repos_url":"https://api.github.com/users/anselmbradford/repos","events_url":"https://api.github.com/users/anselmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/anselmbradford/received_events","type":"User","site_admin":false},"repo":{"id":33880585,"name":"front-end","full_name":"anselmbradford/front-end","owner":{"login":"anselmbradford","id":704760,"avatar_url":"https://avatars.githubusercontent.com/u/704760?v=3","gravatar_id":"","url":"https://api.github.com/users/anselmbradford","html_url":"https://github.com/anselmbradford","followers_url":"https://api.github.com/users/anselmbradford/followers","following_url":"https://api.github.com/users/anselmbradford/following{/other_user}","gists_url":"https://api.github.com/users/anselmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/anselmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anselmbradford/subscriptions","organizations_url":"https://api.github.com/users/anselmbradford/orgs","repos_url":"https://api.github.com/users/anselmbradford/repos","events_url":"https://api.github.com/users/anselmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/anselmbradford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anselmbradford/front-end","description":"A repository for the discussion and publication of the CFPB front-end team standards.","fork":true,"url":"https://api.github.com/repos/anselmbradford/front-end","forks_url":"https://api.github.com/repos/anselmbradford/front-end/forks","keys_url":"https://api.github.com/repos/anselmbradford/front-end/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anselmbradford/front-end/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anselmbradford/front-end/teams","hooks_url":"https://api.github.com/repos/anselmbradford/front-end/hooks","issue_events_url":"https://api.github.com/repos/anselmbradford/front-end/issues/events{/number}","events_url":"https://api.github.com/repos/anselmbradford/front-end/events","assignees_url":"https://api.github.com/repos/anselmbradford/front-end/assignees{/user}","branches_url":"https://api.github.com/repos/anselmbradford/front-end/branches{/branch}","tags_url":"https://api.github.com/repos/anselmbradford/front-end/tags","blobs_url":"https://api.github.com/repos/anselmbradford/front-end/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anselmbradford/front-end/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anselmbradford/front-end/git/refs{/sha}","trees_url":"https://api.github.com/repos/anselmbradford/front-end/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anselmbradford/front-end/statuses/{sha}","languages_url":"https://api.github.com/repos/anselmbradford/front-end/languages","stargazers_url":"https://api.github.com/repos/anselmbradford/front-end/stargazers","contributors_url":"https://api.github.com/repos/anselmbradford/front-end/contributors","subscribers_url":"https://api.github.com/repos/anselmbradford/front-end/subscribers","subscription_url":"https://api.github.com/repos/anselmbradford/front-end/subscription","commits_url":"https://api.github.com/repos/anselmbradford/front-end/commits{/sha}","git_commits_url":"https://api.github.com/repos/anselmbradford/front-end/git/commits{/sha}","comments_url":"https://api.github.com/repos/anselmbradford/front-end/comments{/number}","issue_comment_url":"https://api.github.com/repos/anselmbradford/front-end/issues/comments{/number}","contents_url":"https://api.github.com/repos/anselmbradford/front-end/contents/{+path}","compare_url":"https://api.github.com/repos/anselmbradford/front-end/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anselmbradford/front-end/merges","archive_url":"https://api.github.com/repos/anselmbradford/front-end/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anselmbradford/front-end/downloads","issues_url":"https://api.github.com/repos/anselmbradford/front-end/issues{/number}","pulls_url":"https://api.github.com/repos/anselmbradford/front-end/pulls{/number}","milestones_url":"https://api.github.com/repos/anselmbradford/front-end/milestones{/number}","notifications_url":"https://api.github.com/repos/anselmbradford/front-end/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anselmbradford/front-end/labels{/name}","releases_url":"https://api.github.com/repos/anselmbradford/front-end/releases{/id}","created_at":"2015-04-13T16:40:55Z","updated_at":"2015-03-16T15:46:12Z","pushed_at":"2015-05-26T15:18:03Z","git_url":"git://github.com/anselmbradford/front-end.git","ssh_url":"git@github.com:anselmbradford/front-end.git","clone_url":"https://github.com/anselmbradford/front-end.git","svn_url":"https://github.com/anselmbradford/front-end","homepage":"","size":485,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cfpb:master","ref":"master","sha":"7d294cdeaca712484db665d86dd1fdf767c1d48a","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":30654847,"name":"front-end","full_name":"cfpb/front-end","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/front-end","description":"A repository for the discussion and publication of the CFPB front-end team standards.","fork":false,"url":"https://api.github.com/repos/cfpb/front-end","forks_url":"https://api.github.com/repos/cfpb/front-end/forks","keys_url":"https://api.github.com/repos/cfpb/front-end/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/front-end/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/front-end/teams","hooks_url":"https://api.github.com/repos/cfpb/front-end/hooks","issue_events_url":"https://api.github.com/repos/cfpb/front-end/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/front-end/events","assignees_url":"https://api.github.com/repos/cfpb/front-end/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/front-end/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/front-end/tags","blobs_url":"https://api.github.com/repos/cfpb/front-end/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/front-end/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/front-end/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/front-end/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/front-end/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/front-end/languages","stargazers_url":"https://api.github.com/repos/cfpb/front-end/stargazers","contributors_url":"https://api.github.com/repos/cfpb/front-end/contributors","subscribers_url":"https://api.github.com/repos/cfpb/front-end/subscribers","subscription_url":"https://api.github.com/repos/cfpb/front-end/subscription","commits_url":"https://api.github.com/repos/cfpb/front-end/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/front-end/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/front-end/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/front-end/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/front-end/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/front-end/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/front-end/merges","archive_url":"https://api.github.com/repos/cfpb/front-end/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/front-end/downloads","issues_url":"https://api.github.com/repos/cfpb/front-end/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/front-end/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/front-end/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/front-end/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/front-end/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/front-end/releases{/id}","created_at":"2015-02-11T15:39:41Z","updated_at":"2015-04-28T13:56:27Z","pushed_at":"2015-05-18T14:34:33Z","git_url":"git://github.com/cfpb/front-end.git","ssh_url":"git@github.com:cfpb/front-end.git","clone_url":"https://github.com/cfpb/front-end.git","svn_url":"https://github.com/cfpb/front-end","homepage":"","size":991,"stargazers_count":10,"watchers_count":10,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":22,"forks":9,"open_issues":22,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfpb/front-end/pulls/51"},"html":{"href":"https://github.com/cfpb/front-end/pull/51"},"issue":{"href":"https://api.github.com/repos/cfpb/front-end/issues/51"},"comments":{"href":"https://api.github.com/repos/cfpb/front-end/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/cfpb/front-end/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/cfpb/front-end/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfpb/front-end/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/cfpb/front-end/statuses/7792644c2b81a2d9149cdbdb0b1400b69e224846"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}