fucongcong/framework

View on GitHub
core/Group/Async/Client/Client.php

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 15 of 15 total issues

Function call has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

public function call($server, $cmd, $data, $getRecv = true)
{
$data = \Group\Async\DataPack::pack($cmd, $data);
 
static $client = null;
Severity: Minor
Found in core/Group/Async/Client/Client.php - About 1 hr to fix

Method call has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function call($server, $cmd, $data, $getRecv = true)
{
$data = \Group\Async\DataPack::pack($cmd, $data);
 
static $client = null;
Severity: Minor
Found in core/Group/Async/Client/Client.php - About 1 hr to fix

    The method call has a boolean flag argument $getRecv, which is a certain sign of a Single Responsibility Principle violation.
    Open

    public function call($server, $cmd, $data, $getRecv = true)
    Severity: Minor
    Found in core/Group/Async/Client/Client.php by phpmd

    Expected 0 spaces before opening brace; 1 found
    Open

    {

    Inline control structures are not allowed
    Open

    if (!isset($servers[$server])) throw new Exception("Not Found the {$server}", 1);

    Expected 1 space after closing parenthesis; found 0
    Open

    if ($getRecv){

    Expected 1 space after closing parenthesis; found 0
    Open

    if (stristr($content, $package_eof)){

    Expected 1 space after closing parenthesis; found 0
    Open

    if (is_null($client)){

    Expected 1 space after closing parenthesis; found 0
    Open

    if (!$client){

    Whitespace found at end of line
    Open

    {

    Whitespace found at end of line
    Open

    class Client

    The variable $package_eof is not named in camelCase.
    Open

    public function call($server, $cmd, $data, $getRecv = true)
    {
    $data = \Group\Async\DataPack::pack($cmd, $data);
     
    static $client = null;
    Severity: Minor
    Found in core/Group/Async/Client/Client.php by phpmd

    The variable $package_eof is not named in camelCase.
    Open

    public function call($server, $cmd, $data, $getRecv = true)
    {
    $data = \Group\Async\DataPack::pack($cmd, $data);
     
    static $client = null;
    Severity: Minor
    Found in core/Group/Async/Client/Client.php by phpmd

    The variable $package_eof is not named in camelCase.
    Open

    public function call($server, $cmd, $data, $getRecv = true)
    {
    $data = \Group\Async\DataPack::pack($cmd, $data);
     
    static $client = null;
    Severity: Minor
    Found in core/Group/Async/Client/Client.php by phpmd

    The variable $package_eof is not named in camelCase.
    Open

    public function call($server, $cmd, $data, $getRecv = true)
    {
    $data = \Group\Async\DataPack::pack($cmd, $data);
     
    static $client = null;
    Severity: Minor
    Found in core/Group/Async/Client/Client.php by phpmd
    Category
    Status