Showing 3,246 of 4,217 total issues

Function join has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public function join($table, $on, $join_type = '', $is_select = false)
    {
        $join_types = [
            'left',
            'right',
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 6 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 _add_revision has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public function _add_revision($type, $action, $ids = false)
    {
        if (empty($ids) || empty($action) || empty($type)) {
            return false;
        }

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 _skip_by_pattern has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public function _skip_by_pattern($path = '', $_is_dir = false, $pattern_include = '', $pattern_exclude = '')
    {
        if ( ! $path) {
            return false;
        }
Severity: Minor
Found in classes/yf_dir.class.php - About 6 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 _debug_DEBUG_YF has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _debug_DEBUG_YF(&$params = [])
    {
        if ( ! $this->SHOW_SETTINGS) {
            return '';
        }
Severity: Major
Found in classes/yf_debug.class.php - About 6 hrs to fix

    Method product_set_edit has 150 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function product_set_edit()
        {
            $product_set_id = (int) $_GET['id'];
            $a = db()->from('shop_product_sets')->whereid($product_set_id)->get();
    
    

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

      <?php
      
      class yf_manage_payment_operation
      {
          public $payment_api = null;
      Severity: Minor
      Found in plugins/payment/admin_modules/yf_manage_payment_operation.class.php - About 5 hrs to fix

        Method test_select_box has 149 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function test_select_box()
            {
                $html = html();
                $def_class = $html->CLASS_SELECT_BOX;
                $def_opt_class = $html->CLASS_SELECT_OPTION_DEFAULT;
        Severity: Major
        Found in .dev/tests/unit/class_html_test.Test.php - About 5 hrs to fix

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

          <?php
          
          /**
           * Admin modules list handler.
           *
          Severity: Minor
          Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 5 hrs to fix

            Method api_payout has 148 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function api_payout($method, $options)
                {
                    if ( ! $this->ENABLE) {
                        return  null;
                    }
            Severity: Major
            Found in plugins/payment/classes/yf_payment_api__provider_privat24.class.php - About 5 hrs to fix

              Function _on_validate_ok has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _on_validate_ok($params = [], $form = null)
                  {
                      $p = $params ?: $_POST;
                      $lang = $p['lang_to'];
                      $lang_from = $p['lang_from'] ?: 'en';

              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 edit has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function edit($params = [])
                  {
                      if (is_string($params)) {
                          $params = ['table' => $params];
                      }
              Severity: Minor
              Found in plugins/sys/classes/yf_admin_methods.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 _rewrite_replace_links has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _rewrite_replace_links($body = '', $standalone = false, $force_rewrite = false, $for_site_id = false)
                  {
                      if (MAIN_TYPE_ADMIN && ! $force_rewrite) {
                          return $body;
                      }
              Severity: Minor
              Found in plugins/rewrite/classes/yf_rewrite.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 add has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function add($object_name, $ids = [], $action = null, $extra = [])
                  {
                      if ( ! $this->ENABLED) {
                          return false;
                      }
              Severity: Minor
              Found in plugins/db/admin_modules/yf_manage_revisions.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 text has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function text($name, $desc = '', $extra = [])
                  {
                      // Shortcut: use second param as $extra
                      if (is_array($desc)) {
                          $extra = (array) $extra + $desc;
              Severity: Minor
              Found in plugins/table2/classes/yf_table2.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 _view_widget_items has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _view_widget_items($name_ids = [], $items_configs = [])
                  {
                      $list_of_hooks = $this->_get_available_widgets_hooks();
              
                      $_orig_object = $_GET['object'];
              Severity: Minor
              Found in plugins/common/classes/common/yf_dashboards.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 _attrs has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  function _attrs($extra, $names)
                  {
                      $body = [];
                      $a = [];
                      foreach ((array) $names as $name) {
              Severity: Minor
              Found in functions/yf_common_funcs.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 yf_core_blocks.class.php has 413 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * Core blocks methods.
               *
              Severity: Minor
              Found in plugins/sys/classes/yf_core_blocks.class.php - About 5 hrs to fix

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

                <?php
                
                /**
                 * Blocks editor.
                 *
                Severity: Minor
                Found in plugins/sys/admin_modules/yf_blocks.class.php - About 5 hrs to fix

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

                  <?php
                  
                  
                  load('db_utils_driver', '', 'classes/db/');
                  class yf_db_utils_mysql extends yf_db_utils_driver
                  Severity: Minor
                  Found in plugins/db/classes/db/yf_db_utils_mysql.class.php - About 5 hrs to fix

                    File sys_block_rules.data.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    return [
                      1 => [
                        'id' => '1',
                    Severity: Minor
                    Found in .dev/install/installer_data/db_tables/sys_block_rules.data.php - About 5 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language