Showing 971 of 4,218 total issues

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

        if ( ! $shard_table_name && $this->SHARDING_BY_COUNTRY) {
            $name = $table_name;
            $shard_country = substr($name, -strlen('es'));
            $has_divider = (substr($name, -strlen('_es'), 1) === '_');
            if ($has_divider && preg_match('/[a-z]{2}/', $shard_country)) {
Severity: Major
Found in plugins/db/classes/db/yf_db_installer.class.php and 1 other location - About 2 hrs to fix
plugins/db/classes/db/yf_db_installer.class.php on lines 287..294

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

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

  6 => [
    'id' => '6',
    'id2' => '1',
    'user_name' => 'odlman',
    'user_id' => '5',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  3 => [
    'id' => '3',
    'id2' => '1',
    'user_name' => 'kingargyle',
    'user_id' => '6',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  2 => [
    'id' => '2',
    'id2' => '1',
    'user_name' => 'kingargyle',
    'user_id' => '6',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  1 => [
    'id' => '1',
    'id2' => '1',
    'user_name' => 'test',
    'user_id' => '1',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  7 => [
    'id' => '7',
    'id2' => '1',
    'user_name' => 'kingargyle',
    'user_id' => '6',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  4 => [
    'id' => '4',
    'id2' => '1',
    'user_name' => 'odlman',
    'user_id' => '5',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  8 => [
    'id' => '8',
    'id2' => '1',
    'user_name' => 'serega',
    'user_id' => '4',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  6 => [
    'id' => '6',
    'id2' => '1',
    'user_name' => 'serega',
    'user_id' => '4',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  7 => [
    'id' => '7',
    'id2' => '1',
    'user_name' => 'serega',
    'user_id' => '4',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  5 => [
    'id' => '5',
    'id2' => '1',
    'user_name' => 'kingargyle',
    'user_id' => '6',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 90..124

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

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

  9 => [
    'id' => '9',
    'id2' => '1',
    'user_name' => 'kingargyle',
    'user_id' => '6',
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 4..41
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 42..97
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 98..141
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 142..179
.dev/install/installer_data/db_tables_en/blog_posts.data.php on lines 180..213
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 4..35
.dev/install/installer_data/db_tables_ru/blog_posts.data.php on lines 36..87
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 4..34
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 35..60
.dev/install/installer_data/db_tables_uk/blog_posts.data.php on lines 61..89

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function test_matches()
    {
        $this->assertFalse(_class('validate')->matches('', ['param' => 'my_field']));
        $_POST['my_field'] = '55';
        $this->assertFalse(_class('validate')->matches('', ['param' => 'my_field'], ['my_field' => '55']));
Severity: Major
Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 2 hrs to fix
.dev/tests/unit/class_validate_test.Test.php on lines 135..141

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

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 ($this->INLINE_ASSETS_USE_DATA_URI && $content_type === 'inline') {
                $content_type = 'url';
                $params['href'] = 'data:' . $params['type'] . ';base64,' . base64_encode($this->_strip_css_input($str));
            } elseif ($this->FILE_ASSETS_USE_DATA_URI && strlen($str) <= $this->FILE_ASSETS_DATA_URI_MAX_SIZE) {
                $content_type = 'url';
Severity: Major
Found in plugins/assets/classes/yf_assets.class.php and 1 other location - About 2 hrs to fix
plugins/assets/classes/yf_assets.class.php on lines 2133..2139

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function test_differs()
    {
        $this->assertTrue(_class('validate')->differs('', ['param' => 'my_field']));
        $_POST['my_field'] = '55';
        $this->assertTrue(_class('validate')->differs('', ['param' => 'my_field'], ['my_field' => '55']));
Severity: Major
Found in .dev/tests/unit/class_validate_test.Test.php and 1 other location - About 2 hrs to fix
.dev/tests/unit/class_validate_test.Test.php on lines 128..134

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

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 ($this->INLINE_ASSETS_USE_DATA_URI && $content_type === 'inline') {
                $content_type = 'url';
                $params['src'] = 'data:' . $params['type'] . ';base64,' . base64_encode($this->_strip_js_input($str));
            } elseif ($this->FILE_ASSETS_USE_DATA_URI && strlen($str) <= $this->FILE_ASSETS_DATA_URI_MAX_SIZE) {
                $content_type = 'url';
Severity: Major
Found in plugins/assets/classes/yf_assets.class.php and 1 other location - About 2 hrs to fix
plugins/assets/classes/yf_assets.class.php on lines 2164..2170

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

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

            var _value = ( $scope.action.payout &&
                $scope.action.payout.method &&
                $scope.action.payout.method.amount &&
                $scope.action.payout.method.amount.min
            ) || 0;
plugins/content/templates/user/js/ng/payment/balance-recharge.js on lines 133..137

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

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

            var _value = ( $scope.action.payout &&
                $scope.action.payout.method &&
                $scope.action.payout.method.amount &&
                $scope.action.payout.method.amount.max
            ) || 0;
plugins/content/templates/user/js/ng/payment/balance-recharge.js on lines 106..110

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

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

        foreach ((array) $values as $key => $cur_value) {
            $_what_compare = (string) ($type == 1 ? $cur_value : $key);
            $is_selected = $_what_compare == $selected;
            $val = $translate ? t($cur_value) : $cur_value;
            $items[] = '<li class="dropdown' . ($is_selected ? ' active' : '') . '"><a data-value="' . $key . '"' . ($is_selected ? ' data-selected="selected"' : '') . '>' . $val . '</a></li>';
Severity: Major
Found in plugins/html/classes/yf_html.class.php and 1 other location - About 2 hrs to fix
plugins/html/classes/yf_html.class.php on lines 1446..1454

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

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 _get_conf($name, $default = null, array $params = [])
    {
        if (isset($params[$name]) && $val = $params[$name]) {
            return $val;
        }
plugins/cache/classes/cache/yf_cache_driver_redis.class.php on lines 33..48

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

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