Showing 3,246 of 4,217 total issues

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

<?php

/**
 * Shop managing module.
 */
Severity: Major
Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 1 day to fix

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

    <?php
    
    class yf_manage_shop_orders
    {
        public function _init()

      yf_payment_api has 85 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class yf_payment_api
      {
          public $user_id_default = null;
          public $user_id = null;
      
      
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api.class.php - About 1 day to fix

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

        <?php
        
        return [
            0 => [
                'payment_id' => '22',
        Severity: Major
        Found in .dev/tests/functional/model/fixtures/payment.data.php - About 1 day to fix

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

          <?php
          
          return [
              0 => [
                  'rental_id' => '361',
          Severity: Major
          Found in .dev/tests/functional/model/fixtures/rental.data.php - About 1 day to fix

            Function _filter_sql_prepare has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _filter_sql_prepare($filter_data = [], $filter_params = [], $__sql = '', $table = null)
                {
                    if ( ! $filter_data) {
                        return '';
                    }
            Severity: Minor
            Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 1 day 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_manage_transfer.class.php has 687 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            class yf_manage_transfer
            {
                public $payment_api = null;
            Severity: Major
            Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 1 day to fix

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

              <?php
              
              _class('payment_api__provider_remote');
              
              class yf_payment_api__provider_perfectmoney extends yf_payment_api__provider_remote

                File yf_aliases.php has 687 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                ///////////////////////////////////
                // Aliases for often used methods
                ///////////////////////////////////
                Severity: Major
                Found in functions/yf_aliases.php - About 1 day to fix

                  Function _try_to_find_libs has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _try_to_find_libs()
                      {
                          if ( ! $this->AUTO_FIND_PATHS) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/common/classes/common/yf_image_manip.class.php - About 1 day 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_template_file has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _get_template_file($file_name = '', $force_storage = '', $JUST_CHECK_IF_EXISTS = false, $RETURN_TEMPLATE_PATH = false)
                      {
                          $string = false;
                          $NOT_FOUND = false;
                          $storage = 'inline';
                  Severity: Minor
                  Found in plugins/tpl/classes/yf_tpl.class.php - About 1 day 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_html.class.php has 675 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  class sample_html
                  {
                      /***/
                  Severity: Major
                  Found in .dev/samples/classes/sample_html.class.php - About 1 day to fix

                    yf_assets has 81 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class yf_assets
                    {
                        /** @array */
                        public $supported_asset_types = [
                            'jquery', 'js', 'css', 'less', 'sass', 'coffee', 'bundle', 'asset', /*, 'img', 'font'*/
                    Severity: Major
                    Found in plugins/assets/classes/yf_assets.class.php - About 1 day to fix

                      Method _api_transaction has 303 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _api_transaction($options)
                          {
                              if ( ! $this->ENABLE) {
                                  return  null;
                              }
                      Severity: Major
                      Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 1 day to fix

                        Function _go has a Cognitive Complexity of 76 (exceeds 5 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: Minor
                        Found in classes/yf_redirect.class.php - About 1 day 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_category_editor.class.php has 666 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /**
                         * Categories editor.
                         *
                        Severity: Major
                        Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 1 day to fix

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

                          <?php
                          
                          return [
                            2 => [
                              'id' => '2',
                          Severity: Major
                          Found in .dev/install/installer_data/db_tables/sys_admin_modules.data.php - About 1 day to fix

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

                            <?php
                            
                            return [
                                'fields' => [
                                    'id' => [
                            Severity: Major
                            Found in plugins/sys/share/db/sql_php/user.sql_php.php - About 1 day to fix

                              Function _get_modules_from_files has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
                                  {
                                      $user_modules_array = [];
                                      $pattern_include = '-f ~/' . preg_quote(USER_MODULES_DIR, '~') . '.*' . preg_quote(YF_CLS_EXT, '~') . '$~';
                                      $pattern_no_submodules = '~/' . preg_quote(USER_MODULES_DIR, '~') . '[^/]+' . preg_quote(YF_CLS_EXT, '~') . '$~ims';
                              Severity: Minor
                              Found in plugins/sys/classes/core_api/yf_core_api_user_modules.class.php - About 1 day 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 compare_table has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function compare_table($t1, $t2, $db_prefix)
                                  {
                                      $prefix_len = strlen($db_prefix);
                                      $columns = [];
                                      $indexes = [];
                              Severity: Minor
                              Found in plugins/db/classes/db/yf_db_migrator.class.php - About 1 day 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