fucongcong/framework

View on GitHub

Showing 1,150 of 1,150 total issues

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

Avoid variables with short names like $e. Configured minimum length is 3.
Open

if ($e = error_get_last()) {

The property $task_res is not named in camelCase.
Open

class Server
{
protected $serv;
 
protected $servName;
Severity: Minor
Found in core/Group/Async/Server/Server.php by phpmd

Avoid variables with short names like $fd. Configured minimum length is 3.
Open

public function onReceive(swoole_server $serv, $fd, $fromId, $data)
Severity: Minor
Found in core/Group/Async/Server/Server.php by phpmd

The parameter $start_time is not named in camelCase.
Open

static public function parse($crontab_string, $timezone = "PRC", $start_time = null)
{
date_default_timezone_set($timezone);
 
if (!preg_match('/^((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)$/i', trim($crontab_string))) {
Severity: Minor
Found in core/Group/Cron/ParseCrontab.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

Avoid variables with short names like $e. Configured minimum length is 3.
Open

protected function renderForConsole($e)

Avoid variables with short names like $v1. Configured minimum length is 3.
Open

$v1 = explode(",", $s);
Severity: Minor
Found in core/Group/Cron/ParseCrontab.php by phpmd

Avoid variables with short names like $fd. Configured minimum length is 3.
Open

public function __construct($serv, $fd, $fromId, $data, $cmd, $table)

Avoid variables with short names like $v4. Configured minimum length is 3.
Open

$v4 = explode("-", $v3[0]);
Severity: Minor
Found in core/Group/Cron/ParseCrontab.php by phpmd

Avoid variables with short names like $fd. Configured minimum length is 3.
Open

private function getTaskCount($fd){
Severity: Minor
Found in core/Group/Async/Server/Server.php by phpmd

Avoid variables with short names like $e. Configured minimum length is 3.
Open

protected function record($e, $type = 'error')

Function ListSql has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

private function ListSql($sqlDir)
{
$files = [];
if (is_dir($sqlDir)) {
$dir = opendir($sqlDir);
Severity: Minor
Found in core/Group/Console/Command/SqlMigrateCommand.php - About 45 mins to fix

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

public function __construct($serv, $fd, $fromId, $data, $cmd, $table)
Severity: Minor
Found in core/Group/Async/Handler/WorkHandler.php - About 45 mins to fix

    Function getShort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    public static function getShort($str, $length = 40, $ext = '…') {
    $str = strip_tags($str);
    $str = htmlspecialchars($str);
    $strlenth = 0;
    $output = '';
    Severity: Minor
    Found in core/Group/Common/StringToolkit.php - About 45 mins to fix

    Function removeSubscriber has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    public function removeSubscriber(EventSubscriberInterface $subscriber)
    {
    foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
    if (is_array($params) && is_array($params[0])) {
    foreach ($params as $listener) {
    Severity: Minor
    Found in core/Group/EventDispatcher/EventDispatcherService.php - About 45 mins to fix

    Function addSubscriber has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    public function addSubscriber(EventSubscriberInterface $subscriber)
    {
    foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
    if (is_string($params)) {
    $this->addListener($eventName, array($subscriber, $params));
    Severity: Minor
    Found in core/Group/EventDispatcher/EventDispatcherService.php - About 45 mins to fix

    Function setTubes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    public function setTubes()
    {
    foreach ($this->jobs as $tube => $job) {
    $task_worker_num = 0;
    foreach ($job as $key => $value) {
    Severity: Minor
    Found in core/Group/Queue/TubeListener.php - About 45 mins to fix

    Function parse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    static public function parse($crontab_string, $timezone = "PRC", $start_time = null)
    {
    date_default_timezone_set($timezone);
     
    if (!preg_match('/^((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)\s+((\*(\/[0-9]+)?)|[0-9\-\,\/]+)$/i', trim($crontab_string))) {
    Severity: Minor
    Found in core/Group/Cron/ParseCrontab.php - About 45 mins to fix

    Consider simplifying this complex logical expression.
    Open

    if (
    in_array(intval(date('s', $start)), $date['second']) &&
    in_array(intval(date('i', $start)), $date['minutes']) &&
    in_array(intval(date('G', $start)), $date['hours']) &&
    in_array(intval(date('j', $start)), $date['day']) &&
    Severity: Major
    Found in core/Group/Cron/ParseCrontab.php - About 40 mins to fix
      Severity
      Category
      Status
      Source
      Language