fucongcong/framework

View on GitHub

Showing 1,150 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

        The class ValidatorToolkit has 14 public methods. Consider refactoring ValidatorToolkit to keep number of public methods under 10.
        Open

        class ValidatorToolkit
        {
        public static function email($value)
        {
        $value = (string) $value;

        The class Controller has 12 public methods. Consider refactoring Controller to keep number of public methods under 10.
        Open

        class Controller implements ControllerContract
        {
        protected $app;
         
        public function __construct($app)
        Severity: Minor
        Found in core/Group/Controller/Controller.php by phpmd

        The class Cron has an overall complexity of 68 which is very high. The configured complexity threshold is 50.
        Open

        class Cron
        {
        protected $cacheDir;
         
        /**
        Severity: Minor
        Found in core/Group/Cron/Cron.php by phpmd

        The class App has 16 public methods. Consider refactoring App to keep number of public methods under 10.
        Open

        class App
        {
        /**
        * array instances
        *
        Severity: Minor
        Found in core/Group/App/App.php by phpmd

        The class CronAdmin has 11 public methods. Consider refactoring CronAdmin to keep number of public methods under 10.
        Open

        class CronAdmin
        {
        protected $http;
         
        protected $jobs;
        Severity: Minor
        Found in core/Group/Cron/CronAdmin.php by phpmd

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