mambax7/wflinks

View on GitHub

Showing 46 of 201 total issues

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

        if ($helper->getConfig('useaddress')) {
            $googlemap = ('http://maps.google.com' !== $_POST['googlemap']) ? $myts->addSlashes($_POST['googlemap']) : '';
            $yahoomap  = ('http://maps.yahoo.com' !== $_POST['yahoomap']) ? $myts->addSlashes($_POST['yahoomap']) : '';
            $multimap  = ('http://www.multimap.com' !== $_POST['multimap']) ? $myts->addSlashes($_POST['multimap']) : '';
            $street1   = $myts->addSlashes(trim($_POST['street1']));
Severity: Major
Found in admin/main.php and 1 other location - About 2 days to fix
submit.php on lines 54..71

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

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 ($helper->getConfig('useaddress')) {
            $googlemap = ('http://maps.google.com' !== $_POST['googlemap']) ? $myts->addSlashes($_POST['googlemap']) : '';
            $yahoomap  = ('http://maps.yahoo.com' !== $_POST['yahoomap']) ? $myts->addSlashes($_POST['yahoomap']) : '';
            $multimap  = ('http://www.multimap.com' !== $_POST['multimap']) ? $myts->addSlashes($_POST['multimap']) : '';
            $street1   = $myts->addSlashes(ltrim($_REQUEST['street1']));
Severity: Major
Found in submit.php and 1 other location - About 2 days to fix
admin/main.php on lines 501..518

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

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 ('clone' === $op) {
    xoops_cp_header();
    $myblock = new \XoopsBlock($bid);

    $db      = \XoopsDatabaseFactory:: getDatabaseConnection();
Severity: Major
Found in include/blocksadmin.inc.php and 1 other location - About 1 day to fix
include/blocksadmin.inc.php on lines 282..322

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

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 ('edit' === $op) {
    xoops_cp_header();
    // edit_block($bid); GIJ imported from blocksadmin.php
    $myblock = new \XoopsBlock($bid);

Severity: Major
Found in include/blocksadmin.inc.php and 1 other location - About 1 day to fix
include/blocksadmin.inc.php on lines 324..361

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 387.

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 (!defined('XOOPS_ORETEKI') && '' !== $block['template']) {
        /** @var \XoopsTplfileHandler $tplfileHandler */
        $tplfileHandler = xoops_getHandler('tplfile');
        $btemplate      = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
        if (count($btemplate) > 0) {
Severity: Major
Found in admin/myblockform.php and 1 other location - About 7 hrs to fix
admin/blockform.php on lines 71..84

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

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 ('' !== $block['template']) {
        /** @var \XoopsTplfileHandler $tplfileHandler */
        $tplfileHandler = xoops_getHandler('tplfile');
        /** @var \XoopsTplfile[] $btemplate */
        $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']);
Severity: Major
Found in admin/blockform.php and 1 other location - About 7 hrs to fix
admin/myblockform.php on lines 61..73

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

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

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

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

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

Refactorings

Further Reading

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

if ($block['is_custom']) {
    $textarea = new \XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70);
    $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . _AM_SYSTEM_BLOCKS_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>');
    $form->addElement($textarea, true);
    $ctype_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']);
Severity: Major
Found in admin/blockform.php and 1 other location - About 4 hrs to fix
admin/myblockform.php on lines 53..77

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

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

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

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

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

Refactorings

Further Reading

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

if ($block['is_custom']) {
    $textarea = new \XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70);
    $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . _AM_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>');
    $form->addElement($textarea, true);
    $ctype_select = new \XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']);
Severity: Major
Found in admin/myblockform.php and 1 other location - About 4 hrs to fix
admin/blockform.php on lines 56..88

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

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 (class_exists('XoopsFormEditor')) {
        $options['name']   = 'descriptionb';
        $options['value']  = $descriptionb;
        $options['rows']   = 5;
        $options['cols']   = '100%';
Severity: Major
Found in admin/main.php and 1 other location - About 4 hrs to fix
submit.php on lines 296..308

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

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 (class_exists('XoopsFormEditor')) {
            $options['name']   = 'descriptionb';
            $options['value']  = $descriptionb;
            $options['rows']   = 5;
            $options['cols']   = '100%';
Severity: Major
Found in submit.php and 1 other location - About 4 hrs to fix
admin/main.php on lines 155..167

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

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

    } elseif ('Malaysia' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $zip . '&nbsp;' . $town . ',&nbsp;' . $state;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Romania' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $zip . '&nbsp;' . $town . '<br>' . $state;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Gibraltar' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . '<br>' . $state . '<br>' . $zip;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Cambodia' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . '<br>' . $state . '&nbsp;' . $zip;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Jersey' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . '<br>' . $state . '<br>' . $zip;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('China' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $zip . '&nbsp;' . $town . '<br>' . $state;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Isle of Man' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . '<br>' . $state . '<br>' . $zip;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Korea (South)' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . '<br>' . $state . ',&nbsp;' . $zip;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 1082..1094

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

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

    } elseif ('Nigeria' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . '&nbsp;' . $zip . '<br>' . $state;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 38..50
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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

    } elseif ('Australia' === $country) {
        if ($street2) {
            if ($state) {
                $address = $street1 . '<br>' . $street2 . '<br>' . $town . ',&nbsp;' . $state . '&nbsp;' . $zip;
            } else {
Severity: Major
Found in include/address.php and 13 other locations - About 3 hrs to fix
include/address.php on lines 170..182
include/address.php on lines 188..200
include/address.php on lines 200..212
include/address.php on lines 230..242
include/address.php on lines 434..446
include/address.php on lines 530..542
include/address.php on lines 566..578
include/address.php on lines 668..680
include/address.php on lines 698..710
include/address.php on lines 800..812
include/address.php on lines 890..902
include/address.php on lines 974..986
include/address.php on lines 1082..1094

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

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