Showing 3,247 of 4,218 total issues

Function parse has a Cognitive Complexity of 231 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse($sql)
    {
        $parsed = $this->parser->parse($sql);

        $table_name = $parsed['TABLE']['no_quotes']['parts'][0] ?: '';
Severity: Minor
Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.class.php - About 4 days 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 class_db_offline_query_builder_test.Test.php has 1711 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

require_once __DIR__ . '/db_offline_abstract.php';

/**
Severity: Major
Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 4 days to fix

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

    <?php
    
    return [
      0 => [
        'c' => 'AD',
    Severity: Major
    Found in .dev/install/installer_data/db_tables/countries.data.php - About 4 days to fix

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

      <?php
      
      /**
       * Core main class.
       *
      Severity: Major
      Found in classes/yf_main.class.php - About 4 days to fix

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

        <?php
        
        /**
         * HTML high-level controls collection.
         *
        Severity: Major
        Found in plugins/html/classes/yf_html.class.php - About 4 days to fix

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

          <?php
          
          /**
           * Database query builder (Active Record).
           *
          Severity: Major
          Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 4 days to fix

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

            <?php
            
            /**
             * YF db utils driver abstract class.
             */
            Severity: Major
            Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 4 days to fix

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

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

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

                <?php
                
                /**
                 * Database abstraction layer.
                 *
                Severity: Major
                Found in plugins/db/classes/yf_db.class.php - About 3 days to fix

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

                  <?php
                  
                  return [
                    0 => [
                      'code' => 'aa',
                  Severity: Major
                  Found in plugins/locale/share/db/data/languages.data.php - About 3 days to fix

                    File languages.php has 1475 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    $data = [
                      'ab' => [
                        'code' => 'ab',
                    Severity: Major
                    Found in .dev/scripts/languages/languages.php - About 3 days to fix

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

                      <?php
                      
                      /*
                          # addon select: supplier_id
                      
                      

                        Function _filter_array has a Cognitive Complexity of 182 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function _filter_array(&$data, $filter = [], $filter_params = [], $table = null)
                            {
                                if ( ! $data || ! $filter) {
                                    return false;
                                }
                        Severity: Minor
                        Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 3 days 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_debug.class.php has 1386 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /**
                         * Debug console.
                         *
                        Severity: Major
                        Found in classes/yf_debug.class.php - About 3 days to fix

                          File class_db_real_utils_mysql_test.Test.php has 1343 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          require_once __DIR__ . '/db_real_abstract.php';
                          
                          /**
                          Severity: Major
                          Found in .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php - About 3 days to fix

                            yf_form2 has 165 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class yf_form2
                            {
                                public $CLASS_FORM_MAIN = 'form-horizontal';// col-md-6'
                                public $CLASS_FORM_CONTROL = 'form-control';
                                public $CLASS_CKEDITOR = 'ckeditor';
                            Severity: Major
                            Found in plugins/form2/classes/yf_form2.class.php - About 3 days to fix

                              File class_validate_test.Test.php has 1212 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              require_once __DIR__ . '/yf_unit_tests_setup.php';
                              
                              class class_validate_test extends yf\tests\wrapper
                              Severity: Major
                              Found in .dev/tests/unit/class_validate_test.Test.php - About 3 days to fix

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

                                <?php
                                
                                _class('payment_api__provider_remote');
                                
                                class yf_payment_api__provider_webmoney extends yf_payment_api__provider_remote
                                Severity: Major
                                Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 3 days to fix

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

                                  <?php
                                  
                                  _class('payment_api__provider_remote');
                                  
                                  class yf_payment_api__provider_interkassa extends yf_payment_api__provider_remote
                                  Severity: Major
                                  Found in plugins/payment/classes/yf_payment_api__provider_interkassa.class.php - About 3 days to fix

                                    yf_manage_shop has 147 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class yf_manage_shop
                                    {
                                        /** @var bool Filter on/off */
                                        public $USE_FILTER = true;
                                        /** @var string Folder where product's images store */
                                    Severity: Major
                                    Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 2 days to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language