{"action":"created","comment":{"url":"https://api.github.com/repos/mreishman/Log-Hog/pulls/comments/132827491","pull_request_review_id":55952458,"id":132827491,"diff_hunk":"@@ -100,109 +98,121 @@\n \t{\n \t\t$logSizeLimit *= 1000;\n \t}\n-\n }\n \n-function tail($filename, $sliceSize, $shellOrPhp, $logTrimCheck, $logSizeLimit,$logTrimMacBSD,$logTrimType,$TrimSize,$buffer) \n+function tail($filename, $sliceSize, $shellOrPhp, $logTrimCheck, $logSizeLimit,$logTrimMacBSD,$logTrimType,$buffer)\n {\n \t$filename = preg_replace('/([()\"])/S', '$1', $filename);\n-\t//echo $filename, \"\\n\";\n-\tif(filesize($filename) == 0)\n+\t$data =  \"This file is empty. This should not be displayed.\";\n+\tif(filesize($filename) !== 0)\n \t{\n-\t\t$data =  \"This file is empty. This should not be displayed.\";\n+\t\tif($logTrimCheck == \"true\")\n+\t\t{\n+\t\t\tlogTrim($filename,$logSizeLimit,$logTrimMacBSD,$logTrimType,$buffer);\n+\t\t}\n+\n+\t\t$data = \"\";\n+\t\t$boolForReadable = is_readable($filename);\n+\t\tif($boolForReadable)\n+\t\t{\n+\t\t\tif($shellOrPhp == \"true\")\n+\t\t\t{\n+\t\t\t\t$data =  trim(tailCustom($filename, $sliceSize));\n+\t\t\t}\n+\t\t\telseif($shellOrPhp == \"false\")\n+\t\t\t{\n+\t\t\t\t$data = trim(shell_exec('tail -n ' . $sliceSize . ' \"' . $filename . '\"'));\n+\t\t\t}\n+\n+\t\t\tif($data == \"\" || is_null($data))\n+\t\t\t{\n+\t\t\t\tif($shellOrPhp == \"true\")\n+\t\t\t\t{\n+\t\t\t\t\t$data = trim(shell_exec('tail -n ' . $sliceSize . ' \"' . $filename . '\"'));\n+\t\t\t\t}\n+\t\t\t\telseif($shellOrPhp == \"false\")\n+\t\t\t\t{\n+\t\t\t\t\t$data = trim(tailCustom($filename, $sliceSize));\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tif($data == \"\" || is_null($data))\n+\t\t\t{\n+\t\t\t\t$data = \"Error - Maybe insufficient access to read file?\";\n+\t\t\t}\n+\t\t}\n+\t\telseif(!$boolForReadable)\n+\t\t{\n+\t\t\t$data = \"Error - File is not Readable\";\n+\t\t}\n \t}\n-\telse\n+\treturn $data;\n+}\n+\n+function logTrim($filename, $logSizeLimit,$logTrimMacBSD,$logTrimType,$buffer)","path":"core/php/poll.php","position":92,"original_position":92,"commit_id":"15818f413321d39032bd7f13b7a4ec1ef323af48","original_commit_id":"15818f413321d39032bd7f13b7a4ec1ef323af48","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://www.codacy.com/assets/images/favicon.png) Issue found: [The function logTrim() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.](https://www.codacy.com/app/matthew.reishman/Log-Hog/pullRequest?prid=837449)","created_at":"2017-08-12T21:44:21Z","updated_at":"2017-08-12T21:44:21Z","html_url":"https://github.com/mreishman/Log-Hog/pull/142#discussion_r132827491","pull_request_url":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/mreishman/Log-Hog/pulls/comments/132827491"},"html":{"href":"https://github.com/mreishman/Log-Hog/pull/142#discussion_r132827491"},"pull_request":{"href":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142","id":133724007,"html_url":"https://github.com/mreishman/Log-Hog/pull/142","diff_url":"https://github.com/mreishman/Log-Hog/pull/142.diff","patch_url":"https://github.com/mreishman/Log-Hog/pull/142.patch","issue_url":"https://api.github.com/repos/mreishman/Log-Hog/issues/142","number":142,"state":"open","locked":false,"title":"2.3.5","user":{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-02T14:31:34Z","updated_at":"2017-08-12T21:44:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f57aa426daa870e3ddb5d34c8233978a528b80a","assignee":{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false},"assignees":[{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142/commits","review_comments_url":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142/comments","review_comment_url":"https://api.github.com/repos/mreishman/Log-Hog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mreishman/Log-Hog/issues/142/comments","statuses_url":"https://api.github.com/repos/mreishman/Log-Hog/statuses/15818f413321d39032bd7f13b7a4ec1ef323af48","head":{"label":"mreishman:2.3.5","ref":"2.3.5","sha":"15818f413321d39032bd7f13b7a4ec1ef323af48","user":{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false},"repo":{"id":83624790,"name":"Log-Hog","full_name":"mreishman/Log-Hog","owner":{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mreishman/Log-Hog","description":"A simple log monitoring tool that is intended for use on dev boxes.","fork":true,"url":"https://api.github.com/repos/mreishman/Log-Hog","forks_url":"https://api.github.com/repos/mreishman/Log-Hog/forks","keys_url":"https://api.github.com/repos/mreishman/Log-Hog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mreishman/Log-Hog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mreishman/Log-Hog/teams","hooks_url":"https://api.github.com/repos/mreishman/Log-Hog/hooks","issue_events_url":"https://api.github.com/repos/mreishman/Log-Hog/issues/events{/number}","events_url":"https://api.github.com/repos/mreishman/Log-Hog/events","assignees_url":"https://api.github.com/repos/mreishman/Log-Hog/assignees{/user}","branches_url":"https://api.github.com/repos/mreishman/Log-Hog/branches{/branch}","tags_url":"https://api.github.com/repos/mreishman/Log-Hog/tags","blobs_url":"https://api.github.com/repos/mreishman/Log-Hog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mreishman/Log-Hog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mreishman/Log-Hog/git/refs{/sha}","trees_url":"https://api.github.com/repos/mreishman/Log-Hog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mreishman/Log-Hog/statuses/{sha}","languages_url":"https://api.github.com/repos/mreishman/Log-Hog/languages","stargazers_url":"https://api.github.com/repos/mreishman/Log-Hog/stargazers","contributors_url":"https://api.github.com/repos/mreishman/Log-Hog/contributors","subscribers_url":"https://api.github.com/repos/mreishman/Log-Hog/subscribers","subscription_url":"https://api.github.com/repos/mreishman/Log-Hog/subscription","commits_url":"https://api.github.com/repos/mreishman/Log-Hog/commits{/sha}","git_commits_url":"https://api.github.com/repos/mreishman/Log-Hog/git/commits{/sha}","comments_url":"https://api.github.com/repos/mreishman/Log-Hog/comments{/number}","issue_comment_url":"https://api.github.com/repos/mreishman/Log-Hog/issues/comments{/number}","contents_url":"https://api.github.com/repos/mreishman/Log-Hog/contents/{+path}","compare_url":"https://api.github.com/repos/mreishman/Log-Hog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mreishman/Log-Hog/merges","archive_url":"https://api.github.com/repos/mreishman/Log-Hog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mreishman/Log-Hog/downloads","issues_url":"https://api.github.com/repos/mreishman/Log-Hog/issues{/number}","pulls_url":"https://api.github.com/repos/mreishman/Log-Hog/pulls{/number}","milestones_url":"https://api.github.com/repos/mreishman/Log-Hog/milestones{/number}","notifications_url":"https://api.github.com/repos/mreishman/Log-Hog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mreishman/Log-Hog/labels{/name}","releases_url":"https://api.github.com/repos/mreishman/Log-Hog/releases{/id}","deployments_url":"https://api.github.com/repos/mreishman/Log-Hog/deployments","created_at":"2017-03-02T02:27:20Z","updated_at":"2017-06-28T14:50:08Z","pushed_at":"2017-08-12T21:42:22Z","git_url":"git://github.com/mreishman/Log-Hog.git","ssh_url":"git@github.com:mreishman/Log-Hog.git","clone_url":"https://github.com/mreishman/Log-Hog.git","svn_url":"https://github.com/mreishman/Log-Hog","homepage":null,"size":995,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":47,"forks":0,"open_issues":47,"watchers":1,"default_branch":"master"}},"base":{"label":"mreishman:master","ref":"master","sha":"ac8c7afb9a946907229837efb98a1f16eb8e1cc4","user":{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false},"repo":{"id":83624790,"name":"Log-Hog","full_name":"mreishman/Log-Hog","owner":{"login":"mreishman","id":3468153,"avatar_url":"https://avatars0.githubusercontent.com/u/3468153?v=4","gravatar_id":"","url":"https://api.github.com/users/mreishman","html_url":"https://github.com/mreishman","followers_url":"https://api.github.com/users/mreishman/followers","following_url":"https://api.github.com/users/mreishman/following{/other_user}","gists_url":"https://api.github.com/users/mreishman/gists{/gist_id}","starred_url":"https://api.github.com/users/mreishman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreishman/subscriptions","organizations_url":"https://api.github.com/users/mreishman/orgs","repos_url":"https://api.github.com/users/mreishman/repos","events_url":"https://api.github.com/users/mreishman/events{/privacy}","received_events_url":"https://api.github.com/users/mreishman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mreishman/Log-Hog","description":"A simple log monitoring tool that is intended for use on dev boxes.","fork":true,"url":"https://api.github.com/repos/mreishman/Log-Hog","forks_url":"https://api.github.com/repos/mreishman/Log-Hog/forks","keys_url":"https://api.github.com/repos/mreishman/Log-Hog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mreishman/Log-Hog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mreishman/Log-Hog/teams","hooks_url":"https://api.github.com/repos/mreishman/Log-Hog/hooks","issue_events_url":"https://api.github.com/repos/mreishman/Log-Hog/issues/events{/number}","events_url":"https://api.github.com/repos/mreishman/Log-Hog/events","assignees_url":"https://api.github.com/repos/mreishman/Log-Hog/assignees{/user}","branches_url":"https://api.github.com/repos/mreishman/Log-Hog/branches{/branch}","tags_url":"https://api.github.com/repos/mreishman/Log-Hog/tags","blobs_url":"https://api.github.com/repos/mreishman/Log-Hog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mreishman/Log-Hog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mreishman/Log-Hog/git/refs{/sha}","trees_url":"https://api.github.com/repos/mreishman/Log-Hog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mreishman/Log-Hog/statuses/{sha}","languages_url":"https://api.github.com/repos/mreishman/Log-Hog/languages","stargazers_url":"https://api.github.com/repos/mreishman/Log-Hog/stargazers","contributors_url":"https://api.github.com/repos/mreishman/Log-Hog/contributors","subscribers_url":"https://api.github.com/repos/mreishman/Log-Hog/subscribers","subscription_url":"https://api.github.com/repos/mreishman/Log-Hog/subscription","commits_url":"https://api.github.com/repos/mreishman/Log-Hog/commits{/sha}","git_commits_url":"https://api.github.com/repos/mreishman/Log-Hog/git/commits{/sha}","comments_url":"https://api.github.com/repos/mreishman/Log-Hog/comments{/number}","issue_comment_url":"https://api.github.com/repos/mreishman/Log-Hog/issues/comments{/number}","contents_url":"https://api.github.com/repos/mreishman/Log-Hog/contents/{+path}","compare_url":"https://api.github.com/repos/mreishman/Log-Hog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mreishman/Log-Hog/merges","archive_url":"https://api.github.com/repos/mreishman/Log-Hog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mreishman/Log-Hog/downloads","issues_url":"https://api.github.com/repos/mreishman/Log-Hog/issues{/number}","pulls_url":"https://api.github.com/repos/mreishman/Log-Hog/pulls{/number}","milestones_url":"https://api.github.com/repos/mreishman/Log-Hog/milestones{/number}","notifications_url":"https://api.github.com/repos/mreishman/Log-Hog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mreishman/Log-Hog/labels{/name}","releases_url":"https://api.github.com/repos/mreishman/Log-Hog/releases{/id}","deployments_url":"https://api.github.com/repos/mreishman/Log-Hog/deployments","created_at":"2017-03-02T02:27:20Z","updated_at":"2017-06-28T14:50:08Z","pushed_at":"2017-08-12T21:42:22Z","git_url":"git://github.com/mreishman/Log-Hog.git","ssh_url":"git@github.com:mreishman/Log-Hog.git","clone_url":"https://github.com/mreishman/Log-Hog.git","svn_url":"https://github.com/mreishman/Log-Hog","homepage":null,"size":995,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":47,"forks":0,"open_issues":47,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142"},"html":{"href":"https://github.com/mreishman/Log-Hog/pull/142"},"issue":{"href":"https://api.github.com/repos/mreishman/Log-Hog/issues/142"},"comments":{"href":"https://api.github.com/repos/mreishman/Log-Hog/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/mreishman/Log-Hog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mreishman/Log-Hog/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/mreishman/Log-Hog/statuses/15818f413321d39032bd7f13b7a4ec1ef323af48"}}}}
{"actor":{"display_login":"codacy-bot"}}