Showing 4,217 of 4,217 total issues

Method _data_ng has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _data_ng($json = false)
    {
        $cache = &$this->cache;
        $_url = [
            'product_view' => url_user(['object' => 'shop',        'action' => 'product',      'id' => 0]),

    Method __construct has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($type = 'user', $no_db_connect = false, $auto_init_all = false, $_conf = [])
        {
            if ( ! isset($this->_time_start)) {
                $this->_time_start = microtime(true);
            }
    Severity: Major
    Found in classes/yf_main.class.php - About 2 hrs to fix

      Method _update_config has 60 lines of code (exceeds 25 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: Major
      Found in plugins/search/admin_modules/yf_manage_sphinx.class.php - About 2 hrs to fix

        Method tip has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function tip($in = null, $extra = [])
            {
                if ( ! is_array($extra)) {
                    $extra = [];
                }
        Severity: Major
        Found in classes/yf_graphics.class.php - About 2 hrs to fix

          Method test_with_data_full has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function test_with_data_full()
              {
                  $data = [
                      [
                          'date' => strtotime('2014-08-12 12:03:19 UTC'),
          Severity: Major
          Found in .dev/tests/unit/functions/function_common_rss_page_test.php - About 2 hrs to fix

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

                public function yes_no($name = '', $extra = [])
                {
                    if ( ! isset($this->_pair_yes_no)) {
                        $this->_pair_yes_no = str_replace('class="', 'disabled class="', main()->get_data('pair_yes_no'));
                    }
            Severity: Major
            Found in plugins/table2/classes/yf_table2.class.php and 1 other location - About 2 hrs to fix
            plugins/table2/classes/yf_table2.class.php on lines 1548..1559

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

            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 2 locations. Consider refactoring.
            Open

                public function allow_deny($name, $extra = [])
                {
                    if ( ! isset($this->_pair_allow_deny)) {
                        $this->_pair_allow_deny = str_replace('class="', 'disabled class="', main()->get_data('pair_allow_deny'));
                    }
            Severity: Major
            Found in plugins/table2/classes/yf_table2.class.php and 1 other location - About 2 hrs to fix
            plugins/table2/classes/yf_table2.class.php on lines 1565..1576

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

            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 _currency_rate_load has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _currency_rate_load($options = null)
                {
                    // import options
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                    // var
            Severity: Major
            Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

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

                Method _get_users_daily_payments has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _get_users_daily_payments($user_ids = [], $type = 'sum')
                    {
                        if ( ! $user_ids) {
                            return false;
                        }
                Severity: Major
                Found in plugins/payment/admin_modules/yf_manage_payment.class.php - About 2 hrs to fix

                  Method _get_time_diff_human has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _get_time_diff_human($seconds, $delimiter = ' ', $need_return = false, $only_text = false, $need_closing_tag = false)
                      {
                          $d = [];
                          $tr = [
                              'years' => ['лет', 'год', 'года'],
                  Severity: Major
                  Found in plugins/common/classes/yf_common.class.php - About 2 hrs to fix

                    Method upload_dir has 59 lines of code (exceeds 25 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: Major
                    Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 2 hrs to fix

                      Method test_get_and_limit has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function test_get_and_limit()
                          {
                              if ($this->_need_skip_test(__FUNCTION__)) {
                                  return;
                              }
                      Severity: Major
                      Found in .dev/tests/functional/db/class_db_real_mysql_test.Test.php - About 2 hrs to fix

                        Method test_join has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function test_join()
                            {
                                if ($this->_need_skip_test(__FUNCTION__)) {
                                    return;
                                }
                        Severity: Major
                        Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 2 hrs to fix

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

                              public function _get_site_current_theme($SITE_INFO = [])
                              {
                                  $index_file_path = $SITE_INFO['REAL_PATH'] . $this->_index_file_name;
                                  if ( ! file_exists($index_file_path)) {
                                      return false;
                          plugins/sys/classes/yf_sites_info.class.php on lines 113..129

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

                          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

                              public function _get_site_current_theme($SITE_INFO = [])
                              {
                                  $index_file_path = $SITE_INFO['REAL_PATH'] . $this->_index_file_name;
                                  if ( ! file_exists($index_file_path)) {
                                      return false;
                          Severity: Major
                          Found in plugins/sys/classes/yf_sites_info.class.php and 1 other location - About 2 hrs to fix
                          plugins/sys/classes/core_api/yf_core_api_sites_info.class.php on lines 87..102

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

                          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

                          File test_globals_vs_class.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          function globals_var($name, $value = null)
                          {
                              if ( ! isset($name)) {
                          Severity: Minor
                          Found in .dev/samples/test_globals_vs_class.php - About 2 hrs to fix

                            Consider simplifying this complex logical expression.
                            Open

                                        if ($in_string) {
                                            for (;;) {
                                                $i = strpos($sql, $string_start, $i);
                                                // No end of string found -> add the current substring to the
                                                // returned array
                            Severity: Critical
                            Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 2 hrs to fix

                              yf_db_driver_pgsql has 22 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class yf_db_driver_pgsql extends yf_db_driver
                              {
                                  /** @var @conf_skip */
                                  public $db_connect_id = null;
                              
                              
                              Severity: Minor
                              Found in plugins/db/classes/db/yf_db_driver_pgsql.class.php - About 2 hrs to fix

                                yf_wrapper_redis has 22 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class yf_wrapper_redis
                                {
                                    public $name = 'REDIS';    // instance name
                                    public $driver = 'phpredis'; // predis|phpredis
                                
                                
                                Severity: Minor
                                Found in plugins/redis/classes/yf_wrapper_redis.class.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language