Showing 3,246 of 4,217 total issues

Method auto has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function auto($table = '', $id = '', $params = [], $form)
    {
        if ($params['links_add']) {
            $form->_params['links_add'] = $params['links_add'];
        }
Severity: Major
Found in plugins/form2/classes/form2/yf_form2_auto.class.php - About 3 hrs to fix

    Method image has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function image($name, $path, $link = '', $extra = [], $table)
        {
            if (is_array($path)) {
                $extra = (array) $extra + $path;
                $path = '';
    Severity: Major
    Found in plugins/table2/classes/table2/yf_table2_image.class.php - About 3 hrs to fix

      Method render_type_blocks has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render_type_blocks($params = [])
          {
              $total_records = $params['total_records'];
              $per_page = $params['per_page'];
              $requested_page = $params['requested_page'];
      Severity: Major
      Found in plugins/common/classes/common/yf_divide_pages.class.php - About 3 hrs to fix

        Method ajax_validate has 82 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ajax_validate()
            {
                no_graphics(true);
                header('X-Robots-Tag: noindex, nofollow, noarchive, nosnippet');
        
        
        Severity: Major
        Found in plugins/dynamic/modules/dynamic/yf_dynamic_validate.class.php - About 3 hrs to fix

          Function li_tree has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function li_tree($data = [], $extra = [])
              {
                  $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                  if ($data) {
                      $data = $this->_parent->_recursive_sort_items($data);
          Severity: Minor
          Found in plugins/html/classes/html/yf_html_tree.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 tabs has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function tabs($tabs = [], $extra = [])
              {
                  $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
          
                  $extra_by_id = [];
          Severity: Minor
          Found in plugins/html/classes/yf_html.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 _collect_vars_in_file has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _collect_vars_in_file($file, $type, $params = [])
              {
                  if ( ! $file) {
                      return [];
                  }

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

              public function drag_items()
              {
                  if (empty($_GET['id'])) {
                      return _e('No id!');
                  }
          Severity: Minor
          Found in plugins/sys/admin_modules/yf_menus_editor.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 group_by has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function group_by()
              {
                  $sql = '';
                  $items = func_get_args();
                  if ( ! count((array) $items)) {
          Severity: Minor
          Found in plugins/db/classes/db/yf_db_query_builder_driver.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_auto has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _render_auto(&$params, &$data)
              {
                  if ($params['auto'] && $data) {
                      $field_names = array_keys((array) current((array) $data));
                      $skip_fields = [];
          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 fetch_data has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function fetch_data($params = [])
              {
                  // Templates names
                  $STPL_MAIN = ! empty($params['stpl_main']) ? $params['stpl_main'] : 'system/common/get_rss_page_main';
                  $STPL_ITEM = ! empty($params['stpl_item']) ? $params['stpl_item'] : 'system/common/get_rss_page_item';
          Severity: Minor
          Found in plugins/common/classes/common/yf_rss_data.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 _save_log has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _save_log($params = [])
              {
                  if ( ! $this->LOG_REDIRECTS) {
                      return false;
                  }
          Severity: Minor
          Found in plugins/logs/classes/logs/yf_logs_redirect.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 upload_dir has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function upload_dir($server_info = [], $local_dir = '', $remote_dir = '', $pattern_include = '', $pattern_exclude = '', $level = null)
              {
                  $local_dir = _class('ssh')->_prepare_path($local_dir);
                  $remote_dir = _class('ssh')->_prepare_path($remote_dir);
                  if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($local_dir) || ! strlen($remote_dir)) {
          Severity: Minor
          Found in plugins/ssh/classes/ssh/yf_ssh_files.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 mkdir_m has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function mkdir_m($server_info = [], $dir_name = '', $dir_mode = 755, $create_index_htmls/*!not implemented here!*/ = 0, $start_folder = '/')
              {
                  if ( ! _class('ssh')->_INIT_OK || ! $server_info) {
                      return false;
                  }
          Severity: Minor
          Found in plugins/ssh/classes/ssh/yf_ssh_files.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 _do_rewrite has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _do_rewrite()
              {
                  $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                  if ($this->is_console() || MAIN_TYPE_ADMIN || ! module_conf('tpl', 'REWRITE_MODE')) {
                      return false;
          Severity: Minor
          Found in classes/yf_main.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 _update_config has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _update_config($name = '', $no_indexing = false, $no_write = false)
              {
                  $conf_file_path = $this->CONF_PATH . 'sphinx.conf';
                  if (file_exists($conf_file_path) && ! is_readable($conf_file_path)) {
                      return _e('Error!. File ' . $conf_file_path . ' is not readable! Please check permissions.');
          Severity: Minor
          Found in plugins/search/admin_modules/yf_manage_sphinx.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 _mkdir_m has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

          function _mkdir_m($dir_name, $dir_mode = 0755, $create_index_htmls = 0, $start_folder = '')
          {
              if ( ! $dir_name || ! strlen($dir_name)) {
                  return 0;
              }
          Severity: Minor
          Found in .dev/useful/pack_zend.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

          Method view has 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function view()
              {
                  // check operation
                  $operation = $this->_operation();
                  // import options
          Severity: Major
          Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 3 hrs to fix

            Method deposition has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Method _do_login has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _do_login()
                  {
                      $AUTH_LOGIN = trim($_POST[$this->LOGIN_FIELD]);
                      $AUTH_PSWD = trim($_POST[$this->PSWD_FIELD]);
              
              
              Severity: Major
              Found in plugins/auth/classes/auth/yf_auth_admin.class.php - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language