fucongcong/framework

View on GitHub
core/Group/RpcKernal.php

Summary

Maintainability
A
55 mins
Test Coverage

Showing 20 of 20 total issues

Function checkStatus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

public function checkStatus()
{
$args = getopt('s:');
if(isset($args['s'])) {
 
 
Severity: Minor
Found in core/Group/RpcKernal.php - About 55 mins to fix

Missing class import via use statement (line '56', column '20').
Open

$app = new \Group\App\App();
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

Missing class import via use statement (line '63', column '25').
Open

$classMap = new Group\Common\ClassMap();
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

Missing class import via use statement (line '32', column '23').
Open

$server = new HproseSwooleServer($server);
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

The method checkStatus() contains an exit expression.
Open

exit;
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

Avoid unused local variables such as '$file'.
Open

$file = array_pop($parts);
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class RpcKernal
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

The property $server_type is not named in camelCase.
Open

class RpcKernal
{
protected $server_type;
 
protected $server;
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

The parameter $server_type is not named in camelCase.
Open

public function __construct($server_type)
{
$this->server_type = $server_type;
$this->config = require(__ROOT__."config/rpc.php");
$this->cacheDir = $this->config['cache_dir'];
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

Blank line found at start of control structure
Open

if(isset($args['s'])) {
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

Line indented incorrectly; expected at least 12 spaces, found 11
Open

$server->add(new $class[0],'',$class[1]);
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

Whitespace found at end of line
Open

{
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

No space found after comma in function call
Open

$server->add(new $class[0],'',$class[1]);
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

Whitespace found at end of line
Open

{
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

No space found after comma in function call
Open

$server->add(new $class[0],'',$class[1]);
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

Expected 1 space after IF keyword; 0 found
Open

if(isset($args['s'])) {
Severity: Minor
Found in core/Group/RpcKernal.php by phpcodesniffer

The variable $server_type is not named in camelCase.
Open

public function init()
{
$this->checkStatus();
 
$pid = posix_getpid();
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

The variable $server_type is not named in camelCase.
Open

public function init()
{
$this->checkStatus();
 
$pid = posix_getpid();
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

The variable $server_type is not named in camelCase.
Open

public function init()
{
$this->checkStatus();
 
$pid = posix_getpid();
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

The variable $server_type is not named in camelCase.
Open

public function __construct($server_type)
{
$this->server_type = $server_type;
$this->config = require(__ROOT__."config/rpc.php");
$this->cacheDir = $this->config['cache_dir'];
Severity: Minor
Found in core/Group/RpcKernal.php by phpmd

There are no issues that match your filters.

Category
Status