{"action":"created","comment":{"url":"https://api.github.com/repos/bhuwang/java_training/pulls/comments/37603723","id":37603723,"diff_hunk":"@@ -0,0 +1,146 @@\n+package com.lftechnology.java.training.srijan.basics.football;\n+\n+import java.util.logging.Logger;\n+\n+\n+public class PointsStructure {\n+\tprivate static final int WIN;\n+\tprivate static final int LOSE;\n+\tprivate static final int DRAW;\n+\tprivate int points;\n+\tprivate int counts;\n+\tprivate int wins;\n+\tprivate int draws;\n+\tprivate int lose;\n+\n+\tstatic {\n+\t\tWIN = 3;\n+\t\tLOSE = 0;\n+\t\tDRAW = 1;\n+\t}\n+\n+\tpublic PointsStructure(String club) {\n+\t\tthis.points = 0;\n+\t\tthis.counts = 1;\n+\t\tthis.wins = 0;\n+\t\tthis.draws = 0;\n+\t\tthis.lose = 0;\n+\t}\n+\n+\tprivate static final Logger LOGGER = Logger.getLogger(PointsStructure.class.getName());\n+\n+\t/**\n+\t * <p>\n+\t * This method helps to get Points from an Array\n+\t * </p>\n+\t * \n+\t * @param numberOfMatches\n+\t *            {@link Integer}\n+\t * @param fixturesWithScore\n+\t *            {@link String}\n+\t * @author Srijan Bajracharya <srijanbajracharya@lftechnology.com>\n+\t */\n+\tpublic void getPoints(int numberOfMatches, String[] fixturesWithScore) {\n+\t\tString result = \"\";\n+\t\tint stringHomePosition = 0;\n+\t\tint stringAwayPosition = 2;\n+\t\tfor (int i = 0; i < numberOfMatches; i++) {\n+\t\t\tif (fixturesWithScore[stringHomePosition].equals(\"Manchester United\")) {\n+\t\t\t\tresult = determineResult(fixturesWithScore, stringHomePosition);\n+\t\t\t}\n+\n+\t\t\telse if (fixturesWithScore[stringAwayPosition].equals(\"Manchester United\")) {\n+\t\t\t\tresult = resultDetermine(fixturesWithScore, stringAwayPosition);\n+\t\t\t}\n+\t\t\tstringHomePosition = stringHomePosition + 4;\n+\t\t\tstringAwayPosition = stringAwayPosition + 4;\n+\t\t\tdisplayPoints(result, numberOfMatches);\n+\n+\t\t}\n+\t}\n+\n+\t/**\n+\t * <p>\n+\t * Determines WIN, LOSE, or DRAW for Home Game\n+\t * </p>\n+\t * \n+\t * @param fixturesWithScore\n+\t *            {@link String}\n+\t * @param stringPosition\n+\t *            {@link Integer}\n+\t * @return WIN, LOSE or DRAW {@link String}\n+\t */\n+\tpublic String determineResult(String[] fixturesWithScore, int stringPosition) {\n+\t\tif (Integer.parseInt(fixturesWithScore[stringPosition + 1]) > Integer\n+\t\t\t\t.parseInt(fixturesWithScore[stringPosition + 3])) {\n+\t\t\treturn \"WIN\";\n+\t\t} else if (Integer.parseInt(fixturesWithScore[stringPosition + 1]) < Integer\n+\t\t\t\t.parseInt(fixturesWithScore[stringPosition + 3])) {\n+\t\t\treturn \"LOSE\";\n+\t\t} else\n+\t\t\treturn \"DRAW\";\n+\t}\n+\n+\t/**\n+\t * <p>\n+\t * Determines WIN, LOSE or DRAW for Away Game\n+\t * </p>\n+\t * \n+\t * @param fixturesWithScore\n+\t *            {@link String}\n+\t * @param stringPosition\n+\t *            {@link Integer}\n+\t * @return WIN, LOSE, or DRAW {@link String}\n+\t * @author Srijan Bajracharya <srijanbajracharya@lftechnology.com>\n+\t */\n+\tpublic String resultDetermine(String[] fixturesWithScore, int stringPosition) {\n+\t\tif (Integer.parseInt(fixturesWithScore[stringPosition + 1]) > Integer\n+\t\t\t\t.parseInt(fixturesWithScore[stringPosition - 1])) {\n+\t\t\treturn \"WIN\";\n+\t\t} else if (Integer.parseInt(fixturesWithScore[stringPosition + 1]) < Integer\n+\t\t\t\t.parseInt(fixturesWithScore[stringPosition - 1])) {\n+\t\t\treturn \"LOSE\";\n+\t\t} else\n+\t\t\treturn \"DRAW\";\n+\t}\n+\n+\t/**\n+\t * <p>\n+\t * Displays points\n+\t * </p>\n+\t * <p>\n+\t * Displays Number of Wins\n+\t * </p>\n+\t * <p>\n+\t * Displays Number of Draws\n+\t * </p>\n+\t * <p>\n+\t * Displays Number of Lose\n+\t * </p>\n+\t * \n+\t * @param result\n+\t *            {@link String}\n+\t * @param numberOfWeeks\n+\t *            {@link Integer}\n+\t * @author Srijan Bajracharya <srijanbajracharya@lftechnology.com>\n+\t */\n+\tpublic void displayPoints(String result, int numberOfWeeks) {\n+\t\tif (result.equals(\"WIN\")) {","path":"src/com/lftechnology/java/training/srijan/basics/football/PointsStructure.java","position":128,"original_position":128,"commit_id":"9f19852e5365bd9a065c015f0f291ad230047b6b","original_commit_id":"9f19852e5365bd9a065c015f0f291ad230047b6b","user":{"login":"bhuwang","id":3335673,"avatar_url":"https://avatars.githubusercontent.com/u/3335673?v=3","gravatar_id":"","url":"https://api.github.com/users/bhuwang","html_url":"https://github.com/bhuwang","followers_url":"https://api.github.com/users/bhuwang/followers","following_url":"https://api.github.com/users/bhuwang/following{/other_user}","gists_url":"https://api.github.com/users/bhuwang/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuwang/subscriptions","organizations_url":"https://api.github.com/users/bhuwang/orgs","repos_url":"https://api.github.com/users/bhuwang/repos","events_url":"https://api.github.com/users/bhuwang/events{/privacy}","received_events_url":"https://api.github.com/users/bhuwang/received_events","type":"User","site_admin":false},"body":"![MAJOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-major.png) Move the \"WIN\" string literal on the left side of this string comparison. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://nemo.sonarqube.org/coding_rules#rule_key=squid%3AS1132)\n","created_at":"2015-08-21T03:22:11Z","updated_at":"2015-08-21T03:22:11Z","html_url":"https://github.com/bhuwang/java_training/pull/70#discussion_r37603723","pull_request_url":"https://api.github.com/repos/bhuwang/java_training/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/bhuwang/java_training/pulls/comments/37603723"},"html":{"href":"https://github.com/bhuwang/java_training/pull/70#discussion_r37603723"},"pull_request":{"href":"https://api.github.com/repos/bhuwang/java_training/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/bhuwang/java_training/pulls/70","id":42921591,"html_url":"https://github.com/bhuwang/java_training/pull/70","diff_url":"https://github.com/bhuwang/java_training/pull/70.diff","patch_url":"https://github.com/bhuwang/java_training/pull/70.patch","issue_url":"https://api.github.com/repos/bhuwang/java_training/issues/70","number":70,"state":"open","locked":false,"title":"21 srijan Manchester United complete application","user":{"login":"SrijanBajracharya","id":13027817,"avatar_url":"https://avatars.githubusercontent.com/u/13027817?v=3","gravatar_id":"","url":"https://api.github.com/users/SrijanBajracharya","html_url":"https://github.com/SrijanBajracharya","followers_url":"https://api.github.com/users/SrijanBajracharya/followers","following_url":"https://api.github.com/users/SrijanBajracharya/following{/other_user}","gists_url":"https://api.github.com/users/SrijanBajracharya/gists{/gist_id}","starred_url":"https://api.github.com/users/SrijanBajracharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SrijanBajracharya/subscriptions","organizations_url":"https://api.github.com/users/SrijanBajracharya/orgs","repos_url":"https://api.github.com/users/SrijanBajracharya/repos","events_url":"https://api.github.com/users/SrijanBajracharya/events{/privacy}","received_events_url":"https://api.github.com/users/SrijanBajracharya/received_events","type":"User","site_admin":false},"body":"Features:\r\n1) inputs number of gameweeks\r\n2) inputs club name of which you want to see stats\r\n3) inputs gameweeks fixtures\r\n4) inputs scores according to game week\r\n5) displays points, number of wins, lose, draws","created_at":"2015-08-20T12:04:54Z","updated_at":"2015-08-21T03:22:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b424a1d0a8cb0f1dd71203ee7cab66944c2fd0bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bhuwang/java_training/pulls/70/commits","review_comments_url":"https://api.github.com/repos/bhuwang/java_training/pulls/70/comments","review_comment_url":"https://api.github.com/repos/bhuwang/java_training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bhuwang/java_training/issues/70/comments","statuses_url":"https://api.github.com/repos/bhuwang/java_training/statuses/9f19852e5365bd9a065c015f0f291ad230047b6b","head":{"label":"bhuwang:21_srijan","ref":"21_srijan","sha":"9f19852e5365bd9a065c015f0f291ad230047b6b","user":{"login":"bhuwang","id":3335673,"avatar_url":"https://avatars.githubusercontent.com/u/3335673?v=3","gravatar_id":"","url":"https://api.github.com/users/bhuwang","html_url":"https://github.com/bhuwang","followers_url":"https://api.github.com/users/bhuwang/followers","following_url":"https://api.github.com/users/bhuwang/following{/other_user}","gists_url":"https://api.github.com/users/bhuwang/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuwang/subscriptions","organizations_url":"https://api.github.com/users/bhuwang/orgs","repos_url":"https://api.github.com/users/bhuwang/repos","events_url":"https://api.github.com/users/bhuwang/events{/privacy}","received_events_url":"https://api.github.com/users/bhuwang/received_events","type":"User","site_admin":false},"repo":{"id":40284843,"name":"java_training","full_name":"bhuwang/java_training","owner":{"login":"bhuwang","id":3335673,"avatar_url":"https://avatars.githubusercontent.com/u/3335673?v=3","gravatar_id":"","url":"https://api.github.com/users/bhuwang","html_url":"https://github.com/bhuwang","followers_url":"https://api.github.com/users/bhuwang/followers","following_url":"https://api.github.com/users/bhuwang/following{/other_user}","gists_url":"https://api.github.com/users/bhuwang/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuwang/subscriptions","organizations_url":"https://api.github.com/users/bhuwang/orgs","repos_url":"https://api.github.com/users/bhuwang/repos","events_url":"https://api.github.com/users/bhuwang/events{/privacy}","received_events_url":"https://api.github.com/users/bhuwang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhuwang/java_training","description":"","fork":false,"url":"https://api.github.com/repos/bhuwang/java_training","forks_url":"https://api.github.com/repos/bhuwang/java_training/forks","keys_url":"https://api.github.com/repos/bhuwang/java_training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhuwang/java_training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhuwang/java_training/teams","hooks_url":"https://api.github.com/repos/bhuwang/java_training/hooks","issue_events_url":"https://api.github.com/repos/bhuwang/java_training/issues/events{/number}","events_url":"https://api.github.com/repos/bhuwang/java_training/events","assignees_url":"https://api.github.com/repos/bhuwang/java_training/assignees{/user}","branches_url":"https://api.github.com/repos/bhuwang/java_training/branches{/branch}","tags_url":"https://api.github.com/repos/bhuwang/java_training/tags","blobs_url":"https://api.github.com/repos/bhuwang/java_training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhuwang/java_training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhuwang/java_training/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhuwang/java_training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhuwang/java_training/statuses/{sha}","languages_url":"https://api.github.com/repos/bhuwang/java_training/languages","stargazers_url":"https://api.github.com/repos/bhuwang/java_training/stargazers","contributors_url":"https://api.github.com/repos/bhuwang/java_training/contributors","subscribers_url":"https://api.github.com/repos/bhuwang/java_training/subscribers","subscription_url":"https://api.github.com/repos/bhuwang/java_training/subscription","commits_url":"https://api.github.com/repos/bhuwang/java_training/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhuwang/java_training/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhuwang/java_training/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhuwang/java_training/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhuwang/java_training/contents/{+path}","compare_url":"https://api.github.com/repos/bhuwang/java_training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhuwang/java_training/merges","archive_url":"https://api.github.com/repos/bhuwang/java_training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhuwang/java_training/downloads","issues_url":"https://api.github.com/repos/bhuwang/java_training/issues{/number}","pulls_url":"https://api.github.com/repos/bhuwang/java_training/pulls{/number}","milestones_url":"https://api.github.com/repos/bhuwang/java_training/milestones{/number}","notifications_url":"https://api.github.com/repos/bhuwang/java_training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhuwang/java_training/labels{/name}","releases_url":"https://api.github.com/repos/bhuwang/java_training/releases{/id}","created_at":"2015-08-06T04:45:13Z","updated_at":"2015-08-17T15:30:41Z","pushed_at":"2015-08-21T03:19:13Z","git_url":"git://github.com/bhuwang/java_training.git","ssh_url":"git@github.com:bhuwang/java_training.git","clone_url":"https://github.com/bhuwang/java_training.git","svn_url":"https://github.com/bhuwang/java_training","homepage":null,"size":1945,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":28,"forks":3,"open_issues":28,"watchers":0,"default_branch":"dev"}},"base":{"label":"bhuwang:dev","ref":"dev","sha":"b07e18a52ca787ac71a44006fde1202114cc1946","user":{"login":"bhuwang","id":3335673,"avatar_url":"https://avatars.githubusercontent.com/u/3335673?v=3","gravatar_id":"","url":"https://api.github.com/users/bhuwang","html_url":"https://github.com/bhuwang","followers_url":"https://api.github.com/users/bhuwang/followers","following_url":"https://api.github.com/users/bhuwang/following{/other_user}","gists_url":"https://api.github.com/users/bhuwang/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuwang/subscriptions","organizations_url":"https://api.github.com/users/bhuwang/orgs","repos_url":"https://api.github.com/users/bhuwang/repos","events_url":"https://api.github.com/users/bhuwang/events{/privacy}","received_events_url":"https://api.github.com/users/bhuwang/received_events","type":"User","site_admin":false},"repo":{"id":40284843,"name":"java_training","full_name":"bhuwang/java_training","owner":{"login":"bhuwang","id":3335673,"avatar_url":"https://avatars.githubusercontent.com/u/3335673?v=3","gravatar_id":"","url":"https://api.github.com/users/bhuwang","html_url":"https://github.com/bhuwang","followers_url":"https://api.github.com/users/bhuwang/followers","following_url":"https://api.github.com/users/bhuwang/following{/other_user}","gists_url":"https://api.github.com/users/bhuwang/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuwang/subscriptions","organizations_url":"https://api.github.com/users/bhuwang/orgs","repos_url":"https://api.github.com/users/bhuwang/repos","events_url":"https://api.github.com/users/bhuwang/events{/privacy}","received_events_url":"https://api.github.com/users/bhuwang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhuwang/java_training","description":"","fork":false,"url":"https://api.github.com/repos/bhuwang/java_training","forks_url":"https://api.github.com/repos/bhuwang/java_training/forks","keys_url":"https://api.github.com/repos/bhuwang/java_training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhuwang/java_training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhuwang/java_training/teams","hooks_url":"https://api.github.com/repos/bhuwang/java_training/hooks","issue_events_url":"https://api.github.com/repos/bhuwang/java_training/issues/events{/number}","events_url":"https://api.github.com/repos/bhuwang/java_training/events","assignees_url":"https://api.github.com/repos/bhuwang/java_training/assignees{/user}","branches_url":"https://api.github.com/repos/bhuwang/java_training/branches{/branch}","tags_url":"https://api.github.com/repos/bhuwang/java_training/tags","blobs_url":"https://api.github.com/repos/bhuwang/java_training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhuwang/java_training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhuwang/java_training/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhuwang/java_training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhuwang/java_training/statuses/{sha}","languages_url":"https://api.github.com/repos/bhuwang/java_training/languages","stargazers_url":"https://api.github.com/repos/bhuwang/java_training/stargazers","contributors_url":"https://api.github.com/repos/bhuwang/java_training/contributors","subscribers_url":"https://api.github.com/repos/bhuwang/java_training/subscribers","subscription_url":"https://api.github.com/repos/bhuwang/java_training/subscription","commits_url":"https://api.github.com/repos/bhuwang/java_training/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhuwang/java_training/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhuwang/java_training/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhuwang/java_training/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhuwang/java_training/contents/{+path}","compare_url":"https://api.github.com/repos/bhuwang/java_training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhuwang/java_training/merges","archive_url":"https://api.github.com/repos/bhuwang/java_training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhuwang/java_training/downloads","issues_url":"https://api.github.com/repos/bhuwang/java_training/issues{/number}","pulls_url":"https://api.github.com/repos/bhuwang/java_training/pulls{/number}","milestones_url":"https://api.github.com/repos/bhuwang/java_training/milestones{/number}","notifications_url":"https://api.github.com/repos/bhuwang/java_training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhuwang/java_training/labels{/name}","releases_url":"https://api.github.com/repos/bhuwang/java_training/releases{/id}","created_at":"2015-08-06T04:45:13Z","updated_at":"2015-08-17T15:30:41Z","pushed_at":"2015-08-21T03:19:13Z","git_url":"git://github.com/bhuwang/java_training.git","ssh_url":"git@github.com:bhuwang/java_training.git","clone_url":"https://github.com/bhuwang/java_training.git","svn_url":"https://github.com/bhuwang/java_training","homepage":null,"size":1945,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":28,"forks":3,"open_issues":28,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/bhuwang/java_training/pulls/70"},"html":{"href":"https://github.com/bhuwang/java_training/pull/70"},"issue":{"href":"https://api.github.com/repos/bhuwang/java_training/issues/70"},"comments":{"href":"https://api.github.com/repos/bhuwang/java_training/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/bhuwang/java_training/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/bhuwang/java_training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bhuwang/java_training/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/bhuwang/java_training/statuses/9f19852e5365bd9a065c015f0f291ad230047b6b"}}}}