Showing 4,217 of 4,217 total issues

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

    public function _recursive_sort_items($items = [], $skip_item_id = 0, $parent_id = 0, $level = 0)
    {
        $children = [];
        foreach ((array) $items as $id => $info) {
            $parent_id = $info['parent_id'];
Severity: Major
Found in plugins/content/admin_modules/yf_manage_faq.class.php and 2 other locations - About 3 hrs to fix
plugins/categories/admin_modules/yf_category_editor.class.php on lines 518..534
plugins/sys/admin_modules/yf_menus_editor.class.php on lines 551..567

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

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

    public function _recursive_sort_items($items = [], $skip_item_id = 0, $parent_id = 0, $level = 0)
    {
        $children = [];
        foreach ((array) $items as $id => $info) {
            $parent_id = $info['parent_id'];
Severity: Major
Found in plugins/sys/admin_modules/yf_menus_editor.class.php and 2 other locations - About 3 hrs to fix
plugins/categories/admin_modules/yf_category_editor.class.php on lines 518..534
plugins/content/admin_modules/yf_manage_faq.class.php on lines 345..361

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

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

    public function _recursive_sort_items($items = [], $skip_item_id = 0, $parent_id = 0, $level = 0)
    {
        $children = [];
        foreach ((array) $items as $id => $info) {
            $parent_id = $info['parent_id'];
plugins/content/admin_modules/yf_manage_faq.class.php on lines 345..361
plugins/sys/admin_modules/yf_menus_editor.class.php on lines 551..567

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

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 test_list_procedures()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 995..1009

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

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 (main()->is_post()) {
            if ( ! _ee()) {
                db()->insert('dashboards2', db()->es([
                    'name' => $_POST['name'],
                    'type' => $_POST['type'],
plugins/dashboards/admin_modules/yf_manage_dashboards.class.php on lines 128..139

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

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 test_list_functions()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 912..926

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

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 _apply_transform($text, $trans)
    {
        if (is_string($trans) && strpos($trans, '|') !== false) {
            $trans = explode('|', $trans);
        }
Severity: Major
Found in plugins/table2/classes/yf_table2.class.php and 1 other location - About 3 hrs to fix
plugins/tpl/classes/yf_tpl.class.php on lines 998..1014

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

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 (main()->is_post()) {
            if ( ! _ee()) {
                db()->insert('dashboards', db()->es([
                    'name' => $_POST['name'],
                    'type' => $_POST['type'],
plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 160..171

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

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 _process_var_filters($text = '', $filters = '')
    {
        if (is_string($filters) && strpos($filters, '|') !== false) {
            $filters = explode('|', $filters);
        }
Severity: Major
Found in plugins/tpl/classes/yf_tpl.class.php and 1 other location - About 3 hrs to fix
plugins/table2/classes/yf_table2.class.php on lines 907..923

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

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

    public function ajax_city()
    {
        main()->NO_GRAPHICS = true;
        // Check input
        if (isset($_REQUEST['country'])) {
Severity: Major
Found in plugins/geo/modules/yf_geo_content.class.php - About 3 hrs to fix

    Method html_out has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function html_out($out_type, $content_type, $str, $params = [])
        {
            if ( ! $out_type || ! $content_type || ! strlen($str)) {
                return false;
            }
    Severity: Major
    Found in plugins/assets/classes/yf_assets.class.php - About 3 hrs to fix

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

          public function show()
          {
              // TODO: show preview if file is image
              // TODO: doubleclick should edit file
              // TODO: buttons near eacj table row (edit/show revisions)
      Severity: Major
      Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 3 hrs to fix

        Method add has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function add($params = [])
            {
                if (is_string($params)) {
                    $params = ['table' => $params];
                }
        Severity: Major
        Found in plugins/sys/classes/yf_admin_methods.class.php - About 3 hrs to fix

          Method generate_up has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function generate_up($params = [])
              {
                  if ( ! isset($report)) {
                      $report = $this->compare($params);
                  }
          Severity: Major
          Found in plugins/db/classes/db/yf_db_migrator.class.php - About 3 hrs to fix

            Method render_type_slide has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function render_type_slide($params = [])
                {
                    $total_records = $params['total_records'];
                    $per_page = $params['per_page'];
                    $requested_page = $params['requested_page'];
            Severity: Major
            Found in plugins/common/classes/common/yf_divide_pages.class.php - About 3 hrs to fix

              Method _order_step_finish has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _order_step_finish($FORCE_DISPLAY_FORM = false)
                  {
                      module('shop')->_basket_api()->clean();
              
                      if (isset($_GET['page'])) {
              Severity: Major
              Found in plugins/shop/modules/shop/yf_shop__order_step_finish.class.php - About 3 hrs to fix

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

                            if ( ! $redirect_url) {
                                $request_uri = getenv('REQUEST_URI');
                                $cur_web_path = $request_uri[strlen($request_uri) - 1] == '/' ? substr($request_uri, 0, -1) : dirname($request_uri);
                                $redirect_url = 'https://' . getenv('HTTP_HOST') . str_replace(['\\', '//'], ['/', '/'], (MAIN_TYPE_ADMIN ? dirname($cur_web_path) : $cur_web_path) . '/');
                            }
                Severity: Major
                Found in plugins/auth/classes/auth/yf_auth_admin.class.php and 1 other location - About 3 hrs to fix
                plugins/auth/classes/auth/yf_auth_user.class.php on lines 307..311

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

                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

                            if ( ! $redirect_url) {
                                $request_uri = getenv('REQUEST_URI');
                                $cur_web_path = $request_uri[strlen($request_uri) - 1] == '/' ? substr($request_uri, 0, -1) : dirname($request_uri);
                                $redirect_url = 'https://' . getenv('HTTP_HOST') . str_replace(['\\', '//'], ['/', '/'], (MAIN_TYPE_ADMIN ? dirname($cur_web_path) : $cur_web_path) . '/');
                            }
                Severity: Major
                Found in plugins/auth/classes/auth/yf_auth_user.class.php and 1 other location - About 3 hrs to fix
                plugins/auth/classes/auth/yf_auth_admin.class.php on lines 176..180

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

                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 _get_methods_for_select($params = [])
                    {
                        $cache_name = 'admin_modules_for_select';
                        $data = cache_get($cache_name);
                        if ( ! $data) {
                Severity: Major
                Found in plugins/admin/admin_modules/yf_admin_modules.class.php and 1 other location - About 3 hrs to fix
                plugins/user/admin_modules/yf_user_modules.class.php on lines 436..454

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

                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 _get_methods_for_select($params = [])
                    {
                        $cache_name = 'user_modules_for_select';
                        $data = cache_get($cache_name);
                        if ( ! $data) {
                Severity: Major
                Found in plugins/user/admin_modules/yf_user_modules.class.php and 1 other location - About 3 hrs to fix
                plugins/admin/admin_modules/yf_admin_modules.class.php on lines 448..466

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

                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