Showing 971 of 4,218 total issues

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

        return form($r, [
                'selected' => $_SESSION[$filter_name],
                'class' => 'form-vertical',
            ])
            ->text('name')
Severity: Major
Found in plugins/geo/admin_modules/yf_manage_regions.class.php and 1 other location - About 1 hr to fix
plugins/geo/admin_modules/yf_manage_countries.class.php on lines 108..116

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

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

        } elseif ($A['receiver_type'] == 'user_id') {
            $table = table('SELECT * FROM ' . db('notifications_receivers') . ' WHERE `notification_id`=' . (int) ($_GET['id']))
                ->text('receiver_id')
                ->text('is_read')

plugins/notifications/admin_modules/yf_manage_notifications.class.php on lines 111..117

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

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 ($params['admin_host']) {
                    $_host = $params['admin_host'];
                    $_port = $params['admin_port'] ?: '80';
                    $_path = $params['admin_path'] ?: '/admin/';
                    $link = $this->_correct_protocol($http_protocol . '://' . $_host . ($_port && ! in_array($_port, ['80', '443']) ? ':' . $_port : '') . ($_path ?: '/') . $u);
Severity: Major
Found in plugins/rewrite/classes/yf_rewrite.class.php and 1 other location - About 1 hr to fix
plugins/rewrite/classes/yf_rewrite.class.php on lines 409..414

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

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 form($r, [
                'selected' => $_SESSION[$filter_name],
                'class' => 'form-vertical',
            ])
            ->text('name')
Severity: Major
Found in plugins/geo/admin_modules/yf_manage_countries.class.php and 1 other location - About 1 hr to fix
plugins/geo/admin_modules/yf_manage_regions.class.php on lines 113..121

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

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

            } else {
                $_host = $params['host'];
                $_port = $params['port'] ?: '80';
                $_path = $params['path'] ?: '/';
                $link = $this->_correct_protocol($http_protocol . '://' . $_host . ($_port && ! in_array($_port, ['80', '443']) ? ':' . $_port : '') . ($_path ?: '/') . $u);
Severity: Major
Found in plugins/rewrite/classes/yf_rewrite.class.php and 1 other location - About 1 hr to fix
plugins/rewrite/classes/yf_rewrite.class.php on lines 397..408

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

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

            table($sql, [
                'filter' => $filter,
                'filter_params' => [
                    'user_id' => ['cond' => 'in', 'field' => 'u.id'],
                    'name' => 'like',
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_payment.class.php and 3 other locations - About 1 hr to fix
plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 352..404
plugins/payment/admin_modules/yf_manage_payment_operation.class.php on lines 325..374
plugins/payment/admin_modules/yf_manage_payout.class.php on lines 419..506

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

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]);
                }
Severity: Major
Found in plugins/content/admin_modules/yf_manage_faq.class.php and 2 other locations - About 1 hr to fix
plugins/content/admin_modules/yf_manage_news.class.php on lines 73..79
plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 103..109

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_mysql_test.Test.php';

/**
.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_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

<?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_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

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_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_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

            $content && $html_operations_by_method = table($content, ['no_total' => true])
                ->text('operation_id', 'операция')
                ->text('account_number', 'счет, номер карты, кошелек')
                ->func('amount', function ($value, $extra, $row) use ($payment_api) {
                    $result = $payment_api->money_html($value);
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_payout.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_transfer.class.php on lines 281..355
plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 619..654

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

        $result = table($sql, [
                'filter' => $filter,
                'filter_params' => [
                    'status_id' => function ($a) use ($payment_status_in_progress_id) {
                        $result = null;
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_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
plugins/payment/admin_modules/yf_manage_transfer.class.php on lines 619..654

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

<?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

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

<?php

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

/**
Severity: Major
Found in .dev/tests/functional/db/class_db_real_pdo_pgsql.TODO.php and 6 other locations - About 1 hr to fix
.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_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

<?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

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]);
                }
Severity: Major
Found in plugins/content/admin_modules/yf_manage_news.class.php and 2 other locations - About 1 hr to fix
plugins/content/admin_modules/yf_manage_faq.class.php on lines 167..173
plugins/static_pages/admin_modules/yf_static_pages.class.php on lines 103..109

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

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

        return  table($sql, [
                'filter' => $filter,
                'filter_params' => [
                    'status_id' => function ($a) use ($payment_status_in_progress_id) {
                        $result = null;
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 619..654

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

Severity
Category
Status
Source
Language