Showing 3,246 of 4,217 total issues

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

<?php

/**
 * Redirects handler.
 *
Severity: Minor
Found in classes/yf_redirect.class.php - About 3 hrs to fix

    Method _api_response has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _api_response()
        {
            if ( ! $this->ENABLE) {
                return  null;
            }

      Method ajax has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function ajax($force_id = false)
          {
              $id = (int) ($force_id ?: $_GET['id']);
              $admin = from(self::table)->whereid($id)->get();
              if ( ! $id || ! $admin) {
      Severity: Major
      Found in plugins/admin/admin_modules/yf_admin.class.php - About 3 hrs to fix

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

            public function render($params = [])
            {
                if (DEBUG_MODE) {
                    $ts = microtime(true);
                }
        Severity: Major
        Found in plugins/table2/classes/yf_table2.class.php - About 3 hrs to fix

          Method _upload_item__import_action_test has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _upload_item__import_action_test($options)
              {
                  $_ = $options;
                  $fields = $_['fields'];
                  $keys = $_['keys'];

            Method query has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function query($sql, $need_meta = false)
                {
                    if (empty($sql)) {
                        return false;
                    }
            Severity: Major
            Found in plugins/search/classes/yf_sphinxsearch.class.php - About 3 hrs to fix

              yf_menus_editor has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class yf_menus_editor
              {
                  /** @var string Path to icons */
                  public $ICONS_PATH = 'uploads/icons/';
              
              
              Severity: Minor
              Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 3 hrs to fix

                yf_tpl_driver_yf has 29 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class yf_tpl_driver_yf
                {
                    /** @var array @conf_skip For "_process_ifs" */
                    public $_cond_operators = [
                        'eq' => '==',
                Severity: Minor
                Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 3 hrs to fix

                  Method multi_check_box has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function multi_check_box($name, $values = [], $selected = [], $horizontal = true, $type = 2, $add_str = '', $translate = 0, $name_as_array = false)
                      {
                          if (is_array($name)) {
                              $extra = (array) $extra + $name;
                              $name = $extra['name'];
                  Severity: Major
                  Found in plugins/html/classes/yf_html.class.php - About 3 hrs to fix

                    Method transfer has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function transfer($options = null)
                        {
                            $_ = &$options;
                            $is_transaction = isset( $_['is_transaction'] ) ? $_['is_transaction'] : true;
                            // check: from, to
                    Severity: Major
                    Found in plugins/payment/classes/yf_payment_api.class.php - About 3 hrs to fix

                      Method _security_settings has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _security_settings()
                          {
                              asset('bfh-select');
                      
                              $user_id = main()->USER_ID;
                      Severity: Major
                      Found in plugins/sys/admin_modules/yf_manage_security.class.php - About 3 hrs to fix

                        Method http_request has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function http_request($url, $headers = [], $method = 'GET', $data = null, $retry = 3)
                            {
                                $result = new stdClass();
                                // Parse the URL, and make sure we can handle the schema.
                                $uri = parse_url($url);
                        Severity: Major
                        Found in plugins/common/classes/common/yf_remote_files.class.php - About 3 hrs to fix

                          Method show_html has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function show_html($page = 'form', $vars = [], $errors = [])
                              {
                                  if (php_sapi_name() == 'cli' || ! $_SERVER['PHP_SELF']) {
                                      return print '__CONSOLE_INSTALL__' . PHP_EOL;
                                  }
                          Severity: Major
                          Found in .dev/install/install.php - About 3 hrs to fix

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

                            <?php
                            
                            /**
                             * Special methods for admin authentification.
                             *
                            Severity: Minor
                            Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 3 hrs to fix

                              Method _init has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function _init()
                                  {
                                      // class
                                      $this->payment_api = _class('payment_api');
                                      $this->manage_payment_lib = module('manage_payment_lib');
                              Severity: Major
                              Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 3 hrs to fix

                                Function _paths has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _paths() {
                                        $paths = [
                                            '.',
                                            'plugins',
                                        ];
                                Severity: Minor
                                Found in plugins/tpl/classes/tpl/yf_tpl_driver_twig.class.php - About 3 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 query_fetch_all has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function query_fetch_all($sql, $key_name = null, $use_cache = true)
                                    {
                                        if ( ! strlen($sql)) {
                                            return false;
                                        }
                                Severity: Minor
                                Found in plugins/db/classes/yf_db.class.php - About 3 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 _render_thead has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _render_thead(&$params, &$a, &$to_hide)
                                    {
                                        $data = &$a['data'];
                                        $thead_attrs = '';
                                        if (isset($params['thead'])) {
                                Severity: Minor
                                Found in plugins/table2/classes/yf_table2.class.php - About 3 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 _render_table_contents has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _render_table_contents($data, $params = [], $to_hide = [])
                                    {
                                        $tbody_attrs = '';
                                        if (isset($params['tbody'])) {
                                            $tbody_attrs = is_array($params['tbody']) ? _attrs($params['tbody'], ['class', 'id']) : ' ' . $params['tbody'];
                                Severity: Minor
                                Found in plugins/table2/classes/yf_table2.class.php - About 3 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 _render_table_contents_rotated has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _render_table_contents_rotated($data = [], $params, $to_hide = [])
                                    {
                                        $tbody_attrs = '';
                                        if (isset($params['tbody'])) {
                                            $tbody_attrs = is_array($params['tbody']) ? _attrs($params['tbody'], ['class', 'id']) : ' ' . $params['tbody'];
                                Severity: Minor
                                Found in plugins/table2/classes/yf_table2.class.php - About 3 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