Showing 4,217 of 4,217 total issues

Method _db_get has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _db_get($options)
    {
        $cache = &$this->cache;
        $_ = $options;
        $_name = $_['name'];

    Method _perm_str2num has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _perm_str2num($perm = '')
        {
            $perm_len = strlen(trim($perm));
            if ($perm_len > 10 && $perm_len < 9) {
                return false;
    Severity: Minor
    Found in plugins/ssh/classes/yf_ssh.class.php - About 1 hr to fix

      Method find_ids has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function find_ids()
          {
              no_graphics(true);
              if ( ! $_POST || ! main()->USER_ID || IS_ADMIN != 1/* || !strlen($_POST['param'])*/) {
                  echo '';
      Severity: Minor
      Found in plugins/dynamic/modules/dynamic/yf_dynamic_find.class.php - About 1 hr to fix

        Method _get_nav_by_item_id has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _get_nav_by_item_id($item_id = 0, $cat_items = [], $STPL_NAME = '', $prepare_link_callback = null)
            {
                if (empty($STPL_NAME)) {
                    $STPL_NAME = __CLASS__ . '/nav_item';
                }
        Severity: Minor
        Found in plugins/categories/classes/yf_cats.class.php - About 1 hr to fix

          Method attribute_add has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function attribute_add()
              {
                  if (main()->is_post()) {
                      if (empty($_POST['title'])) {
                          _re('Title is required');

            Method _order_step_select_payment has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _order_step_select_payment($FORCE_DISPLAY_FORM = false)
                {
                    // Show previous form if needed
                    if (common()->_error_exists() || empty($_POST)) {
                        return module('shop')->_order_step_delivery();

              Method show_items has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function show_items()
                  {
                      $cat_info = db()->get('SELECT * FROM ' . db('categories') . ' WHERE name="' . db()->es($_GET['id']) . '" OR id=' . (int) ($_GET['id']));
                      if ( ! $cat_info) {
                          return _e('No such category');
              Severity: Minor
              Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 1 hr to fix

                Method _upload_item__import has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function _upload_item__import($options)
                    {
                        $_ = $options;
                        $id = $_['id'];
                        $upload_list = $this->upload_list;

                  Method _debug_redis has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _debug_redis(&$params = [])
                      {
                          if ( ! $this->SHOW_REDIS_INFO) {
                              return '';
                          }
                  Severity: Minor
                  Found in classes/yf_debug.class.php - About 1 hr to fix

                    Method init_class has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function init_class($class_name, $custom_path = '', $params = '')
                        {
                            $class_name = $this->get_class_name($class_name);
                            if (isset($this->modules[$class_name]) && is_object($this->modules[$class_name])) {
                                return $this->modules[$class_name];
                    Severity: Minor
                    Found in classes/yf_main.class.php - About 1 hr to fix

                      Method _connect has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _connect()
                          {
                              if (isset($this->sphinx_connection)) {
                                  return $this->sphinx_connection;
                              }
                      Severity: Minor
                      Found in plugins/search/classes/yf_sphinxsearch.class.php - About 1 hr to fix

                        Method test_yf_db_installer_basic has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function test_yf_db_installer_basic()
                            {
                                if ($this->_need_skip_test(__FUNCTION__)) {
                                    return;
                                }

                          Method create_tables has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function create_tables()
                              {
                          try {
                                  self::utils()->create_table('bears', function ($t) {
                                      $t->increments('id')
                          Severity: Minor
                          Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 1 hr to fix

                            Method test_complex has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function test_complex()
                                {
                                    $data = [
                                        'a_variable' => 'var_value',
                                        'navigation' => [
                            Severity: Minor
                            Found in .dev/tests/unit/tpl/tpl_driver_yf_test.Test.php - About 1 hr to fix

                              Method send_mail has 13 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function send_mail($email_from, $name_from = '', $email_to = '', $name_to = '', $subject = '', $text = '', $html = '', $attaches = [], $charset = '', $old_param1 = '', $force_mta_opts = [], $priority = null, $smtp = [])
                              Severity: Major
                              Found in plugins/common/classes/yf_common.class.php - About 1 hr to fix

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                        $data = [
                                            ['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
                                            ['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
                                            ['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
                                            ['key' => 'primary', 'key_cols' => 'id'],
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 119..124
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 229..234
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 248..253
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 267..272

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 113.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                <?php
                                
                                return [
                                  1 => [
                                    'id' => '1',
                                plugins/locale/share/db/data/sys_locale_langs.data.php on lines 1..28

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 113.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                        $data = [
                                            ['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
                                            ['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
                                            ['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
                                            ['key' => 'primary', 'key_cols' => 'id'],
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 119..124
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 149..154
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 229..234
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 248..253

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 113.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                        $data = [
                                            ['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
                                            ['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
                                            ['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
                                            ['key' => 'primary', 'key_cols' => 'id'],
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 149..154
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 229..234
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 248..253
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 267..272

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 113.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 5 locations. Consider refactoring.
                                Open

                                        $in = [
                                            ['name' => 'id', 'type' => 'int', 'length' => 10, 'auto_inc' => true],
                                            ['name' => 'name', 'type' => 'varchar', 'length' => 255, 'default' => '', 'not_null' => true],
                                            ['name' => 'active', 'type' => 'enum', 'length' => '\'0\',\'1\'', 'default' => '0', 'not_null' => true],
                                            ['key' => 'primary', 'key_cols' => 'id'],
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 119..124
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 149..154
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 229..234
                                .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php on lines 267..272

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 113.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language