Showing 3,246 of 4,217 total issues

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

    public function connect($db_host = '', $db_user = '', $db_pswd = null, $db_name = null, $force = false, $params = [])
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 45 mins to fix

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

        public function _init()
        {
            // Perform auto-connection to db if needed
            if (($this->AUTO_CONNECT || MAIN_TYPE == 'admin') && ! $this->NO_AUTO_CONNECT) {
                $this->connect();
    Severity: Minor
    Found in plugins/db/classes/yf_db.class.php - About 45 mins 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 get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get($name, $force_ttl = 0, array $params = [])
        {
            if ($name === false || $name === null || ! is_string($name)) {
                return null;
            }
    Severity: Minor
    Found in plugins/cache/classes/yf_cache.class.php - About 45 mins 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 crop_image has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function crop_image($source_file_path, $dest_file_path, $LIMIT_X, $LIMIT_Y, $pos_left, $pos_top)
    Severity: Minor
    Found in plugins/common/classes/yf_common.class.php - About 45 mins to fix

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

          public function _render_totals(&$params, &$a, &$to_hide)
          {
              $data = &$a['data'];
              $total_fields = $params['totals'];
      
      
      Severity: Minor
      Found in plugins/table2/classes/yf_table2.class.php - About 45 mins 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 set has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function set($name, $data, $ttl = 0)
          {
              if ($name === false || $name === null) {
                  return null;
              }
      Severity: Minor
      Found in plugins/cache/classes/yf_cache.class.php - About 45 mins 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 _curl_use_http_queue_item has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _curl_use_http_queue_item($id, $details)
          {
              $url = $details['url'];
              $url_options = $details['options'];
      
      
      Severity: Minor
      Found in plugins/common/classes/common/yf_remote_files.class.php - About 45 mins 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 get_user_info has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function get_user_info()
          {
              if (DEBUG_MODE && $_GET['oauth_clean']) {
                  $this->_storage_clean();
              }
      Severity: Minor
      Found in plugins/oauth/classes/oauth/yf_oauth_driver2.class.php - About 45 mins 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 make_thumb has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function make_thumb($source_file_path = '', $dest_file_path = '', $LIMIT_X = -1, $LIMIT_Y = -1, $watermark_path = '', $ext = '')
      Severity: Minor
      Found in plugins/common/classes/yf_common.class.php - About 45 mins to fix

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

            public function go($url, &$chars, $get_var_name = 'id', $q_var = 'id')
            {
                $nUrl = $url . '&' . $get_var_name . '=';
                $chars = strtolower(substr($chars . '11', 0, 2));
                $sel_style = ' style="background-color:#ccc;"';
        Severity: Minor
        Found in plugins/common/classes/common/yf_make_alphabet.class.php - About 45 mins 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 _utf8_strip_non_ascii has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _utf8_strip_non_ascii($str)
            {
                ob_start();
                while (preg_match('/^([\x00-\x7F]+)|([^\x00-\x7F]+)/S', $str, $matches)) {
                    if ( ! isset($matches[2])) {
        Severity: Minor
        Found in plugins/common/classes/common/yf_utf8_clean.class.php - About 45 mins 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 go has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function go($source_file_path = '', $dest_file_path = '', $LIMIT_X = -1, $LIMIT_Y = -1, $watermark_path = '', $ext = '')
        Severity: Minor
        Found in plugins/common/classes/common/yf_make_thumb.class.php - About 45 mins to fix

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

              public function _get_ip($check_type = 'force')
              {
                  $cache_name = '_CURRENT_' . $check_type . 'IP';
                  if (isset($this->CACHE[$cache_name])) {
                      return $this->CACHE[$cache_name];
          Severity: Minor
          Found in plugins/common/classes/common/yf_client_utils.class.php - About 45 mins 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 _netpbm_cut has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function _netpbm_cut($source_file_path, $dest_file_path, $LIMIT_Width, $LIMIT_Height, $pos_left, $pos_top)
          Severity: Minor
          Found in plugins/common/classes/common/yf_image_manip.class.php - About 45 mins to fix

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

                public function _use_gd($source_file_path = '', $dest_file_path = '', $LIMIT_X = -1, $LIMIT_Y = -1, $watermark_path = '', $output_type = '')
            Severity: Minor
            Found in plugins/common/classes/common/yf_make_thumb.class.php - About 45 mins to fix

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

                  public function get_spiders_ips_sql($field_name = 'ip')
                  {
                      if ( ! $field_name) {
                          $field_name = 'ip';
                      }
              Severity: Minor
              Found in plugins/common/classes/common/yf_spider_detection.class.php - About 45 mins 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 crop has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function crop($source_file_path, $dest_file_path, $LIMIT_X, $LIMIT_Y, $pos_left, $pos_top)
              Severity: Minor
              Found in plugins/common/classes/common/yf_image_manip.class.php - About 45 mins to fix

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

                    public function _gd_crop($source_path, $dest_file_path, $crop_width, $crop_height, $pos_left, $pos_top)
                Severity: Minor
                Found in plugins/common/classes/common/yf_image_manip.class.php - About 45 mins to fix

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

                      public function _imagick_crop($source_file_path, $dest_file_path, $LIMIT_width, $LIMIT_height, $pos_left, $pos_top)
                  Severity: Minor
                  Found in plugins/common/classes/common/yf_image_manip.class.php - About 45 mins to fix

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

                        public function _get_conf($key = null, array $options = [])
                        {
                            // lower
                            $k = strtolower($key);
                            if ( ! isset($this->config_default[$k])) {
                    Severity: Minor
                    Found in plugins/redis/classes/yf_wrapper_redis.class.php - About 45 mins 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

                    Severity
                    Category
                    Status
                    Source
                    Language