{"action":"created","comment":{"url":"https://api.github.com/repos/nextcloud/android/pulls/comments/183253122","pull_request_review_id":114216358,"id":183253122,"diff_hunk":"@@ -0,0 +1,274 @@\n+package com.owncloud.android.services;\n+\n+import android.accounts.Account;\n+import android.app.Service;\n+import android.content.Intent;\n+import android.os.Bundle;\n+import android.os.Handler;\n+import android.os.IBinder;\n+import android.os.Message;\n+import android.os.RemoteException;\n+import android.util.Log;\n+import android.widget.Toast;\n+\n+import com.owncloud.android.authentication.AccountUtils;\n+import com.owncloud.android.lib.common.OwnCloudAccount;\n+import com.owncloud.android.lib.common.OwnCloudClient;\n+import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;\n+import com.owncloud.android.lib.common.utils.Log_OC;\n+import com.owncloud.android.ui.activity.FileDisplayActivity;\n+import com.owncloud.android.ui.asynctasks.AsyncTaskHelper;\n+\n+import org.apache.commons.httpclient.NameValuePair;\n+import org.apache.commons.httpclient.methods.DeleteMethod;\n+import org.apache.commons.httpclient.methods.GetMethod;\n+import org.apache.commons.httpclient.methods.PostMethod;\n+import org.apache.commons.httpclient.methods.PutMethod;\n+import org.apache.commons.httpclient.methods.StringRequestEntity;\n+import org.apache.commons.io.IOUtils;\n+\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.io.OutputStream;\n+import java.net.InetSocketAddress;\n+import java.net.Socket;\n+import java.net.SocketAddress;\n+import java.util.Map;\n+\n+import de.luhmer.owncloud.accountimporter.helper.InputStreamBinder;\n+import de.luhmer.owncloud.accountimporter.helper.NextcloudRequest;\n+\n+public class AccountManagerService extends Service {\n+\n+    private static final String TAG = AccountManagerService.class.getCanonicalName();\n+\n+    /** Command to the service to display a message */\n+    private static final int MSG_CREATE_NEW_ACCOUNT = 3;\n+\n+    private static final int MSG_REQUEST_NETWORK_REQUEST = 4;\n+    private static final int MSG_RESPONSE_NETWORK_REQUEST = 5;\n+\n+    @Override\n+    public IBinder onBind(Intent intent) {\n+        return (new InputStreamBinder(this));\n+    }\n+\n+    /**\n+     * Handler of incoming messages from clients.\n+     */\n+    class IncomingHandler extends Handler {\n+        @Override\n+        public void handleMessage(final Message msg) {","path":"src/main/java/com/owncloud/android/services/AccountManagerService.java","position":61,"original_position":61,"commit_id":"62c7a13367f3959820176744633b50fce195164e","original_commit_id":"62c7a13367f3959820176744633b50fce195164e","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: [The method handleMessage() has an NPath complexity of 201](https://app.codacy.com/app/Nextcloud/android/pullRequest?prid=729939)","created_at":"2018-04-22T21:57:11Z","updated_at":"2018-04-22T21:57:11Z","html_url":"https://github.com/nextcloud/android/pull/1116#discussion_r183253122","pull_request_url":"https://api.github.com/repos/nextcloud/android/pulls/1116","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/nextcloud/android/pulls/comments/183253122"},"html":{"href":"https://github.com/nextcloud/android/pull/1116#discussion_r183253122"},"pull_request":{"href":"https://api.github.com/repos/nextcloud/android/pulls/1116"}}},"pull_request":{"url":"https://api.github.com/repos/nextcloud/android/pulls/1116","id":127213005,"html_url":"https://github.com/nextcloud/android/pull/1116","diff_url":"https://github.com/nextcloud/android/pull/1116.diff","patch_url":"https://github.com/nextcloud/android/pull/1116.patch","issue_url":"https://api.github.com/repos/nextcloud/android/issues/1116","number":1116,"state":"open","locked":false,"title":"Proof of concept for Single Sign On","user":{"login":"tobiasKaminsky","id":5836855,"avatar_url":"https://avatars3.githubusercontent.com/u/5836855?v=4","gravatar_id":"","url":"https://api.github.com/users/tobiasKaminsky","html_url":"https://github.com/tobiasKaminsky","followers_url":"https://api.github.com/users/tobiasKaminsky/followers","following_url":"https://api.github.com/users/tobiasKaminsky/following{/other_user}","gists_url":"https://api.github.com/users/tobiasKaminsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasKaminsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasKaminsky/subscriptions","organizations_url":"https://api.github.com/users/tobiasKaminsky/orgs","repos_url":"https://api.github.com/users/tobiasKaminsky/repos","events_url":"https://api.github.com/users/tobiasKaminsky/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasKaminsky/received_events","type":"User","site_admin":false},"body":"by @David-Development \r\nRef: https://github.com/David-Development/ownCloud-Account-Importer/issues/3","created_at":"2017-06-23T13:57:32Z","updated_at":"2018-04-22T21:57:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"568a1eb7b0d4b528fab52c12913cb2b0eb82d752","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":392413733,"url":"https://api.github.com/repos/nextcloud/android/labels/1.%20developing","name":"1. developing","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nextcloud/android/pulls/1116/commits","review_comments_url":"https://api.github.com/repos/nextcloud/android/pulls/1116/comments","review_comment_url":"https://api.github.com/repos/nextcloud/android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nextcloud/android/issues/1116/comments","statuses_url":"https://api.github.com/repos/nextcloud/android/statuses/62c7a13367f3959820176744633b50fce195164e","head":{"label":"nextcloud:sso","ref":"sso","sha":"62c7a13367f3959820176744633b50fce195164e","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":60561834,"name":"android","full_name":"nextcloud/android","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/android","description":"📱 Nextcloud Android app","fork":false,"url":"https://api.github.com/repos/nextcloud/android","forks_url":"https://api.github.com/repos/nextcloud/android/forks","keys_url":"https://api.github.com/repos/nextcloud/android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/android/teams","hooks_url":"https://api.github.com/repos/nextcloud/android/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/android/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/android/events","assignees_url":"https://api.github.com/repos/nextcloud/android/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/android/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/android/tags","blobs_url":"https://api.github.com/repos/nextcloud/android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/android/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/android/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/android/languages","stargazers_url":"https://api.github.com/repos/nextcloud/android/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/android/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/android/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/android/subscription","commits_url":"https://api.github.com/repos/nextcloud/android/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/android/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/android/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/android/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/android/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/android/merges","archive_url":"https://api.github.com/repos/nextcloud/android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/android/downloads","issues_url":"https://api.github.com/repos/nextcloud/android/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/android/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/android/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/android/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/android/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/android/deployments","created_at":"2016-06-06T21:23:36Z","updated_at":"2018-04-22T18:38:33Z","pushed_at":"2018-04-22T21:53:40Z","git_url":"git://github.com/nextcloud/android.git","ssh_url":"git@github.com:nextcloud/android.git","clone_url":"https://github.com/nextcloud/android.git","svn_url":"https://github.com/nextcloud/android","homepage":"https://play.google.com/store/apps/details?id=com.nextcloud.client","size":96187,"stargazers_count":711,"watchers_count":711,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":400,"mirror_url":null,"archived":false,"open_issues_count":557,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":400,"open_issues":557,"watchers":711,"default_branch":"master"}},"base":{"label":"nextcloud:master","ref":"master","sha":"668be0ac0bcda4cf821e765b219de6f8dbcf482b","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":60561834,"name":"android","full_name":"nextcloud/android","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars1.githubusercontent.com/u/19211038?v=4","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/android","description":"📱 Nextcloud Android app","fork":false,"url":"https://api.github.com/repos/nextcloud/android","forks_url":"https://api.github.com/repos/nextcloud/android/forks","keys_url":"https://api.github.com/repos/nextcloud/android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/android/teams","hooks_url":"https://api.github.com/repos/nextcloud/android/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/android/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/android/events","assignees_url":"https://api.github.com/repos/nextcloud/android/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/android/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/android/tags","blobs_url":"https://api.github.com/repos/nextcloud/android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/android/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/android/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/android/languages","stargazers_url":"https://api.github.com/repos/nextcloud/android/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/android/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/android/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/android/subscription","commits_url":"https://api.github.com/repos/nextcloud/android/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/android/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/android/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/android/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/android/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/android/merges","archive_url":"https://api.github.com/repos/nextcloud/android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/android/downloads","issues_url":"https://api.github.com/repos/nextcloud/android/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/android/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/android/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/android/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/android/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/android/deployments","created_at":"2016-06-06T21:23:36Z","updated_at":"2018-04-22T18:38:33Z","pushed_at":"2018-04-22T21:53:40Z","git_url":"git://github.com/nextcloud/android.git","ssh_url":"git@github.com:nextcloud/android.git","clone_url":"https://github.com/nextcloud/android.git","svn_url":"https://github.com/nextcloud/android","homepage":"https://play.google.com/store/apps/details?id=com.nextcloud.client","size":96187,"stargazers_count":711,"watchers_count":711,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":400,"mirror_url":null,"archived":false,"open_issues_count":557,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":400,"open_issues":557,"watchers":711,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nextcloud/android/pulls/1116"},"html":{"href":"https://github.com/nextcloud/android/pull/1116"},"issue":{"href":"https://api.github.com/repos/nextcloud/android/issues/1116"},"comments":{"href":"https://api.github.com/repos/nextcloud/android/issues/1116/comments"},"review_comments":{"href":"https://api.github.com/repos/nextcloud/android/pulls/1116/comments"},"review_comment":{"href":"https://api.github.com/repos/nextcloud/android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nextcloud/android/pulls/1116/commits"},"statuses":{"href":"https://api.github.com/repos/nextcloud/android/statuses/62c7a13367f3959820176744633b50fce195164e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}