fucongcong/framework

View on GitHub

Showing 1,150 of 1,150 total issues

Avoid using undefined variables such as '$e' which will lead to PHP notices.
Open

$this->renderHttpResponse($e);

Avoid using undefined variables such as '$error' which will lead to PHP notices.
Open

$error['message'] = $e;

Avoid using undefined variables such as '$e' which will lead to PHP notices.
Open

$this->renderForConsole($e);

Avoid using undefined variables such as '$error' which will lead to PHP notices.
Open

$e = $error;

Avoid using undefined variables such as '$config' which will lead to PHP notices.
Open

return app()->router->getTpl($config);

Avoid using undefined variables such as '$error' which will lead to PHP notices.
Open

$error['file'] = $trace[0]['file'];

Avoid using undefined variables such as '$error' which will lead to PHP notices.
Open

$error['line'] = $trace[0]['line'];

Avoid using undefined variables such as '$config' which will lead to PHP notices.
Open

$config['parameters'] = $params;

Avoid using undefined variables such as '$env' which will lead to PHP notices.
Open

$twig = new \Twig_Environment($loader, isset($env) ? $env : array());
Severity: Minor
Found in core/Group/Cron/CronAdmin.php by phpmd

Avoid using undefined variables such as '$parameters' which will lead to PHP notices.
Open

$parameters[] = $match;
Severity: Minor
Found in core/Group/Routing/Router.php by phpmd

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

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

    public function pregUrl($matches, $routeKey, $routing)
    {
    $requestUri = $this->route->getUri();
    if (substr($requestUri, -1) == "/") {
    $requestUri = substr($requestUri, 0, -1);
    Severity: Minor
    Found in core/Group/Routing/Router.php - About 1 hr to fix

      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

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

      private function setSignal()
      {
      //子进程结束时主进程收到的信号
      swoole_process::signal(SIGCHLD, function ($signo) {
       
       
      Severity: Minor
      Found in core/Group/Cron/Cron.php - About 55 mins to fix

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

      public function querySql($sql, $type, $name = null)
      {
      switch ($type) {
      case 'write':
      return $this->getWrite($name)->query($sql);
      Severity: Minor
      Found in core/Group/Dao/Dao.php - About 55 mins to fix

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

      public function singleton($name, $callable = null)
      {
      if (!isset($this->instances[$name]) && $callable) {
      $obj = call_user_func($callable);
      if (!is_object($obj)) {
      Severity: Minor
      Found in core/Group/App/App.php - About 55 mins to fix

      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

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

      private function getRoutingConfig()
      {
      $file = 'route/routing.php';
       
      if ($this->container->getEnvironment() == "prod") {
      Severity: Minor
      Found in core/Group/Routing/Router.php - About 55 mins to fix

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

      public function onFinish(swoole_server $serv, $fd, $data)
      {
      try {
      list($cmd, $one, $info) = \Group\Async\DataPack::unpack($data);
      $config = $this->config;
      Severity: Minor
      Found in core/Group/Async/Server/Server.php - About 55 mins to fix

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 3 and the first side effect is on line 4.
      Open

      <?php
      Severity: Minor
      Found in rpc_server.php by phpcodesniffer
      Severity
      Category
      Status
      Source
      Language