Showing 3,246 of 4,217 total issues

File sys_log_csrf_errors.sql_php.php has 639 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_csrf_errors.sql_php.php - About 1 day to fix

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

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

      yf_db_utils_driver has 76 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class yf_db_utils_driver
      {
          /**
           * Catch missing method call.
           * @param mixed $name
      Severity: Major
      Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 1 day to fix

        Function _add has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _add($params = [])
            {
                if (empty(main()->USER_ID) && MAIN_TYPE_USER && ! $params['allow_guests_posts']) {
                    return '';
                }
        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

        Function _show has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _show($params = [])
            {
        
                // Set cookie
                if (empty($_COOKIE['advertise']) && $_GET['ads_places'] == 1) {
        Severity: Minor
        Found in plugins/common/modules/yf_advertising.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_payment_api__provider_bitaps.class.php has 632 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

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

          <?php
          
          require_once __DIR__ . '/tpl__setup.php';
          
          class tpl_driver_yf_core_test extends tpl_abstract
          Severity: Major
          Found in .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php - About 1 day to fix

            class_validate_test has 75 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class class_validate_test extends yf\tests\wrapper
            {
                public static function tearDownAfterClass() : void
                {
                    common()->USER_ERRORS = [];
            Severity: Major
            Found in .dev/tests/unit/class_validate_test.Test.php - About 1 day to fix

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

              <?php
              
              /**
               * Common admin methods hidden by simple api.
               *
              Severity: Major
              Found in plugins/sys/classes/yf_admin_methods.class.php - About 1 day to fix

                Function strip_tags_smart has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
                Open

                function strip_tags_smart(
                    /*string*/ $s,
                    array $allowable_tags = null,
                    /*boolean*/ $is_format_spaces = true,
                    array $pair_tags = ['script', 'style', 'map', 'iframe', 'frameset', 'object', 'applet', 'comment', 'button'],
                Severity: Minor
                Found in functions/yf_strip_tags_smart.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_dir.class.php has 625 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 * Filesystem utils.
                 *
                Severity: Major
                Found in classes/yf_dir.class.php - About 1 day to fix

                  Function _multi_request has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _multi_request($urls, $options = [], $max_threads = 0, &$requests_info = [])
                      {
                          if ( ! $max_threads) {
                              $max_threads = $this->CURL_DEF_MAX_THREADS;
                          }
                  Severity: Minor
                  Found in plugins/common/classes/common/yf_remote_files.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_payment.class.php has 617 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    File yf_common_funcs.php has 612 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    require_once __DIR__ . '/yf_aliases.php';
                    require_once __DIR__ . '/yf_is_funcs.php';
                    require_once __DIR__ . '/yf_array_funcs.php';
                    Severity: Major
                    Found in functions/yf_common_funcs.php - About 1 day to fix

                      Method render has 267 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function render($extra = [], $replace = [])
                          {
                              if (isset($this->_rendered)) {
                                  return $this->_rendered;
                              }
                      Severity: Major
                      Found in plugins/form2/classes/yf_form2.class.php - About 1 day to fix

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

                        <?php
                        
                        require_once __DIR__ . '/db_real_abstract.php';
                        
                        /**

                          Function _render_get_data has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _render_get_data(&$params)
                              {
                                  $default_per_page = MAIN_TYPE_USER ? conf('user_per_page') : conf('admin_per_page');
                                  if ($params['rotate_table']) {
                                      $default_per_page = 10;
                          Severity: Minor
                          Found in plugins/table2/classes/yf_table2.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 balance-recharge.js has 606 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          (function () { 'use strict';
                          
                          var __NS__ = 'payment.balance.recharge';
                          __ANGULAR_MODULES__.push( __NS__ );
                          
                          
                          Severity: Major
                          Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 1 day to fix

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

                            <?php
                            
                            /**
                             * Core API.
                             */
                            Severity: Major
                            Found in plugins/sys/classes/yf_core_api.class.php - About 1 day to fix

                              Function _validate_rules_cleanup has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function _validate_rules_cleanup($validate_rules = [])
                                  {
                                      // Trim names with spaces
                                      foreach ((array) $validate_rules as $name => $raw) {
                                          $trimmed = trim($name);
                              Severity: Minor
                              Found in classes/yf_validate.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