fucongcong/framework

View on GitHub

Showing 66 of 1,150 total issues

Method getMimeTypeByExtension has 769 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public static function getMimeTypeByExtension($extension)
{
$mimes = array(
'ez' => 'application/andrew-inset' ,
'aw' => 'application/applixware' ,
Severity: Major
Found in core/Group/Common/FileToolkit.php - About 3 days to fix

    File FileToolkit.php has 907 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
     
    namespace Group\Common;
     
    use Symfony\Component\HttpFoundation\File\File;
    Severity: Major
    Found in core/Group/Common/FileToolkit.php - About 2 days to fix

      Function truncateHtml has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

      public static function truncateHtml( $text, $length = 40, $ellipsis = '&hellip;' ) {
       
      if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
      return $text;
      }
      Severity: Minor
      Found in core/Group/Common/StringToolkit.php - About 5 hrs to fix

      File Cron.php has 315 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
       
      namespace Group\Cron;
       
      use Group\Cron\ParseCrontab;
      Severity: Minor
      Found in core/Group/Cron/Cron.php - About 3 hrs to fix

        Function stop has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        public function stop()
        {
        $pid = $this->getPid();
         
        if (!empty($pid) && $pid) {
        Severity: Minor
        Found in core/Group/Cron/Cron.php - About 2 hrs to fix

        Cron has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Cron
        {
        protected $cacheDir;
         
        /**
        Severity: Minor
        Found in core/Group/Cron/Cron.php - About 2 hrs to fix

          Method __construct has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          public function __construct()
          {
          $this->mkDir(__FILEROOT__.'runtime/cron-server');
          $http = new swoole_http_server('0.0.0.0', '10008');
          $http->set(array(
          Severity: Major
          Found in core/Group/Cron/CronAdmin.php - About 2 hrs to fix

            Function findWorkIds has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            private function findWorkIds($fileDir, $data = [])
            {
            if (is_dir($fileDir)) {
            $dir = opendir($fileDir);
            if (!$dir) {
            Severity: Minor
            Found in core/Group/Cron/Cron.php - About 2 hrs to fix

            Container has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Container implements ContainerContract
            {
            private static $instance;
             
            protected $timezone;
            Severity: Minor
            Found in core/Group/Container/Container.php - About 2 hrs to fix

              Function searchClass has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              private function searchClass($fileDir, $data=[])
              {
              if (is_dir(__ROOT__.$fileDir)) {
              $dir = opendir(__ROOT__.$fileDir);
               
               
              Severity: Minor
              Found in core/Group/Common/ClassMap.php - About 2 hrs to fix

              Function search has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              protected function search(&$queryBuilder, $andWhere, $condition)
              {
              foreach ($andWhere as $key => $value) {
              if (isset($condition[$key])) {
              if ($this->isInCondition($value)) {
              Severity: Minor
              Found in core/Group/Dao/Dao.php - About 2 hrs to fix

              Method truncateHtml has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              public static function truncateHtml( $text, $length = 40, $ellipsis = '&hellip;' ) {
               
              if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
              return $text;
              }
              Severity: Minor
              Found in core/Group/Common/StringToolkit.php - About 1 hr to fix

                Method init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                public function init()
                {
                $input = $this->getArgv();
                 
                if (!isset($input[0])) {
                Severity: Minor
                Found in core/Group/Console/Command/GenerateServiceCommand.php - About 1 hr to fix

                  Method init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  public function init()
                  {
                  $input = $this->getArgv();
                   
                  if (!isset($input[0])) {
                  Severity: Minor
                  Found in core/Group/Console/Command/GenerateControllerCommand.php - About 1 hr to fix

                    Method onKernalInit has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    public function onKernalInit(\Event $event)
                    {
                    $listeners = [
                    [
                    'eventName' => KernalEvent::REQUEST,
                    Severity: Minor
                    Found in core/Group/Listeners/KernalInitListener.php - About 1 hr to fix

                      Method parse has 36 lines of code (exceeds 25 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 1 hr to fix

                        Method html has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        public static function html($text, $tags = null) {
                        $text = trim($text);
                        //过滤换行符
                        $text = preg_replace('/\r?\n/', '', $text);
                        //完全过滤注释
                        Severity: Minor
                        Found in core/Group/Common/SecurityToolkit.php - About 1 hr to fix

                          Function filter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          public static function filter(array $array, array $specialValues)
                          {
                          $filtered = array();
                          foreach ($specialValues as $key => $value) {
                          if (!array_key_exists($key, $array)) {
                          Severity: Minor
                          Found in core/Group/Common/ArrayToolkit.php - About 1 hr to fix

                          Function ListSql has a Cognitive Complexity of 11 (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/SqlRollBackCommand.php - About 1 hr to fix

                          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
                          Severity
                          Category
                          Status
                          Source
                          Language