{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/Dexter/pulls/comments/69079462","id":69079462,"diff_hunk":"@@ -0,0 +1,105 @@\n+/**\n+ * Copyright (c) 2015 Samsung Electronics, Inc.,\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright notice, this\n+ *   list of conditions and the following disclaimer.\n+ *\n+ * * Redistributions in binary form must reproduce the above copyright notice,\n+ *   this list of conditions and the following disclaimer in the documentation\n+ *   and/or other materials provided with the distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\"use strict\";\n+\n+monitorApp.service('DefectService', function($http, $log, $q) {\n+    let minYear = 0;\n+    let maxYear = 0;\n+\n+    this.getMinYear = function() {\n+        if (minYear != 0) {\n+            return $q.resolve(minYear);\n+        }\n+\n+        return $http.get('/api/v2/defect/min-year')\n+            .then(function (res) {\n+                if (!isHttpResultOK(res)) {\n+                    $log.error('Failed to load min year');\n+                    return 2014;\n+                }\n+\n+                minYear = res.data.rows[0].year;\n+                return minYear;\n+            })\n+            .catch(function (err) {\n+                $log.error(err);\n+                return 2014;\n+            });\n+    };\n+\n+    this.getMaxYear = function() {\n+        if (maxYear != 0) {\n+            return $q.resolve(maxYear);\n+        }\n+\n+        return $http.get('/api/v2/defect/max-year')\n+            .then(function (res) {\n+                if (!isHttpResultOK(res)) {\n+                    $log.error('Failed to load max year');\n+                    return Date().getFullYear();\n+                }\n+\n+                maxYear = res.data.rows[0].year;","path":"project/dexter-monitor/public/service/defectService.js","position":65,"original_position":65,"commit_id":"5283c9d06d9666683e233c8041111ebcefb442d0","original_commit_id":"b85189da4df8fc9dc6ca7a66031fd9e8f1844c15","user":{"login":"Min-Ho-Kim","id":12783044,"avatar_url":"https://avatars.githubusercontent.com/u/12783044?v=3","gravatar_id":"","url":"https://api.github.com/users/Min-Ho-Kim","html_url":"https://github.com/Min-Ho-Kim","followers_url":"https://api.github.com/users/Min-Ho-Kim/followers","following_url":"https://api.github.com/users/Min-Ho-Kim/following{/other_user}","gists_url":"https://api.github.com/users/Min-Ho-Kim/gists{/gist_id}","starred_url":"https://api.github.com/users/Min-Ho-Kim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Min-Ho-Kim/subscriptions","organizations_url":"https://api.github.com/users/Min-Ho-Kim/orgs","repos_url":"https://api.github.com/users/Min-Ho-Kim/repos","events_url":"https://api.github.com/users/Min-Ho-Kim/events{/privacy}","received_events_url":"https://api.github.com/users/Min-Ho-Kim/received_events","type":"User","site_admin":false},"body":"The Rest API should return a value instead of an array.","created_at":"2016-06-30T06:44:10Z","updated_at":"2016-06-30T06:44:10Z","html_url":"https://github.com/Samsung/Dexter/pull/76#discussion_r69079462","pull_request_url":"https://api.github.com/repos/Samsung/Dexter/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/Samsung/Dexter/pulls/comments/69079462"},"html":{"href":"https://github.com/Samsung/Dexter/pull/76#discussion_r69079462"},"pull_request":{"href":"https://api.github.com/repos/Samsung/Dexter/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/Dexter/pulls/76","id":75604981,"html_url":"https://github.com/Samsung/Dexter/pull/76","diff_url":"https://github.com/Samsung/Dexter/pull/76.diff","patch_url":"https://github.com/Samsung/Dexter/pull/76.patch","issue_url":"https://api.github.com/repos/Samsung/Dexter/issues/76","number":76,"state":"open","locked":false,"title":"[monitor] Add monitoring weekly defects history","user":{"login":"marchpig","id":17305893,"avatar_url":"https://avatars.githubusercontent.com/u/17305893?v=3","gravatar_id":"","url":"https://api.github.com/users/marchpig","html_url":"https://github.com/marchpig","followers_url":"https://api.github.com/users/marchpig/followers","following_url":"https://api.github.com/users/marchpig/following{/other_user}","gists_url":"https://api.github.com/users/marchpig/gists{/gist_id}","starred_url":"https://api.github.com/users/marchpig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marchpig/subscriptions","organizations_url":"https://api.github.com/users/marchpig/orgs","repos_url":"https://api.github.com/users/marchpig/repos","events_url":"https://api.github.com/users/marchpig/events{/privacy}","received_events_url":"https://api.github.com/users/marchpig/received_events","type":"User","site_admin":false},"body":"The three kinds of defect history logics below are added.\r\n\r\n1) All : Weekly defects of all groups and projects\r\n2) Project : Weekly defects of a selected project\r\n3) Group : Weekly defects of all groups for a selected week","created_at":"2016-06-29T08:09:54Z","updated_at":"2016-06-30T06:44:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a13e2748a0401fc4ea5951c606bc7d0f312cd411","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/Dexter/pulls/76/commits","review_comments_url":"https://api.github.com/repos/Samsung/Dexter/pulls/76/comments","review_comment_url":"https://api.github.com/repos/Samsung/Dexter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/Dexter/issues/76/comments","statuses_url":"https://api.github.com/repos/Samsung/Dexter/statuses/5283c9d06d9666683e233c8041111ebcefb442d0","head":{"label":"marchpig:master","ref":"master","sha":"5283c9d06d9666683e233c8041111ebcefb442d0","user":{"login":"marchpig","id":17305893,"avatar_url":"https://avatars.githubusercontent.com/u/17305893?v=3","gravatar_id":"","url":"https://api.github.com/users/marchpig","html_url":"https://github.com/marchpig","followers_url":"https://api.github.com/users/marchpig/followers","following_url":"https://api.github.com/users/marchpig/following{/other_user}","gists_url":"https://api.github.com/users/marchpig/gists{/gist_id}","starred_url":"https://api.github.com/users/marchpig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marchpig/subscriptions","organizations_url":"https://api.github.com/users/marchpig/orgs","repos_url":"https://api.github.com/users/marchpig/repos","events_url":"https://api.github.com/users/marchpig/events{/privacy}","received_events_url":"https://api.github.com/users/marchpig/received_events","type":"User","site_admin":false},"repo":{"id":61952423,"name":"Dexter","full_name":"marchpig/Dexter","owner":{"login":"marchpig","id":17305893,"avatar_url":"https://avatars.githubusercontent.com/u/17305893?v=3","gravatar_id":"","url":"https://api.github.com/users/marchpig","html_url":"https://github.com/marchpig","followers_url":"https://api.github.com/users/marchpig/followers","following_url":"https://api.github.com/users/marchpig/following{/other_user}","gists_url":"https://api.github.com/users/marchpig/gists{/gist_id}","starred_url":"https://api.github.com/users/marchpig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marchpig/subscriptions","organizations_url":"https://api.github.com/users/marchpig/orgs","repos_url":"https://api.github.com/users/marchpig/repos","events_url":"https://api.github.com/users/marchpig/events{/privacy}","received_events_url":"https://api.github.com/users/marchpig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marchpig/Dexter","description":"Dexter is a static analysis platform to find and remove defects efficiently and immediately during the coding-time.","fork":true,"url":"https://api.github.com/repos/marchpig/Dexter","forks_url":"https://api.github.com/repos/marchpig/Dexter/forks","keys_url":"https://api.github.com/repos/marchpig/Dexter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marchpig/Dexter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marchpig/Dexter/teams","hooks_url":"https://api.github.com/repos/marchpig/Dexter/hooks","issue_events_url":"https://api.github.com/repos/marchpig/Dexter/issues/events{/number}","events_url":"https://api.github.com/repos/marchpig/Dexter/events","assignees_url":"https://api.github.com/repos/marchpig/Dexter/assignees{/user}","branches_url":"https://api.github.com/repos/marchpig/Dexter/branches{/branch}","tags_url":"https://api.github.com/repos/marchpig/Dexter/tags","blobs_url":"https://api.github.com/repos/marchpig/Dexter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marchpig/Dexter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marchpig/Dexter/git/refs{/sha}","trees_url":"https://api.github.com/repos/marchpig/Dexter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marchpig/Dexter/statuses/{sha}","languages_url":"https://api.github.com/repos/marchpig/Dexter/languages","stargazers_url":"https://api.github.com/repos/marchpig/Dexter/stargazers","contributors_url":"https://api.github.com/repos/marchpig/Dexter/contributors","subscribers_url":"https://api.github.com/repos/marchpig/Dexter/subscribers","subscription_url":"https://api.github.com/repos/marchpig/Dexter/subscription","commits_url":"https://api.github.com/repos/marchpig/Dexter/commits{/sha}","git_commits_url":"https://api.github.com/repos/marchpig/Dexter/git/commits{/sha}","comments_url":"https://api.github.com/repos/marchpig/Dexter/comments{/number}","issue_comment_url":"https://api.github.com/repos/marchpig/Dexter/issues/comments{/number}","contents_url":"https://api.github.com/repos/marchpig/Dexter/contents/{+path}","compare_url":"https://api.github.com/repos/marchpig/Dexter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marchpig/Dexter/merges","archive_url":"https://api.github.com/repos/marchpig/Dexter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marchpig/Dexter/downloads","issues_url":"https://api.github.com/repos/marchpig/Dexter/issues{/number}","pulls_url":"https://api.github.com/repos/marchpig/Dexter/pulls{/number}","milestones_url":"https://api.github.com/repos/marchpig/Dexter/milestones{/number}","notifications_url":"https://api.github.com/repos/marchpig/Dexter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marchpig/Dexter/labels{/name}","releases_url":"https://api.github.com/repos/marchpig/Dexter/releases{/id}","deployments_url":"https://api.github.com/repos/marchpig/Dexter/deployments","created_at":"2016-06-25T16:43:16Z","updated_at":"2016-06-25T16:43:26Z","pushed_at":"2016-06-30T06:26:46Z","git_url":"git://github.com/marchpig/Dexter.git","ssh_url":"git@github.com:marchpig/Dexter.git","clone_url":"https://github.com/marchpig/Dexter.git","svn_url":"https://github.com/marchpig/Dexter","homepage":null,"size":224906,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"Samsung:master","ref":"master","sha":"15258c2acfd723b61fe156ca702c84a189ce2c27","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":39492217,"name":"Dexter","full_name":"Samsung/Dexter","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/Dexter","description":"Dexter is a static analysis platform to find and remove defects efficiently and immediately during the coding-time.","fork":false,"url":"https://api.github.com/repos/Samsung/Dexter","forks_url":"https://api.github.com/repos/Samsung/Dexter/forks","keys_url":"https://api.github.com/repos/Samsung/Dexter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/Dexter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/Dexter/teams","hooks_url":"https://api.github.com/repos/Samsung/Dexter/hooks","issue_events_url":"https://api.github.com/repos/Samsung/Dexter/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/Dexter/events","assignees_url":"https://api.github.com/repos/Samsung/Dexter/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/Dexter/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/Dexter/tags","blobs_url":"https://api.github.com/repos/Samsung/Dexter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/Dexter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/Dexter/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/Dexter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/Dexter/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/Dexter/languages","stargazers_url":"https://api.github.com/repos/Samsung/Dexter/stargazers","contributors_url":"https://api.github.com/repos/Samsung/Dexter/contributors","subscribers_url":"https://api.github.com/repos/Samsung/Dexter/subscribers","subscription_url":"https://api.github.com/repos/Samsung/Dexter/subscription","commits_url":"https://api.github.com/repos/Samsung/Dexter/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/Dexter/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/Dexter/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/Dexter/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/Dexter/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/Dexter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/Dexter/merges","archive_url":"https://api.github.com/repos/Samsung/Dexter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/Dexter/downloads","issues_url":"https://api.github.com/repos/Samsung/Dexter/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/Dexter/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/Dexter/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/Dexter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/Dexter/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/Dexter/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/Dexter/deployments","created_at":"2015-07-22T07:31:51Z","updated_at":"2016-06-23T09:57:54Z","pushed_at":"2016-06-30T06:26:46Z","git_url":"git://github.com/Samsung/Dexter.git","ssh_url":"git@github.com:Samsung/Dexter.git","clone_url":"https://github.com/Samsung/Dexter.git","svn_url":"https://github.com/Samsung/Dexter","homepage":null,"size":371521,"stargazers_count":23,"watchers_count":23,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":13,"forks":14,"open_issues":13,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/Dexter/pulls/76"},"html":{"href":"https://github.com/Samsung/Dexter/pull/76"},"issue":{"href":"https://api.github.com/repos/Samsung/Dexter/issues/76"},"comments":{"href":"https://api.github.com/repos/Samsung/Dexter/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/Dexter/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/Dexter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/Dexter/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/Dexter/statuses/5283c9d06d9666683e233c8041111ebcefb442d0"}}}}
{"actor":{"display_login":"Min-Ho-Kim"}}