Showing 971 of 4,218 total issues

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

    public function test_conf()
    {
        conf('unit_test_conf_item1', 'unit_val');
        $this->assertEquals('unit_val', self::_tpl('{conf( "unit_test_conf_item1" )}'));
        $this->assertEquals('unit_val', self::_tpl('{conf("unit_test_conf_item1" )}'));
Severity: Minor
Found in .dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php and 1 other location - About 40 mins to fix
.dev/tests/unit/tpl/tpl_driver_yf_core_test.Test.php on lines 252..259

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

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

            case 'https':
                // Note: Only works for PHP 4.3 compiled with OpenSSL.
                $port = isset($uri['port']) ? $uri['port'] : 443;
                $host = $uri['host'] . ($port != 443 ? ':' . $port : '');
                $fp = @fsockopen('ssl://' . $uri['host'], $port, $errno, $errstr, 20);
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.class.php and 1 other location - About 40 mins to fix
plugins/common/classes/common/yf_remote_files.class.php on lines 828..833

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

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 where_any($key, $op = '=', $query)
    {
        return $this->where_raw(
            $this->_escape_col_name($key) . ' ' . (in_array($op, ['=', '>', '<', '>=', '<=', '!=', '<>']) ? $op : '=') . ' ANY ' . $this->subquery($query)
        );
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php and 1 other location - About 40 mins to fix
plugins/db/classes/db/yf_db_query_builder_driver.class.php on lines 1316..1321

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

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_module_docs($name)
    {
        $docs_dir = YF_PATH . '.dev/docs/en/';
        $f = $docs_dir . $name . '.stpl';
        if (file_exists($f)) {
Severity: Minor
Found in plugins/sys/classes/yf_core_api.class.php and 1 other location - About 40 mins to fix
plugins/sys/classes/yf_core_api.class.php on lines 481..489

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

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

        return [
            ['yes_no_box', 'shop__sms_order_send', 'Send SMS to user when new order arrives'],
            ['yes_no_box', 'shop__sms_order_copy', 'Send SMS copy when new order arrives'],
            ['text',         'shop__sms_order_copy_to', 'Phone numbers to send SMS copy when new order arrives'],
            ['yes_no_box', 'shop__emails_all_send', 'Send emails'],
Severity: Minor
Found in plugins/shop/modules/yf_shop.class.php and 1 other location - About 40 mins to fix
plugins/assets/admin_modules/yf_manage_assets.class.php on lines 44..52

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

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

        $data = [
            'fields' => [
                'id' => ['name' => 'id', 'type' => 'int', 'length' => 10, 'unsigned' => true, 'nullable' => false, 'auto_inc' => true],
            ],
            'indexes' => [
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 544..551
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 562..569

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

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

        $used = [
           'quote' => [
                'title' => 'QUOTE',
                'css_top' => 'quotetop',
                'css_main' => 'quotemain',
Severity: Major
Found in plugins/common/classes/common/yf_text_highlight.class.php and 7 other locations - About 35 mins to fix
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        'url' => [
            'name' => 'url',
            'type' => 'varchar',
            'length' => 255,
            'decimals' => null,
Severity: Major
Found in plugins/shop/share/db/sql_php/shop_products.sql_php.php and 3 other locations - About 35 mins to fix
plugins/shop/share/db/sql_php/shop_manufacturers.sql_php.php on lines 35..49
plugins/shop/share/db/sql_php/shop_products.sql_php.php on lines 20..34
plugins/shop/share/db/sql_php/shop_products.sql_php.php on lines 125..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 92.

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

        $data = [
            'fields' => [
                'id' => ['name' => 'id', 'type' => 'int', 'length' => 10, 'unsigned' => true, 'nullable' => false, 'auto_inc' => true],
            ],
            'indexes' => [
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 544..551
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 580..587

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 503..508
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        $data = [
            '1' => ['id' => '1', 'id2' => '11', 'id3' => '111'],
            '2' => ['id' => '2', 'id2' => '22', 'id3' => '222'],
            '3' => ['id' => '3', 'id2' => '11', 'id3' => '222'],
            '4' => ['id' => '4', 'id2' => '22', 'id3' => '333'],
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 267..272
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 304..309
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 330..335
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 352..357
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 372..377
.dev/tests/functional/db/class_db_real_query_builder_mysql_test.Test.php on lines 447..452
plugins/common/classes/common/yf_text_highlight.class.php on lines 91..112

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

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

        $data = [
            'fields' => [
                'id' => ['name' => 'id', 'type' => 'int', 'length' => 10, 'unsigned' => true, 'nullable' => false, 'auto_inc' => true],
            ],
            'indexes' => [
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 562..569
.dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 580..587

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

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

    public function is_test($options = null)
    {
        $result = false;
        // import options
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
plugins/payment/classes/yf_payment_api__provider.class.php on lines 33..42

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

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

        'name' => [
            'name' => 'name',
            'type' => 'varchar',
            'length' => 64,
            'decimals' => null,
Severity: Major
Found in plugins/shop/share/db/sql_php/shop_manufacturers.sql_php.php and 3 other locations - About 35 mins to fix
plugins/shop/share/db/sql_php/shop_products.sql_php.php on lines 20..34
plugins/shop/share/db/sql_php/shop_products.sql_php.php on lines 35..49
plugins/shop/share/db/sql_php/shop_products.sql_php.php on lines 125..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 92.

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

        $this->assertEquals('<span class="my_stacked_class"><input name="name" type="text" id="name" class="form-control" placeholder="' . $desc . '" value="' . $r['name'] . '">' . PHP_EOL . '</span>', trim(form($r, ['no_form' => 1])->text('name', ['desc' => $desc, 'stacked' => ['class' => 'my_stacked_class']])));
Severity: Minor
Found in .dev/tests/unit/class_form_test.Test.php and 1 other location - About 35 mins to fix
.dev/tests/unit/class_form_test.Test.php on lines 545..545

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

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