Showing 3,246 of 4,217 total issues

Function _get_items_array has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_items_array($cat_name = '', $recursive_sort = true, $all = false)
    {
        if (empty($cat_name)) {
            $cat_name = $this->_default_cats_block;
        }
Severity: Minor
Found in plugins/categories/classes/yf_cats.class.php - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File yf_db_installer.class.php has 371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Database structure installer core.
 */
Severity: Minor
Found in plugins/db/classes/db/yf_db_installer.class.php - About 4 hrs to fix

    Method _render_get_data has 122 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _render_get_data(&$params)
        {
            $default_per_page = MAIN_TYPE_USER ? conf('user_per_page') : conf('admin_per_page');
            if ($params['rotate_table']) {
                $default_per_page = 10;
    Severity: Major
    Found in plugins/table2/classes/yf_table2.class.php - About 4 hrs to fix

      Method strip_tags_smart has 121 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function strip_tags_smart(
          /*string*/ $s,
          array $allowable_tags = null,
          /*boolean*/ $is_format_spaces = true,
          array $pair_tags = ['script', 'style', 'map', 'iframe', 'frameset', 'object', 'applet', 'comment', 'button'],
      Severity: Major
      Found in functions/yf_strip_tags_smart.php - About 4 hrs to fix

        Method compare_table has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function compare_table($t1, $t2, $db_prefix)
            {
                $prefix_len = strlen($db_prefix);
                $columns = [];
                $indexes = [];
        Severity: Major
        Found in plugins/db/classes/db/yf_db_migrator.class.php - About 4 hrs to fix

          Method translate_string has 119 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function translate_string($in, $args = 0, $lang = '')
              {
                  if ( ! $in) {
                      return $in;
                  }
          Severity: Major
          Found in plugins/locale/classes/yf_i18n.class.php - About 4 hrs to fix

            Method init_constants has 119 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function init_constants()
                {
                    $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                    // Save current working directory (to restore it later when execute shutdown functions)
                    $this->_CWD = getcwd();
            Severity: Major
            Found in classes/yf_main.class.php - About 4 hrs to fix

              Function _prepare_to_save has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _prepare_to_save($a)
                  {
                      $to_save = [];
                      foreach ((array) $a as $k => $v) {
                          if (is_string($v) && ! strlen($v)) {
              Severity: Minor
              Found in plugins/conf/admin_modules/yf_settings.class.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function join_url has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function join_url($parts, $encode = null)
                  {
                      if ($encode === null) {
                          $encode = $this->AUTO_ENCODE_DECODE;
                      }
              Severity: Minor
              Found in plugins/common/classes/common/yf_url_to_absolute.class.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function go has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function go($new_file_path, $k, $name_in_form = 'image', $max_image_size = 0, $is_local = false)
                  {
              
                      // We do not want to user break our operation
                      ignore_user_abort(true);
              Severity: Minor
              Found in plugins/common/classes/common/yf_multi_upload_image.class.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function go has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function go()
                  {
                      if ( ! $this->LOGGING || MAIN_TYPE_USER) {
                          return false;
                      }
              Severity: Minor
              Found in plugins/logs/classes/logs/yf_logs_exec_admin.class.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method _process_patterns has 118 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _process_patterns($name, array $replace, $string)
                  {
                      $_this = $this;
              
                      $start = '<' . '?p' . 'hp ';
              Severity: Major
              Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 4 hrs to fix

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

                    public function init()
                    {
                        // Chained config rule
                        if ($this->BLOCK_FAILED_LOGINS) {
                            $this->LOG_FAILED_LOGINS = true;
                Severity: Major
                Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 4 hrs to fix

                  Method show has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function show()
                      {
                          $object = &$this->object;
                          $action = &$this->action;
                          $filter_name = &$this->filter_name;
                  Severity: Major
                  Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 4 hrs to fix

                    Method error_handler has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function error_handler($error_type, $error_msg, $error_file, $error_line)
                        {
                            // quickly turn off notices logging
                            if ($this->NO_NOTICES && ($error_type == E_NOTICE || $error_type == E_USER_NOTICE)) {
                                return true;
                    Severity: Major
                    Found in plugins/sys/classes/yf_core_errors.class.php - About 4 hrs to fix

                      File yf_cats.class.php has 361 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       * Category display handler.
                       *
                      Severity: Minor
                      Found in plugins/categories/classes/yf_cats.class.php - About 4 hrs to fix

                        Method login has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function login($provider, $params = [])
                            {
                                if ( ! $provider) {
                                    return false;
                                }
                        Severity: Major
                        Found in plugins/oauth/classes/yf_oauth.class.php - About 4 hrs to fix

                          Method _upload_item__import_test has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function _upload_item__import_test($options)
                              {
                                  // load import data
                                  $_ = $options;
                                  $id = $_['id'];

                            File yf_manage_notifications.class.php has 359 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            class yf_manage_notifications
                            {
                                public $RECEIVER_TYPES = [
                            Severity: Minor
                            Found in plugins/notifications/admin_modules/yf_manage_notifications.class.php - About 4 hrs to fix

                              Method view has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function view()
                                  {
                                      // check operation
                                      $operation = $this->_operation();
                                      // import options
                              Severity: Major
                              Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language