Showing 4,217 of 4,217 total issues

Method test_where_like has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function test_where_like()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
Severity: Minor
Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 1 hr to fix

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

        public function connect($options = [])
        {
            if ( ! $this->_connection) {
                if ( ! $options) {
                    $options = [
    Severity: Major
    Found in plugins/queue/classes/queue/yf_queue_driver_redis.class.php and 1 other location - About 1 hr to fix
    plugins/cache/classes/cache/yf_cache_driver_redis.class.php on lines 56..73

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

    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 connect($options = [])
        {
            if ( ! $this->_connection) {
                if ( ! $options) {
                    $options = [
    Severity: Major
    Found in plugins/cache/classes/cache/yf_cache_driver_redis.class.php and 1 other location - About 1 hr to fix
    plugins/queue/classes/queue/yf_queue_driver_redis.class.php on lines 51..68

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

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

        public function create()
        {
            @$replace = [] + $_POST;
            $_this = $this;
            $result = form($replace, ['autocomplete' => 'off'])
    Severity: Minor
    Found in plugins/payment/admin_modules/yf_manage_transfer.class.php - About 1 hr to fix

      Method _collect_vars_in_file has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method show has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function show()
            {
                $all_vars = $this->_get_all_vars();
                $total_vars = count((array) $all_vars);
                $tr_vars = [];
        Severity: Minor
        Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 1 hr to fix

          Method menu has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function menu($data = [], $extra = [])
              {
                  $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                  if ($data) {
                      $data = $this->_recursive_sort_items($data);
          Severity: Minor
          Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

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

                public function _api_response()
                {
                    if ( ! $this->ENABLE) {
                        return  null;
                    }
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api__provider_privat24.class.php - About 1 hr to fix

              Method _recursive_get_methods_from_extends has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
                  {
                      $extends_file_path = '';
                      $methods = [];
                      // TODO: connect plugins
              Severity: Minor
              Found in plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php - About 1 hr to fix

                Method _get_cke_config has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _get_cke_config($params = [])
                    {
                        asset('ckeditor-plugin-save');
                        asset('ckeditor-plugin-autosave');
                        asset('ckeditor-plugin-html5-video');
                Severity: Minor
                Found in plugins/sys/classes/yf_admin_methods.class.php - About 1 hr to fix

                  Method _track_geo_location has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _track_geo_location()
                      {
                          if ( ! $this->TRACK_GEO_LOCATION || ! main()->USE_GEO_IP) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 1 hr to fix

                    Method _recursive_get_methods_from_extends has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
                        {
                            $extends_file_path = '';
                            $methods = [];
                            // TODO: connect plugins
                    Severity: Minor
                    Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 1 hr to fix

                      Method list_foreign_keys has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function list_foreign_keys($table, $extra = [], &$error = false)
                          {
                              if (is_array($table)) {
                                  $extra = (array) $extra + $table;
                                  $table = '';
                      Severity: Minor
                      Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 1 hr to fix

                        Method _render_thead has 46 lines of code (exceeds 25 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 1 hr to fix

                          Method _get_geo_data_from_db has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _get_geo_data_from_db($cur_ip = '')
                              {
                                  $cur_ip = trim(array_pop(explode(',', preg_replace("/[^0-9\.,]/i", '', $cur_ip))));
                                  if (empty($cur_ip)) {
                                      return false;
                          Severity: Minor
                          Found in plugins/common/classes/common/yf_other_common.class.php - About 1 hr to fix

                            Method read_file has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function read_file($server_info = [], $remote_file = '', $local_file = '')
                                {
                                    $local_file = trim($local_file);
                                    $remote_file = _class('ssh')->_prepare_path($remote_file);
                                    if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! strlen($remote_file)) {
                            Severity: Minor
                            Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 1 hr to fix

                              Method exec has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function exec($server_info = [], $cmd = '')
                                  {
                                      if ( ! $this->_INIT_OK || ! $cmd || ! $server_info) {
                                          return false;
                                      }
                              Severity: Minor
                              Found in plugins/ssh/classes/yf_ssh.class.php - About 1 hr to fix

                                Method _get_available_widgets_hooks has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function _get_available_widgets_hooks($for_section = 'admin')
                                    {
                                        if ( ! in_array($for_section, ['user', 'admin'])) {
                                            $for_section = 'admin';
                                        }
                                Severity: Minor
                                Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 1 hr to fix

                                  Method test_validate_custom_error has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function test_validate_custom_error()
                                      {
                                          $_SERVER['REQUEST_METHOD'] = 'POST';
                                          $params = ['do_not_remove_errors' => 1];
                                  
                                  
                                  Severity: Minor
                                  Found in .dev/tests/functional/class_form_real_test.Test.php - About 1 hr to fix

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

                                            'receiver_type' => [
                                                'name' => 'receiver_type',
                                                'type' => 'enum',
                                                'length' => null,
                                                'decimals' => null,
                                    plugins/notifications/share/db/sql_php/notifications_receivers.sql_php.php on lines 35..53
                                    plugins/sys/share/db/sql_php/users_online.sql_php.php on lines 20..38
                                    plugins/sys/share/db/sql_php/users_online_details.sql_php.php on lines 20..38

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

                                    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