{"action":"opened","issue":{"url":"https://api.github.com/repos/sunnyRK/Notes/issues/5","repository_url":"https://api.github.com/repos/sunnyRK/Notes","labels_url":"https://api.github.com/repos/sunnyRK/Notes/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/sunnyRK/Notes/issues/5/comments","events_url":"https://api.github.com/repos/sunnyRK/Notes/issues/5/events","html_url":"https://github.com/sunnyRK/Notes/issues/5","id":335256111,"node_id":"MDU6SXNzdWUzMzUyNTYxMTE=","number":5,"title":"Do you see the code duplicate here? ","user":{"login":"manish-mobiuso","id":2831932,"node_id":"MDQ6VXNlcjI4MzE5MzI=","avatar_url":"https://avatars0.githubusercontent.com/u/2831932?v=4","gravatar_id":"","url":"https://api.github.com/users/manish-mobiuso","html_url":"https://github.com/manish-mobiuso","followers_url":"https://api.github.com/users/manish-mobiuso/followers","following_url":"https://api.github.com/users/manish-mobiuso/following{/other_user}","gists_url":"https://api.github.com/users/manish-mobiuso/gists{/gist_id}","starred_url":"https://api.github.com/users/manish-mobiuso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manish-mobiuso/subscriptions","organizations_url":"https://api.github.com/users/manish-mobiuso/orgs","repos_url":"https://api.github.com/users/manish-mobiuso/repos","events_url":"https://api.github.com/users/manish-mobiuso/events{/privacy}","received_events_url":"https://api.github.com/users/manish-mobiuso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-25T04:30:02Z","updated_at":"2018-06-25T04:30:02Z","closed_at":null,"author_association":"COLLABORATOR","body":"https://github.com/sunnyRK/Notes/blob/43c1d51f3aaae3384b463b733dca9dd24d5bbb62/app/src/main/java/com/testing/hd/notes/CreateNoteFragment.kt#L66\r\n\r\nIdentify yourself what code should be moved to a separate function and make a refactoring. The rule here to apply is extract what is changing. What I observed is you have both the edit and add functionality doing the same thing, except you are calculating what is the key against which you want to save the note. You could take out calculating the key into a function of its own, and rest of the code remains. Think over.\r\n\r\nRead here -\r\nhttps://sourcemaking.com/refactoring/replace-parameter-with-method-call"}}
{"actor":{"display_login":"manish-mobiuso"}}