Showing 3,246 of 4,217 total issues

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

<?php

require_once dirname(__DIR__) . '/db_real_abstract.php';

/**
Severity: Major
Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 1 day to fix

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

    <?php
    
    class yf_manage_shop__product_revisions
    {
        public $temp_fields = [

      Method parse has 256 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function parse($sql)
          {
              $parsed = $this->parser->parse($sql);
      
              $table_name = $parsed['TABLE']['no_quotes']['parts'][0] ?: '';
      Severity: Major
      Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.class.php - About 1 day to fix

        yf_table2 has 69 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class yf_table2
        {
            /* Example:
                return table('SELECT * FROM '.db('admin'))
                    ->text('login')
        Severity: Major
        Found in plugins/table2/classes/yf_table2.class.php - About 1 day to fix

          Function product_set_edit has a Cognitive Complexity of 64 (exceeds 5 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();
          
          

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

              protected function _db_import($options, $test)
              {
                  $_ = $options;
                  $id = $_['id'];
                  $fields = $_['fields'];

          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 install.php has 580 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          // TODO: form validation
          // TODO: add language selector $_POST['install_project_lang']
          // TODO: webserver selection (write htaccess or not?)
          Severity: Major
          Found in .dev/install/install.php - About 1 day to fix

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

                public function _on_validate_ok($params = [], $form)
                {
                    $p = $params ?: $_POST;
                    $f = $_FILES['file'];
            
            

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

                public function init_graphics()
                {
                    $init_type = MAIN_TYPE;
                    // Do not remove this!
                    $this->_init_global_tags();
            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 shop_products.sql_php.php has 577 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              class_form_test has 66 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class class_form_test extends yf\tests\wrapper
              {
                  private static $_bak_settings = [];
                  private static $css = [];
                  private static $action = '';
              Severity: Major
              Found in .dev/tests/unit/class_form_test.Test.php - About 1 day to fix

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

                <?php
                
                
                class yf_ssh_files
                {
                Severity: Major
                Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 1 day to fix

                  yf_html has 65 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class yf_html
                  {
                      public $AUTO_ASSIGN_IDS = true;
                      public $BOXES_USE_STPL = false;
                      public $SELECT_BOX_DEF_OPT_TPL = '- %select% %name% -';
                  Severity: Major
                  Found in plugins/html/classes/yf_html.class.php - About 1 day to fix

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

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

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

                          public function init()
                          {
                              // Chained config rule
                              if ($this->BLOCK_FAILED_LOGINS) {
                                  $this->LOG_FAILED_LOGINS = true;
                      Severity: Minor
                      Found in plugins/auth/classes/auth/yf_auth_user.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 sys_log_exec.sql_php.php has 558 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

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

                        <?php
                        
                        /**
                         * SSH Client (based on SSH2 PHP extension).
                         *
                        Severity: Major
                        Found in plugins/ssh/classes/yf_ssh.class.php - About 1 day to fix

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

                          <?php
                          
                          // User profile handling module
                          class yf_user_profile extends yf_module
                          {
                          Severity: Major
                          Found in plugins/user/modules/yf_user_profile.class.php - About 1 day to fix

                            Function _edit has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function _edit($params = [])
                                {
                                    if (empty(main()->USER_ID) && MAIN_TYPE_USER) {
                                        return _error_need_login();
                                    }
                            Severity: Minor
                            Found in plugins/comments/modules/comments/yf_comments_manage.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_i18n.class.php has 551 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /**
                             * Locale handler.
                             *
                            Severity: Major
                            Found in plugins/locale/classes/yf_i18n.class.php - About 1 day to fix
                              Severity
                              Category
                              Status
                              Source
                              Language