Showing 3,246 of 4,217 total issues

Method _go has 138 lines of code (exceeds 25 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: Major
Found in classes/yf_redirect.class.php - About 5 hrs to fix

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

    <?php
    
    return [
        'fields' => [
            'id' => [
    Severity: Minor
    Found in plugins/shop/share/db/sql_php/shop_orders.sql_php.php - About 5 hrs to fix

      yf_locale_editor has 41 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class yf_locale_editor
      {
          /** @var array @conf_skip */
          private static $HELP = [
              'edit' => [
      Severity: Minor
      Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 5 hrs to fix

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

        <?php
        
        /**
         * User modules list handler.
         *
        Severity: Minor
        Found in plugins/user/admin_modules/yf_user_modules.class.php - About 5 hrs to fix

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

          <?php
          
          class yf_payment
          {
              public $URL_REDIRECT = '/payment';
          Severity: Minor
          Found in plugins/payment/modules/yf_payment.class.php - About 5 hrs to fix

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

            <?php
            
            /**
             * Table2 plugin.
             */
            Severity: Minor
            Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 5 hrs to fix

              Method _on_validate_ok has 136 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function add has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function add($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 _do_login has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function _do_login($params = [])
                    {
                        $AUTH_LOGIN = trim($params['login']);
                        $AUTH_PSWD = trim($params['pswd']);
                
                
                Severity: Minor
                Found in plugins/auth/classes/auth/yf_auth_user.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 num2str has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function num2str($float, $currency_id = null, $lang_id = null, $set = false)
                    {
                        $lang_id = $this->lang_id($lang_id, $set);
                        $currency_id = $this->currency_id($currency_id, $set);
                        $words = &$this->words[$lang_id];
                Severity: Minor
                Found in plugins/common/classes/common/yf_common_num2string.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

                Method _operation has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _operation($options = null)
                    {
                        // import options
                        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                        // var
                Severity: Major
                Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 5 hrs to fix

                  Method payment has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

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

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

                      Method _email_verify has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _email_verify($email = '', $check_mx = false, $check_by_smtp = false, $check_blacklists = false)
                          {
                              if (empty($email)) {
                                  return false;
                              }
                      Severity: Major
                      Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 hrs to fix

                        Method _edit has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _edit($params = [])
                            {
                                if (empty(main()->USER_ID) && MAIN_TYPE_USER) {
                                    return _error_need_login();
                                }
                        Severity: Major
                        Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 5 hrs to fix

                          Function _process_sub_patterns has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _process_sub_patterns($text = '', $args = [])
                              {
                                  if (false === strpos($text, '{') || ! is_array($args)) {
                                      return $text;
                                  }
                          Severity: Minor
                          Found in plugins/locale/classes/yf_i18n.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 _show_menu has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _show_menu($input = [])
                              {
                                  $RETURN_ARRAY = isset($input['return_array']) ? $input['return_array'] : false;
                                  $force_stpl_name = isset($input['force_stpl_name']) ? $input['force_stpl_name'] : false;
                                  $menu_name = $input['name'];
                          Severity: Minor
                          Found in plugins/sys/admin_modules/yf_menus_editor.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 _recursive_get_methods_from_extends has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
                              {
                                  $extends_file_path = '';
                                  $methods = [];
                                  // TODO: connect plugins
                          Severity: Minor
                          Found in plugins/sys/classes/core_api/yf_core_api_admin_modules.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 _prepare_cond_text has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _prepare_cond_text($cond = '', $replace = [], $stpl_name = '', $for_right = false)
                              {
                                  $prepared_array = [];
                                  $cond = str_replace("\t", '', trim($cond));
                                  foreach (explode(' ', $cond) as $val) {
                          Severity: Minor
                          Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.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 _process_replaces has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _process_replaces($string, array &$replace, $name = '')
                              {
                                  if ( ! strlen($string) || false === strpos($string, '{')) {
                                      return $string;
                                  }
                          Severity: Minor
                          Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.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

                          Severity
                          Category
                          Status
                          Source
                          Language