Showing 4,217 of 4,217 total issues

Function init has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function init()
    {
        // Chanined config rule
        if ($this->BLOCK_FAILED_LOGINS) {
            $this->LOG_FAILED_LOGINS = true;
Severity: Minor
Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 5 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 _init has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        $this->supported_conds = [
            'in' => function ($a) {
                return ' IN( ' . _es($a['value']) . ' )';
Severity: Minor
Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 5 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 get_remote_page has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_remote_page($url = '', $cache_ttl = -1, $url_options = [], &$requests_info = [])
    {
        if (empty($url)) {
            return false;
        }
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 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 scan_dir has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function scan_dir($server_info = [], $start_dir = '', $pattern_include = '', $pattern_exclude = '', $level = 0, $single_file = '')
    {
        if (is_array($start_dir)) {
            $_merged_contents = [];
            foreach ((array) $start_dir as $_start_dir) {
Severity: Minor
Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 5 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 sample_core_api.class.php has 399 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

class sample_core_api
{
    public function _init()
Severity: Minor
Found in .dev/samples/classes/sample_core_api.class.php - About 5 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            foreach ((array) $raw_in_php as $path => $matches) {
                $lines = file($path);
                foreach ((array) $matches as $raw) {
                    preg_match($regex_php, $raw, $m);
                    $name = trim(trim(trim($m['name']), '"\''));
    Severity: Major
    Found in plugins/assets/admin_modules/yf_manage_assets.class.php and 1 other location - About 5 hrs to fix
    plugins/assets/admin_modules/yf_manage_assets.class.php on lines 93..107

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function _get_dashboard_data($id = '')
        {
            if ( ! $id) {
                $id = isset($params['name']) ? $params['name'] : ($this->_name ? $this->_name : $_GET['id']);
            }
    Severity: Major
    Found in plugins/common/classes/common/yf_dashboards.class.php and 1 other location - About 5 hrs to fix
    plugins/dashboards/classes/yf_dashboards2.class.php on lines 218..235

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            foreach ((array) $raw_in_tpl as $path => $matches) {
                $lines = file($path);
                foreach ((array) $matches as $raw) {
                    preg_match($regex_tpl, $raw, $m);
                    $name = trim(trim(trim($m['name']), '"\''));
    Severity: Major
    Found in plugins/assets/admin_modules/yf_manage_assets.class.php and 1 other location - About 5 hrs to fix
    plugins/assets/admin_modules/yf_manage_assets.class.php on lines 76..90

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function _get_dashboard_data($id = '')
        {
            if ( ! $id) {
                $id = isset($params['name']) ? $params['name'] : ($this->_name ? $this->_name : $_GET['id']);
            }
    Severity: Major
    Found in plugins/dashboards/classes/yf_dashboards2.class.php and 1 other location - About 5 hrs to fix
    plugins/common/classes/common/yf_dashboards.class.php on lines 218..235

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 195.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    <?php
    
    /**
     * Comments handler.
     *
    Severity: Minor
    Found in plugins/comments/modules/yf_comments.class.php - About 5 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function _product_revisions()
          {
              $product_id = (int) ($_GET['id']);
              $product_info = module('manage_shop')->_product_get_info($product_id);
              if ( ! $product_info) {
      plugins/shop/admin_modules/manage_shop/yf_manage_shop_hook_side_column.class.php on lines 45..73

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if ($is_multiple) {
                  $center_tmp = [];
                  foreach ($part_left as $v) {
                      $v = trim($v);
                      if (strlen($v)) {
      Severity: Major
      Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php and 1 other location - About 5 hrs to fix
      plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php on lines 748..763

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public function _debug_get_data(&$params = [])
          {
              if ( ! $this->SHOW_MAIN_GET_DATA) {
                  return '';
              }
      Severity: Major
      Found in classes/yf_debug.class.php and 2 other locations - About 5 hrs to fix
      classes/yf_debug.class.php on lines 1093..1109
      classes/yf_debug.class.php on lines 1112..1126

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public function _debug_cache_get(&$params = [])
          {
              if ( ! $this->SHOW_CORE_CACHE) {
                  return '';
              }
      Severity: Major
      Found in classes/yf_debug.class.php and 2 other locations - About 5 hrs to fix
      classes/yf_debug.class.php on lines 1076..1090
      classes/yf_debug.class.php on lines 1112..1126

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public function _debug_cache_set(&$params = [])
          {
              if ( ! $this->SHOW_CORE_CACHE) {
                  return '';
              }
      Severity: Major
      Found in classes/yf_debug.class.php and 2 other locations - About 5 hrs to fix
      classes/yf_debug.class.php on lines 1076..1090
      classes/yf_debug.class.php on lines 1093..1109

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                  if ($is_multiple) {
                      $center_tmp = [];
                      foreach ($part_left as $v) {
                          $v = trim($v);
                          if (strlen($v)) {
      Severity: Major
      Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php and 1 other location - About 5 hrs to fix
      plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php on lines 395..410

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function _product_images_revisions()
          {
              $product_id = (int) ($_GET['id']);
              $product_info = module('manage_shop')->_product_get_info($product_id);
              if ( ! $product_info) {
      plugins/shop/admin_modules/manage_shop/yf_manage_shop_hook_side_column.class.php on lines 23..42

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 194.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Method _go has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _go($location, $rewrite = true, $redirect_type = 'hybrid', $text = '', $ttl = 3, $params = [])
          {
              if (is_array($location)) {
                  $params += $location;
                  $rewrite = isset($params['rewrite']) ? $params['rewrite'] : $rewrite;
      Severity: Major
      Found in classes/yf_redirect.class.php - About 5 hrs to fix

        File shop_orders.sql_php.php has 396 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        return [
            'fields' => [
                'id' => [
        Severity: Minor
        Found in plugins/shop/share/db/sql_php/shop_orders.sql_php.php - About 5 hrs to fix

          yf_locale_editor has 41 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_locale_editor
          {
              /** @var array @conf_skip */
              private static $HELP = [
                  'edit' => [
          Severity: Minor
          Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 5 hrs to fix
            Severity
            Category
            Status
            Source
            Language