Showing 4,217 of 4,217 total issues

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

        return table($sql, [
                'no_header' => 1,
                'btn_no_text' => 1,
                'no_records_simple' => 1,
                'no_pages' => 1,
plugins/shop/admin_modules/manage_shop/yf_manage_shop_hook_widgets.class.php on lines 23..34

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

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

<?php

require_once __DIR__ . '/class_db_real_installer_pgsql_test.Test.php';

/**
.dev/tests/functional/db/class_db_real_installer_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pgsql.TODO.php on lines 1..22

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

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

            $html_operations_log = table($data, ['no_total' => true])
                ->text('operation_id', 'операция')
                ->func('options', function ($value, $extra, $row) {
                    $direction = &$row['direction'];
                    switch ($direction) {
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_transfer.class.php and 6 other locations - About 1 hr to fix
plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..413
plugins/payment/admin_modules/yf_manage_payment.class.php on lines 332..373
plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 325..419
plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..515
plugins/payment/admin_modules/yf_manage_payout.class.php on lines 1127..1142
plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 281..355

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

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

<?php

require_once __DIR__ . '/class_db_real_query_builder_pgsql_test.Test.php';

/**
.dev/tests/functional/db/class_db_real_installer_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_installer_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pgsql.TODO.php on lines 1..22

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

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

<?php

require_once __DIR__ . '/class_db_real_query_builder_mysql_test.Test.php';

/**
.dev/tests/functional/db/class_db_real_installer_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_installer_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_pdo_mysql_test.Test.php on lines 1..25
.dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pdo_pgsql.TODO.php on lines 1..25
.dev/tests/functional/db/class_db_real_query_builder_pgsql.TODO.php on lines 1..22

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

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

        if (is_post()) {
            foreach ((array) $keys_to_fix as $k) {
                if (false !== strpos($_POST[$k], '{') && false !== strpos($_POST[$k], '}')) {
                    $_POST[$k] = str_replace(array_values($exec_fix), array_keys($exec_fix), $_POST[$k]);
                }
plugins/content/admin_modules/yf_manage_faq.class.php on lines 167..173
plugins/content/admin_modules/yf_manage_news.class.php on lines 73..79

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

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

                $sql_array = [
                    'code' => $this->_cleanup_code($_POST['code']),
                    'user_id' => (int) ($_POST['user_id']),
                    'sum' => (int) ($_POST['sum']),
                    'status' => (int) ($_POST['status']),
plugins/shop/admin_modules/manage_shop/yf_manage_shop_coupons.class.php on lines 67..76

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

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

            'manufacturers' => function ($filter_name, $replace) {
                $fields = ['id', 'name', 'add_date'];
                foreach ((array) $fields as $v) {
                    $order_fields[$v] = $v;
                }
plugins/shop/admin_modules/manage_shop/yf_manage_shop_filter.class.php on lines 122..130
plugins/shop/admin_modules/manage_shop/yf_manage_shop_filter.class.php on lines 141..149

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

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

        return table($sql, [
                'no_header' => 1,
                'btn_no_text' => 1,
                'no_records_simple' => 1,
                'no_pages' => 1,
plugins/shop/admin_modules/manage_shop/yf_manage_shop_hook_widgets.class.php on lines 58..69

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

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

            'suppliers' => function ($filter_name, $replace) {
                $fields = ['id', 'name', 'add_date'];
                foreach ((array) $fields as $v) {
                    $order_fields[$v] = $v;
                }
plugins/shop/admin_modules/manage_shop/yf_manage_shop_filter.class.php on lines 113..121
plugins/shop/admin_modules/manage_shop/yf_manage_shop_filter.class.php on lines 141..149

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

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

            'attributes' => function ($filter_name, $replace) {
                $fields = ['id', 'title', 'add_date'];
                foreach ((array) $fields as $v) {
                    $order_fields[$v] = $v;
                }
plugins/shop/admin_modules/manage_shop/yf_manage_shop_filter.class.php on lines 113..121
plugins/shop/admin_modules/manage_shop/yf_manage_shop_filter.class.php on lines 122..130

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

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

    public function media_objects($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 carousel has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

          public function _init()
          {
              // class
              $this->payment_api = _class('payment_api');
              $this->manage_payment_lib = module('manage_payment_lib');
      Severity: Minor
      Found in plugins/payment/admin_modules/yf_manage_payment_operation.class.php - About 1 hr to fix

        Method transaction has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function transaction()
            {
                $payment_api = _class('payment_api');
                // var
                $result = [];
        Severity: Minor
        Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

          Method _confirmation_update_expired has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _confirmation_update_expired()
              {
                  // var
                  $payment_api = _class('payment_api');
                  // update status only in_progress
          Severity: Minor
          Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

            Method _form has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _form($data, $options = null)
                {
                    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 mass_payout has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function mass_payout($options = null)
                  {
                      $operation_id = $this->_get_operation_id($options);
                      is_numeric($operation_id) && $operation_id = [$operation_id => 1];
                      if ( ! is_array($operation_id)) {
              Severity: Minor
              Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr to fix

                Method _form has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Method _form has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _form($data, $options = null)
                      {
                          if ( ! $this->ENABLE) {
                              return  null;
                          }
                    Severity
                    Category
                    Status
                    Source
                    Language