{"action":"created","comment":{"url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/comments/141860251","pull_request_review_id":66142153,"id":141860251,"diff_hunk":"@@ -0,0 +1,158 @@\n+var addSorting = (function () {\n+    \"use strict\";\n+    var cols,\n+        currentSort = {\n+            index: 0,\n+            desc: false\n+        };\n+\n+    // returns the summary table element\n+    function getTable() { return document.querySelector('.coverage-summary'); }\n+    // returns the thead element of the summary table\n+    function getTableHeader() { return getTable().querySelector('thead tr'); }\n+    // returns the tbody element of the summary table\n+    function getTableBody() { return getTable().querySelector('tbody'); }\n+    // returns the th element for nth column\n+    function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }\n+\n+    // loads all columns\n+    function loadColumns() {\n+        var colNodes = getTableHeader().querySelectorAll('th'),\n+            colNode,\n+            cols = [],\n+            col,\n+            i;\n+\n+        for (i = 0; i < colNodes.length; i += 1) {\n+            colNode = colNodes[i];\n+            col = {\n+                key: colNode.getAttribute('data-col'),\n+                sortable: !colNode.getAttribute('data-nosort'),\n+                type: colNode.getAttribute('data-type') || 'string'\n+            };\n+            cols.push(col);\n+            if (col.sortable) {\n+                col.defaultDescSort = col.type === 'number';\n+                colNode.innerHTML = colNode.innerHTML + '<span class=\"sorter\"></span>';\n+            }\n+        }\n+        return cols;\n+    }\n+    // attaches a data attribute to every tr element with an object\n+    // of data values keyed by column name\n+    function loadRowData(tableRow) {\n+        var tableCols = tableRow.querySelectorAll('td'),\n+            colNode,\n+            col,\n+            data = {},\n+            i,\n+            val;\n+        for (i = 0; i < tableCols.length; i += 1) {\n+            colNode = tableCols[i];\n+            col = cols[i];\n+            val = colNode.getAttribute('data-value');\n+            if (col.type === 'number') {\n+                val = Number(val);\n+            }\n+            data[col.key] = val;\n+        }\n+        return data;\n+    }\n+    // loads all row data\n+    function loadData() {\n+        var rows = getTableBody().querySelectorAll('tr'),\n+            i;\n+\n+        for (i = 0; i < rows.length; i += 1) {\n+            rows[i].data = loadRowData(rows[i]);\n+        }\n+    }\n+    // sorts the table using the data for the ith column\n+    function sortByIndex(index, desc) {\n+        var key = cols[index].key,\n+            sorter = function (a, b) {\n+                a = a.data[key];\n+                b = b.data[key];\n+                return a < b ? -1 : a > b ? 1 : 0;\n+            },\n+            finalSorter = sorter,\n+            tableBody = document.querySelector('.coverage-summary tbody'),\n+            rowNodes = tableBody.querySelectorAll('tr'),\n+            rows = [],\n+            i;\n+\n+        if (desc) {\n+            finalSorter = function (a, b) {\n+                return -1 * sorter(a, b);\n+            };\n+        }\n+\n+        for (i = 0; i < rowNodes.length; i += 1) {\n+            rows.push(rowNodes[i]);\n+            tableBody.removeChild(rowNodes[i]);\n+        }\n+\n+        rows.sort(finalSorter);\n+\n+        for (i = 0; i < rows.length; i += 1) {\n+            tableBody.appendChild(rows[i]);\n+        }\n+    }\n+    // removes sort indicators for current column being sorted\n+    function removeSortIndicators() {\n+        var col = getNthColumn(currentSort.index),\n+            cls = col.className;\n+\n+        cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');\n+        col.className = cls;\n+    }\n+    // adds sort indicators for current column being sorted\n+    function addSortIndicators() {\n+        getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';\n+    }\n+    // adds event listeners for all sorter widgets\n+    function enableUI() {\n+        var i,\n+            el,\n+            ithSorter = function ithSorter(i) {\n+                var col = cols[i];\n+\n+                return function () {\n+                    var desc = col.defaultDescSort;\n+\n+                    if (currentSort.index === i) {\n+                        desc = !currentSort.desc;\n+                    }\n+                    sortByIndex(i, desc);\n+                    removeSortIndicators();\n+                    currentSort.index = i;\n+                    currentSort.desc = desc;\n+                    addSortIndicators();\n+                };\n+            };\n+        for (i =0 ; i < cols.length; i += 1) {\n+            if (cols[i].sortable) {\n+                // add the click event handler on the th so users\n+                // dont have to click on those tiny arrows\n+                el = getNthColumn(i).querySelector('.sorter').parentElement;\n+                if (el.addEventListener) {\n+                    el.addEventListener('click', ithSorter(i));\n+                } else {\n+                    el.attachEvent('onclick', ithSorter(i));\n+                }\n+            }\n+        }\n+    }\n+    // adds sorting functionality to the UI\n+    return function () {\n+        if (!getTable()) {\n+            return;\n+        }\n+        cols = loadColumns();\n+        loadData(cols);\n+        addSortIndicators();\n+        enableUI();","path":"coverage/sorter.js","position":154,"original_position":154,"commit_id":"166b1e97591281846ec92e2996b84b5a748b9db3","original_commit_id":"166b1e97591281846ec92e2996b84b5a748b9db3","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected indentation of 6 spaces but found 8                   indent","created_at":"2017-09-29T12:52:40Z","updated_at":"2017-09-29T12:52:41Z","html_url":"https://github.com/zeze111/andela-bootcamp27/pull/4#discussion_r141860251","pull_request_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/comments/141860251"},"html":{"href":"https://github.com/zeze111/andela-bootcamp27/pull/4#discussion_r141860251"},"pull_request":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4","id":143521142,"html_url":"https://github.com/zeze111/andela-bootcamp27/pull/4","diff_url":"https://github.com/zeze111/andela-bootcamp27/pull/4.diff","patch_url":"https://github.com/zeze111/andela-bootcamp27/pull/4.patch","issue_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/4","number":4,"state":"open","locked":false,"title":"Server setup","user":{"login":"zeze111","id":31539842,"avatar_url":"https://avatars3.githubusercontent.com/u/31539842?v=4","gravatar_id":"","url":"https://api.github.com/users/zeze111","html_url":"https://github.com/zeze111","followers_url":"https://api.github.com/users/zeze111/followers","following_url":"https://api.github.com/users/zeze111/following{/other_user}","gists_url":"https://api.github.com/users/zeze111/gists{/gist_id}","starred_url":"https://api.github.com/users/zeze111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeze111/subscriptions","organizations_url":"https://api.github.com/users/zeze111/orgs","repos_url":"https://api.github.com/users/zeze111/repos","events_url":"https://api.github.com/users/zeze111/events{/privacy}","received_events_url":"https://api.github.com/users/zeze111/received_events","type":"User","site_admin":false},"body":"Would like feed back on the current structure of my code please","created_at":"2017-09-27T23:09:09Z","updated_at":"2017-09-29T12:52:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4/commits","review_comments_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4/comments","review_comment_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/4/comments","statuses_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/statuses/166b1e97591281846ec92e2996b84b5a748b9db3","head":{"label":"zeze111:server-setup","ref":"server-setup","sha":"166b1e97591281846ec92e2996b84b5a748b9db3","user":{"login":"zeze111","id":31539842,"avatar_url":"https://avatars3.githubusercontent.com/u/31539842?v=4","gravatar_id":"","url":"https://api.github.com/users/zeze111","html_url":"https://github.com/zeze111","followers_url":"https://api.github.com/users/zeze111/followers","following_url":"https://api.github.com/users/zeze111/following{/other_user}","gists_url":"https://api.github.com/users/zeze111/gists{/gist_id}","starred_url":"https://api.github.com/users/zeze111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeze111/subscriptions","organizations_url":"https://api.github.com/users/zeze111/orgs","repos_url":"https://api.github.com/users/zeze111/repos","events_url":"https://api.github.com/users/zeze111/events{/privacy}","received_events_url":"https://api.github.com/users/zeze111/received_events","type":"User","site_admin":false},"repo":{"id":104122586,"name":"andela-bootcamp27","full_name":"zeze111/andela-bootcamp27","owner":{"login":"zeze111","id":31539842,"avatar_url":"https://avatars3.githubusercontent.com/u/31539842?v=4","gravatar_id":"","url":"https://api.github.com/users/zeze111","html_url":"https://github.com/zeze111","followers_url":"https://api.github.com/users/zeze111/followers","following_url":"https://api.github.com/users/zeze111/following{/other_user}","gists_url":"https://api.github.com/users/zeze111/gists{/gist_id}","starred_url":"https://api.github.com/users/zeze111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeze111/subscriptions","organizations_url":"https://api.github.com/users/zeze111/orgs","repos_url":"https://api.github.com/users/zeze111/repos","events_url":"https://api.github.com/users/zeze111/events{/privacy}","received_events_url":"https://api.github.com/users/zeze111/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zeze111/andela-bootcamp27","description":"More_Recipes Project","fork":false,"url":"https://api.github.com/repos/zeze111/andela-bootcamp27","forks_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/forks","keys_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/teams","hooks_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/hooks","issue_events_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/events{/number}","events_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/events","assignees_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/assignees{/user}","branches_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/branches{/branch}","tags_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/tags","blobs_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/statuses/{sha}","languages_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/languages","stargazers_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/stargazers","contributors_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/contributors","subscribers_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/subscribers","subscription_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/subscription","commits_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/contents/{+path}","compare_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/merges","archive_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/downloads","issues_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues{/number}","pulls_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls{/number}","milestones_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/milestones{/number}","notifications_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/labels{/name}","releases_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/releases{/id}","deployments_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/deployments","created_at":"2017-09-19T20:03:10Z","updated_at":"2017-09-28T12:36:10Z","pushed_at":"2017-09-29T12:52:24Z","git_url":"git://github.com/zeze111/andela-bootcamp27.git","ssh_url":"git@github.com:zeze111/andela-bootcamp27.git","clone_url":"https://github.com/zeze111/andela-bootcamp27.git","svn_url":"https://github.com/zeze111/andela-bootcamp27","homepage":"","size":11035,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"zeze111:develop","ref":"develop","sha":"1d279dc8af71b25b0d3066433f8b1c14b0940393","user":{"login":"zeze111","id":31539842,"avatar_url":"https://avatars3.githubusercontent.com/u/31539842?v=4","gravatar_id":"","url":"https://api.github.com/users/zeze111","html_url":"https://github.com/zeze111","followers_url":"https://api.github.com/users/zeze111/followers","following_url":"https://api.github.com/users/zeze111/following{/other_user}","gists_url":"https://api.github.com/users/zeze111/gists{/gist_id}","starred_url":"https://api.github.com/users/zeze111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeze111/subscriptions","organizations_url":"https://api.github.com/users/zeze111/orgs","repos_url":"https://api.github.com/users/zeze111/repos","events_url":"https://api.github.com/users/zeze111/events{/privacy}","received_events_url":"https://api.github.com/users/zeze111/received_events","type":"User","site_admin":false},"repo":{"id":104122586,"name":"andela-bootcamp27","full_name":"zeze111/andela-bootcamp27","owner":{"login":"zeze111","id":31539842,"avatar_url":"https://avatars3.githubusercontent.com/u/31539842?v=4","gravatar_id":"","url":"https://api.github.com/users/zeze111","html_url":"https://github.com/zeze111","followers_url":"https://api.github.com/users/zeze111/followers","following_url":"https://api.github.com/users/zeze111/following{/other_user}","gists_url":"https://api.github.com/users/zeze111/gists{/gist_id}","starred_url":"https://api.github.com/users/zeze111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeze111/subscriptions","organizations_url":"https://api.github.com/users/zeze111/orgs","repos_url":"https://api.github.com/users/zeze111/repos","events_url":"https://api.github.com/users/zeze111/events{/privacy}","received_events_url":"https://api.github.com/users/zeze111/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zeze111/andela-bootcamp27","description":"More_Recipes Project","fork":false,"url":"https://api.github.com/repos/zeze111/andela-bootcamp27","forks_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/forks","keys_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/teams","hooks_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/hooks","issue_events_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/events{/number}","events_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/events","assignees_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/assignees{/user}","branches_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/branches{/branch}","tags_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/tags","blobs_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/statuses/{sha}","languages_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/languages","stargazers_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/stargazers","contributors_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/contributors","subscribers_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/subscribers","subscription_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/subscription","commits_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/contents/{+path}","compare_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/merges","archive_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/downloads","issues_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues{/number}","pulls_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls{/number}","milestones_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/milestones{/number}","notifications_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/labels{/name}","releases_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/releases{/id}","deployments_url":"https://api.github.com/repos/zeze111/andela-bootcamp27/deployments","created_at":"2017-09-19T20:03:10Z","updated_at":"2017-09-28T12:36:10Z","pushed_at":"2017-09-29T12:52:24Z","git_url":"git://github.com/zeze111/andela-bootcamp27.git","ssh_url":"git@github.com:zeze111/andela-bootcamp27.git","clone_url":"https://github.com/zeze111/andela-bootcamp27.git","svn_url":"https://github.com/zeze111/andela-bootcamp27","homepage":"","size":11035,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4"},"html":{"href":"https://github.com/zeze111/andela-bootcamp27/pull/4"},"issue":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/4"},"comments":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/zeze111/andela-bootcamp27/statuses/166b1e97591281846ec92e2996b84b5a748b9db3"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}