Showing 4,217 of 4,217 total issues

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

            if ($plugin_name) {
                $tmp = APP_PATH . 'plugins/' . $plugin_name . '/' . ADMIN_MODULES_DIR . $module_name . YF_CLS_EXT;
                if (file_exists($tmp)) {
                    $file_names['admin_app_plugin'] = $tmp;
                }
Severity: Major
Found in plugins/admin/admin_modules/yf_admin_modules.class.php and 1 other location - About 2 hrs to fix
plugins/user/admin_modules/yf_user_modules.class.php on lines 299..308

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

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

            if ($plugin_name) {
                $tmp = APP_PATH . 'plugins/' . $plugin_name . '/' . USER_MODULES_DIR . $module_name . YF_CLS_EXT;
                if (file_exists($tmp)) {
                    $file_names['app_plugin'] = $tmp;
                }
Severity: Major
Found in plugins/user/admin_modules/yf_user_modules.class.php and 1 other location - About 2 hrs to fix
plugins/admin/admin_modules/yf_admin_modules.class.php on lines 304..313

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

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

    public function _process_sub_patterns($text = '', $args = [])
    {
        if (false === strpos($text, '{') || ! is_array($args)) {
            return $text;
        }
Severity: Major
Found in plugins/locale/classes/yf_i18n.class.php - About 2 hrs to fix

    Method phone_box has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function phone_box($name = 'phone', $values = [], $selected = '', $extra = [])
        {
            if (is_array($name)) {
                $extra = (array) $extra + $name;
            } else {
    Severity: Major
    Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

      Method select2_box has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function select2_box($name, $values = [], $selected = '', $extra = [])
          {
              $css = [];
              $style = [];
              if (is_array($name)) {
      Severity: Major
      Found in plugins/html/classes/yf_html.class.php - About 2 hrs to fix

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

            public function show()
            {
                $object = &$this->object;
                $action = &$this->action;
                $filter_name = &$this->filter_name;
        Severity: Major
        Found in plugins/payment/admin_modules/yf_manage_payment.class.php - About 2 hrs to fix

          Method rates has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Method _build has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _build($a, $class_rewrite)
                {
                    $u = false;
                    if ( ! empty($class_rewrite->BUILD_RULES)) {
                        foreach ((array) $class_rewrite->BUILD_RULES as $func) {
            Severity: Major
            Found in plugins/rewrite/classes/rewrite/yf_rewrite_pattern_yf.class.php - About 2 hrs to fix

              File yf_make_thumb.class.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * Generating thumbs from images handler.
               *
              Severity: Minor
              Found in plugins/common/classes/common/yf_make_thumb.class.php - About 2 hrs to fix

                Method _process_text has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _process_text($body = '', $no_smilies = false, $smilies_as_image = false)
                    {
                        if (empty($body)) {
                            return '';
                        }
                Severity: Major
                Found in plugins/content/classes/yf_bb_codes.class.php - About 2 hrs to fix

                  Method _view_widget_items has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _view_widget_items($name_ids = [], $items_configs = [])
                      {
                          $list_of_hooks = $this->_get_available_widgets_hooks();
                  
                          $_orig_object = $_GET['object'];
                  Severity: Major
                  Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 2 hrs to fix

                    Method test_yf_db_installer_sharding has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function test_yf_db_installer_sharding()
                        {
                            $bak['ERROR_AUTO_REPAIR'] = self::db()->ERROR_AUTO_REPAIR;
                            self::db()->ERROR_AUTO_REPAIR = true;
                    
                    
                    Severity: Major
                    Found in .dev/tests/functional/db/class_db_real_installer_mysql_test.Test.php - About 2 hrs to fix

                      Method _city_select has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _city_select($params = [])
                          {
                              $STPL_NAME = 'register/city_select';
                              if ( ! empty($params['stpl_name'])) {
                                  $STPL_NAME = $params['stpl_name'];
                      Severity: Major
                      Found in plugins/geo/modules/yf_geo_content.class.php - About 2 hrs to fix

                        Method _add_bundle has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _add_bundle($_content, $_params = [])
                            {
                                if ( ! $_content) {
                                    return false;
                                }
                        Severity: Major
                        Found in plugins/assets/classes/yf_assets.class.php - About 2 hrs to fix

                          Method validate has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function validate($options)
                              {
                                  // import options
                                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                  // check payment method, type
                          Severity: Major
                          Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 2 hrs to fix

                            Method _form_options has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Method _api_user_select_box has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function _api_user_select_box($options = null)
                                  {
                                      // etc
                                      $api = _class('api');
                                      $api->JSON_VULNERABILITY_PROTECTION = false;
                              Severity: Major
                              Found in plugins/form2/classes/yf_form_api.class.php - About 2 hrs to fix

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

                                    public function _get_methods_names_from_text($text = '', $ONLY_PRIVATE_METHODS = false)
                                    {
                                        $methods = [];
                                        if (empty($text)) {
                                            return $methods;
                                plugins/admin/admin_modules/yf_admin_modules.class.php on lines 423..442
                                plugins/sys/classes/core_api/yf_core_api_user_modules.class.php on lines 286..306
                                plugins/user/admin_modules/yf_user_modules.class.php on lines 410..430

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

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

                                    public function _get_methods_names_from_text($text = '', $ONLY_PRIVATE_METHODS = false)
                                    {
                                        $methods = [];
                                        if (empty($text)) {
                                            return $methods;
                                plugins/admin/admin_modules/yf_admin_modules.class.php on lines 423..442
                                plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php on lines 308..327
                                plugins/user/admin_modules/yf_user_modules.class.php on lines 410..430

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

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

                                    public function _get_methods_names_from_text($text = '', $ONLY_PRIVATE_METHODS = false)
                                    {
                                        $methods = [];
                                        if (empty($text)) {
                                            return $methods;
                                Severity: Major
                                Found in plugins/user/admin_modules/yf_user_modules.class.php and 3 other locations - About 2 hrs to fix
                                plugins/admin/admin_modules/yf_admin_modules.class.php on lines 423..442
                                plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php on lines 308..327
                                plugins/sys/classes/core_api/yf_core_api_user_modules.class.php on lines 286..306

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

                                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