The class CronAdmin has 11 public methods. Consider refactoring CronAdmin to keep number of public methods under 10.
class CronAdmin
{
protected $http;
protected $jobs;
Method __construct
has 57 lines of code (exceeds 25 allowed). Consider refactoring.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
The method __construct() has an NPath complexity of 2048. The configured NPath complexity threshold is 200.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
The method __construct() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
Avoid using undefined variables such as '$env' which will lead to PHP notices.
$twig = new \Twig_Environment($loader, isset($env) ? $env : array());
Avoid using undefined variables such as '$env' which will lead to PHP notices.
$twig = new \Twig_Environment($loader, isset($env) ? $env : array());
Remove error control operator '@' on line 166.
public function onShutdown($serv)
{
@unlink($this->pidPath);
echo "HTTP Server Shutdown...".PHP_EOL;
}
Missing class import via use statement (line '207', column '23').
$loader = new \Twig_Loader_Filesystem(dirname(__FILE__)."/View");
Missing class import via use statement (line '208', column '21').
$twig = new \Twig_Environment($loader, isset($env) ? $env : array());
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$works[] = ['job' => $job, 'pid' => $work_id[0]];
}
Avoid unused parameters such as '$post'.
public function stopMaster($post)
Avoid unused local variables such as '$file'.
$file = array_pop($parts);
Avoid unused parameters such as '$workerId'.
public function onWorkerStart($serv, $workerId)
Avoid unused parameters such as '$post'.
public function startMaster($post)
Avoid unused parameters such as '$serv'.
public function onShutdown($serv)
Avoid unused parameters such as '$post'.
public function reloadServer($post)
Avoid unused parameters such as '$serv'.
public function onWorkerStart($serv, $workerId)
Opening class brace must be on a line by itself
{
Expected 1 space before opening brace; found 0
$http->on('request', function ($request, $response){
Whitespace found at end of line
{
Whitespace found at end of line
{
Whitespace found at end of line
{
Whitespace found at end of line
'dispatch_mode' => 3,
Whitespace found at end of line
{
The variable $work_id is not named in camelCase.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
The variable $work_id is not named in camelCase.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
The variable $work_id is not named in camelCase.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
The variable $work_id is not named in camelCase.
public function __construct()
{
$this->mkDir(__FILEROOT__.'runtime/cron-server');
$http = new swoole_http_server('0.0.0.0', '10008');
$http->set(array(
There are no issues that match your filters.