{"action":"created","comment":{"url":"https://api.github.com/repos/bst-mug/n2c2/pulls/comments/182511946","pull_request_review_id":113322331,"id":182511946,"diff_hunk":"@@ -45,13 +42,22 @@ public CrossValidator(List<Patient> patients, ClassifierFactory classifierFactor\n             List<Patient> test = dataset.getTestSet(i);\n             List<Patient> gold = dataset.getGoldSet(i);\n \n-            metrics.add(evaluateFold(train, test, gold));\n+            Metrics foldMetrics = evaluateFold(train, test, gold);\n+\n+            // First initialization\n+            if (metrics == null) {\n+                metrics = foldMetrics;\n+            } else {\n+                metrics.add(foldMetrics);\n+            }\n         }\n \n-        return metrics.stream().flatMap(e -> e.entrySet().stream()).collect(Collectors.groupingBy(Map.Entry::getKey, Collectors.averagingDouble(Map.Entry::getValue)));\n+        metrics.divideBy(k);\n+\n+        return metrics;\n     }\n \n-    private Map<Criterion, Double> evaluateFold(List<Patient> train, List<Patient> test, List<Patient> gold) {\n+    private Metrics evaluateFold(List<Patient> train, List<Patient> test, List<Patient> gold) {","path":"src/main/java/at/medunigraz/imi/bst/n2c2/validation/CrossValidator.java","position":55,"original_position":55,"commit_id":"df36c13b180296d79e729269224413860c82eaed","original_commit_id":"df36c13b180296d79e729269224413860c82eaed","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Avoid reassigning parameters such as 'test'](https://app.codacy.com/app/michelole/n2c2/pullRequest?prid=1556603)","created_at":"2018-04-18T17:42:52Z","updated_at":"2018-04-18T17:42:52Z","html_url":"https://github.com/bst-mug/n2c2/pull/50#discussion_r182511946","pull_request_url":"https://api.github.com/repos/bst-mug/n2c2/pulls/50","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/bst-mug/n2c2/pulls/comments/182511946"},"html":{"href":"https://github.com/bst-mug/n2c2/pull/50#discussion_r182511946"},"pull_request":{"href":"https://api.github.com/repos/bst-mug/n2c2/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/bst-mug/n2c2/pulls/50","id":182552662,"html_url":"https://github.com/bst-mug/n2c2/pull/50","diff_url":"https://github.com/bst-mug/n2c2/pull/50.diff","patch_url":"https://github.com/bst-mug/n2c2/pull/50.patch","issue_url":"https://api.github.com/repos/bst-mug/n2c2/issues/50","number":50,"state":"open","locked":false,"title":"Issue 48","user":{"login":"michelole","id":1688126,"avatar_url":"https://avatars2.githubusercontent.com/u/1688126?v=4","gravatar_id":"","url":"https://api.github.com/users/michelole","html_url":"https://github.com/michelole","followers_url":"https://api.github.com/users/michelole/followers","following_url":"https://api.github.com/users/michelole/following{/other_user}","gists_url":"https://api.github.com/users/michelole/gists{/gist_id}","starred_url":"https://api.github.com/users/michelole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michelole/subscriptions","organizations_url":"https://api.github.com/users/michelole/orgs","repos_url":"https://api.github.com/users/michelole/repos","events_url":"https://api.github.com/users/michelole/events{/privacy}","received_events_url":"https://api.github.com/users/michelole/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-18T17:39:55Z","updated_at":"2018-04-18T17:42:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8bf6fba5bbe8dbc880590c5bcabfb0f24c9e302","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bst-mug/n2c2/pulls/50/commits","review_comments_url":"https://api.github.com/repos/bst-mug/n2c2/pulls/50/comments","review_comment_url":"https://api.github.com/repos/bst-mug/n2c2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bst-mug/n2c2/issues/50/comments","statuses_url":"https://api.github.com/repos/bst-mug/n2c2/statuses/df36c13b180296d79e729269224413860c82eaed","head":{"label":"michelole:issue-48","ref":"issue-48","sha":"df36c13b180296d79e729269224413860c82eaed","user":{"login":"michelole","id":1688126,"avatar_url":"https://avatars2.githubusercontent.com/u/1688126?v=4","gravatar_id":"","url":"https://api.github.com/users/michelole","html_url":"https://github.com/michelole","followers_url":"https://api.github.com/users/michelole/followers","following_url":"https://api.github.com/users/michelole/following{/other_user}","gists_url":"https://api.github.com/users/michelole/gists{/gist_id}","starred_url":"https://api.github.com/users/michelole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michelole/subscriptions","organizations_url":"https://api.github.com/users/michelole/orgs","repos_url":"https://api.github.com/users/michelole/repos","events_url":"https://api.github.com/users/michelole/events{/privacy}","received_events_url":"https://api.github.com/users/michelole/received_events","type":"User","site_admin":false},"repo":{"id":125199257,"name":"n2c2","full_name":"michelole/n2c2","owner":{"login":"michelole","id":1688126,"avatar_url":"https://avatars2.githubusercontent.com/u/1688126?v=4","gravatar_id":"","url":"https://api.github.com/users/michelole","html_url":"https://github.com/michelole","followers_url":"https://api.github.com/users/michelole/followers","following_url":"https://api.github.com/users/michelole/following{/other_user}","gists_url":"https://api.github.com/users/michelole/gists{/gist_id}","starred_url":"https://api.github.com/users/michelole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michelole/subscriptions","organizations_url":"https://api.github.com/users/michelole/orgs","repos_url":"https://api.github.com/users/michelole/repos","events_url":"https://api.github.com/users/michelole/events{/privacy}","received_events_url":"https://api.github.com/users/michelole/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michelole/n2c2","description":"Supporting code for participation at the 2018 n2c2 Shared-Task","fork":true,"url":"https://api.github.com/repos/michelole/n2c2","forks_url":"https://api.github.com/repos/michelole/n2c2/forks","keys_url":"https://api.github.com/repos/michelole/n2c2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michelole/n2c2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michelole/n2c2/teams","hooks_url":"https://api.github.com/repos/michelole/n2c2/hooks","issue_events_url":"https://api.github.com/repos/michelole/n2c2/issues/events{/number}","events_url":"https://api.github.com/repos/michelole/n2c2/events","assignees_url":"https://api.github.com/repos/michelole/n2c2/assignees{/user}","branches_url":"https://api.github.com/repos/michelole/n2c2/branches{/branch}","tags_url":"https://api.github.com/repos/michelole/n2c2/tags","blobs_url":"https://api.github.com/repos/michelole/n2c2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michelole/n2c2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michelole/n2c2/git/refs{/sha}","trees_url":"https://api.github.com/repos/michelole/n2c2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michelole/n2c2/statuses/{sha}","languages_url":"https://api.github.com/repos/michelole/n2c2/languages","stargazers_url":"https://api.github.com/repos/michelole/n2c2/stargazers","contributors_url":"https://api.github.com/repos/michelole/n2c2/contributors","subscribers_url":"https://api.github.com/repos/michelole/n2c2/subscribers","subscription_url":"https://api.github.com/repos/michelole/n2c2/subscription","commits_url":"https://api.github.com/repos/michelole/n2c2/commits{/sha}","git_commits_url":"https://api.github.com/repos/michelole/n2c2/git/commits{/sha}","comments_url":"https://api.github.com/repos/michelole/n2c2/comments{/number}","issue_comment_url":"https://api.github.com/repos/michelole/n2c2/issues/comments{/number}","contents_url":"https://api.github.com/repos/michelole/n2c2/contents/{+path}","compare_url":"https://api.github.com/repos/michelole/n2c2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michelole/n2c2/merges","archive_url":"https://api.github.com/repos/michelole/n2c2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michelole/n2c2/downloads","issues_url":"https://api.github.com/repos/michelole/n2c2/issues{/number}","pulls_url":"https://api.github.com/repos/michelole/n2c2/pulls{/number}","milestones_url":"https://api.github.com/repos/michelole/n2c2/milestones{/number}","notifications_url":"https://api.github.com/repos/michelole/n2c2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michelole/n2c2/labels{/name}","releases_url":"https://api.github.com/repos/michelole/n2c2/releases{/id}","deployments_url":"https://api.github.com/repos/michelole/n2c2/deployments","created_at":"2018-03-14T11:00:23Z","updated_at":"2018-04-17T13:45:00Z","pushed_at":"2018-04-18T17:39:42Z","git_url":"git://github.com/michelole/n2c2.git","ssh_url":"git@github.com:michelole/n2c2.git","clone_url":"https://github.com/michelole/n2c2.git","svn_url":"https://github.com/michelole/n2c2","homepage":null,"size":6538,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bst-mug:master","ref":"master","sha":"449ef89ea1f7ca1f7af18906bf1dbcfacee7eadf","user":{"login":"bst-mug","id":27217493,"avatar_url":"https://avatars0.githubusercontent.com/u/27217493?v=4","gravatar_id":"","url":"https://api.github.com/users/bst-mug","html_url":"https://github.com/bst-mug","followers_url":"https://api.github.com/users/bst-mug/followers","following_url":"https://api.github.com/users/bst-mug/following{/other_user}","gists_url":"https://api.github.com/users/bst-mug/gists{/gist_id}","starred_url":"https://api.github.com/users/bst-mug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bst-mug/subscriptions","organizations_url":"https://api.github.com/users/bst-mug/orgs","repos_url":"https://api.github.com/users/bst-mug/repos","events_url":"https://api.github.com/users/bst-mug/events{/privacy}","received_events_url":"https://api.github.com/users/bst-mug/received_events","type":"Organization","site_admin":false},"repo":{"id":125067504,"name":"n2c2","full_name":"bst-mug/n2c2","owner":{"login":"bst-mug","id":27217493,"avatar_url":"https://avatars0.githubusercontent.com/u/27217493?v=4","gravatar_id":"","url":"https://api.github.com/users/bst-mug","html_url":"https://github.com/bst-mug","followers_url":"https://api.github.com/users/bst-mug/followers","following_url":"https://api.github.com/users/bst-mug/following{/other_user}","gists_url":"https://api.github.com/users/bst-mug/gists{/gist_id}","starred_url":"https://api.github.com/users/bst-mug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bst-mug/subscriptions","organizations_url":"https://api.github.com/users/bst-mug/orgs","repos_url":"https://api.github.com/users/bst-mug/repos","events_url":"https://api.github.com/users/bst-mug/events{/privacy}","received_events_url":"https://api.github.com/users/bst-mug/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bst-mug/n2c2","description":"Supporting code for participation at the 2018 n2c2 Shared-Task","fork":false,"url":"https://api.github.com/repos/bst-mug/n2c2","forks_url":"https://api.github.com/repos/bst-mug/n2c2/forks","keys_url":"https://api.github.com/repos/bst-mug/n2c2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bst-mug/n2c2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bst-mug/n2c2/teams","hooks_url":"https://api.github.com/repos/bst-mug/n2c2/hooks","issue_events_url":"https://api.github.com/repos/bst-mug/n2c2/issues/events{/number}","events_url":"https://api.github.com/repos/bst-mug/n2c2/events","assignees_url":"https://api.github.com/repos/bst-mug/n2c2/assignees{/user}","branches_url":"https://api.github.com/repos/bst-mug/n2c2/branches{/branch}","tags_url":"https://api.github.com/repos/bst-mug/n2c2/tags","blobs_url":"https://api.github.com/repos/bst-mug/n2c2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bst-mug/n2c2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bst-mug/n2c2/git/refs{/sha}","trees_url":"https://api.github.com/repos/bst-mug/n2c2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bst-mug/n2c2/statuses/{sha}","languages_url":"https://api.github.com/repos/bst-mug/n2c2/languages","stargazers_url":"https://api.github.com/repos/bst-mug/n2c2/stargazers","contributors_url":"https://api.github.com/repos/bst-mug/n2c2/contributors","subscribers_url":"https://api.github.com/repos/bst-mug/n2c2/subscribers","subscription_url":"https://api.github.com/repos/bst-mug/n2c2/subscription","commits_url":"https://api.github.com/repos/bst-mug/n2c2/commits{/sha}","git_commits_url":"https://api.github.com/repos/bst-mug/n2c2/git/commits{/sha}","comments_url":"https://api.github.com/repos/bst-mug/n2c2/comments{/number}","issue_comment_url":"https://api.github.com/repos/bst-mug/n2c2/issues/comments{/number}","contents_url":"https://api.github.com/repos/bst-mug/n2c2/contents/{+path}","compare_url":"https://api.github.com/repos/bst-mug/n2c2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bst-mug/n2c2/merges","archive_url":"https://api.github.com/repos/bst-mug/n2c2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bst-mug/n2c2/downloads","issues_url":"https://api.github.com/repos/bst-mug/n2c2/issues{/number}","pulls_url":"https://api.github.com/repos/bst-mug/n2c2/pulls{/number}","milestones_url":"https://api.github.com/repos/bst-mug/n2c2/milestones{/number}","notifications_url":"https://api.github.com/repos/bst-mug/n2c2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bst-mug/n2c2/labels{/name}","releases_url":"https://api.github.com/repos/bst-mug/n2c2/releases{/id}","deployments_url":"https://api.github.com/repos/bst-mug/n2c2/deployments","created_at":"2018-03-13T14:49:23Z","updated_at":"2018-04-17T16:02:58Z","pushed_at":"2018-04-18T17:39:57Z","git_url":"git://github.com/bst-mug/n2c2.git","ssh_url":"git@github.com:bst-mug/n2c2.git","clone_url":"https://github.com/bst-mug/n2c2.git","svn_url":"https://github.com/bst-mug/n2c2","homepage":null,"size":6553,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":2,"open_issues":20,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bst-mug/n2c2/pulls/50"},"html":{"href":"https://github.com/bst-mug/n2c2/pull/50"},"issue":{"href":"https://api.github.com/repos/bst-mug/n2c2/issues/50"},"comments":{"href":"https://api.github.com/repos/bst-mug/n2c2/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/bst-mug/n2c2/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/bst-mug/n2c2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bst-mug/n2c2/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/bst-mug/n2c2/statuses/df36c13b180296d79e729269224413860c82eaed"}},"author_association":"OWNER"}}
{"actor":{"display_login":"codacy-bot"}}