Showing 4,217 of 4,217 total issues

Method _get_modules_from_files has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
    {
        $modules = [];

        $yf_prefix_len = strlen(YF_PREFIX);
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 1 hr to fix

    Method category_revisions_view has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function category_revisions_view()
        {
            $type = 'category';
            $db_revision = $this->get_revision_db($type);
            $id = (int) $_GET['id'];

      Method download_dir has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function download_dir($server_info = [], $remote_dir = '', $local_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 1 hr to fix

        Method show_site_title has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function show_site_title()
            {
                if (defined('SITE_ADVERT_NAME')) {
                    $title = SITE_ADVERT_NAME;
                }
        Severity: Minor
        Found in classes/yf_graphics.class.php - About 1 hr to fix

          Method test_one_to_one has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function test_one_to_one()
              {
                  if ($this->_need_skip_test(__FUNCTION__)) {
                      return;
                  }
          Severity: Minor
          Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 1 hr to fix

            Method scan_dir has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function scan_dir($start_dir, $FLAT_MODE = true, $include_pattern = '', $exclude_pattern = '')
            {
                if ( ! file_exists($start_dir)) {
                    return false;
                }
            Severity: Minor
            Found in .dev/useful/pack_zend.php - About 1 hr to fix

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

                          table($sql, [
                              'filter' => $filter,
                              'filter_params' => [
                                  'user_id' => ['cond' => 'in', 'field' => 'u.id'],
                                  'name' => 'like',
              Severity: Major
              Found in plugins/payment/admin_modules/yf_manage_payment.class.php and 3 other locations - About 1 hr to fix
              plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..404
              plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 325..374
              plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..506

              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 111.

              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

              Method div_box has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function div_box($name, $values = [], $selected = '', $extra = [])
                  {
                      if (is_array($name)) {
                          $extra = (array) $extra + $name;
                          $name = $extra['name'];
              Severity: Minor
              Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

                Method _preload_data has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _preload_data()
                    {
                        if ($this->_preload_complete) {
                            return true;
                        }
                Severity: Minor
                Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 1 hr to fix

                  Method options_to_str has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function options_to_str(array $options, $is_request = true, $level = 1)
                      {
                          if ($level > $this->options_level_max) {
                              return  null;
                          }
                  Severity: Minor
                  Found in plugins/payment/classes/payment_provider/ecommpay/EcommPay.php - About 1 hr to fix

                    Method edit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function edit()
                        {
                            $id = (int) ($_GET['id']);
                            if ( ! $id) {
                                return js_redirect(url('/@object'), false, 'Empty ID');
                    Severity: Minor
                    Found in plugins/sys/admin_modules/yf_manage_cron.class.php - About 1 hr to fix

                      Method add_rule has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function add_rule()
                          {
                              $block_info = db()->query_fetch('SELECT * FROM ' . db('blocks') . ' WHERE id=' . (int) ($_GET['id']));
                              if (empty($block_info['id'])) {
                                  return _e('No such block!');
                      Severity: Minor
                      Found in plugins/sys/admin_modules/yf_blocks.class.php - About 1 hr to fix

                        Method _get_compiled_string has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _get_compiled_string($name, $replace = [], $params = [])
                            {
                                $compiled_string = null;
                                // TODO: add ability to use memcached or other fast cache-oriented storage instead of files => lower disk IO
                                $compiled_storage = 'files';
                        Severity: Minor
                        Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 1 hr to fix

                          Method _validate_prepare has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _validate_prepare($validate_rules = [], $extra = [])
                              {
                                  $form_global_validate = isset($this->_params['validate']) ? $this->_params['validate'] : (isset($this->_replace['validate']) ? $this->_replace['validate'] : []);
                                  foreach ((array) $form_global_validate as $name => $rules) {
                                      $this->_validate_rules[$name] = $rules;
                          Severity: Minor
                          Found in plugins/form2/classes/yf_form2.class.php - About 1 hr to fix

                            Method list_keys has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function list_keys()
                                {
                                    $do_real_work = true;
                                    if ( ! $this->_driver_ok) {
                                        $do_real_work = false;
                            Severity: Minor
                            Found in plugins/cache/classes/yf_cache.class.php - About 1 hr to fix

                              Method query_fetch has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function query_fetch($sql, $use_cache = true, $assoc = true, $return_sql = false)
                                  {
                                      if ( ! strlen($sql)) {
                                          return false;
                                      }
                              Severity: Minor
                              Found in plugins/db/classes/yf_db.class.php - About 1 hr to fix

                                Method connect has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function connect()
                                    {
                                        $dsn = 'mysql:host=' . $this->params['host'];
                                        if ($this->params['port'] && $this->params['port'] != $this->DEF_PORT) {
                                            $dsn .= ';port=' . $this->params['port'];
                                Severity: Minor
                                Found in plugins/db/classes/db/yf_db_driver_pdo_mysql.class.php - About 1 hr to fix

                                  Method _load_oauth_providers has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function _load_oauth_providers()
                                      {
                                          $config = $this->_load_oauth_config();
                                          if (isset($this->_providers_loaded)) {
                                              return $this->_providers;
                                  Severity: Minor
                                  Found in plugins/oauth/classes/yf_oauth.class.php - About 1 hr to fix

                                    Method go has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function go($text = '')
                                        {
                                            $cur_page_md5 = md5($_GET['object'] . '%%' . $_GET['action'] . '%%' . $_GET['id']);
                                            // Verify and send email
                                            if ( ! empty($_POST['go'])) {
                                    Severity: Minor
                                    Found in plugins/common/classes/common/yf_email_page.class.php - About 1 hr to fix

                                      Method clear_pattern_child_process has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function clear_pattern_child_process()
                                          {
                                              if ( ! isset($_GET['id']) && (int) ($_GET['id'])) {
                                                  return t('Empty clear pattern ID');
                                              }
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language