imagecms/ImageCMS

View on GitHub

Showing 470 of 1,858 total issues

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

        if ( options.my[ 1 ] === "bottom" ) {
            position.top -= elemHeight;
        } else if ( options.my[ 1 ] === "center" ) {
            position.top -= elemHeight / 2;
        }
application/modules/admin_menu/assets/js/context_menu/jquery.ui.position.js on lines 180..184
application/modules/admin_menu/assets/js/context_menu/jquery.ui.position.js on lines 186..190
application/modules/admin_menu/assets/js/context_menu/jquery.ui.position.js on lines 208..212

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

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

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

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

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

Refactorings

Further Reading

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

    public function setId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }
application/modules/xbanners/models/Base/BannerImage.php on lines 530..546
application/modules/xbanners/models/Base/BannersI18n.php on lines 374..390

Duplicated Code

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

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

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

Tuning

This issue has a mass of 110.

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

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

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

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

Refactorings

Further Reading

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

    public function setBannerId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannerImage.php and 2 other locations - About 1 hr to fix
application/modules/xbanners/models/Base/BannerImageI18n.php on lines 425..441
application/modules/xbanners/models/Base/BannersI18n.php on lines 374..390

Duplicated Code

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

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

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

Tuning

This issue has a mass of 110.

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

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

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

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

Refactorings

Further Reading

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

    public function setId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannersI18n.php and 2 other locations - About 1 hr to fix
application/modules/xbanners/models/Base/BannerImage.php on lines 530..546
application/modules/xbanners/models/Base/BannerImageI18n.php on lines 425..441

Duplicated Code

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

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

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

Tuning

This issue has a mass of 110.

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

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

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

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

Refactorings

Further Reading

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

    public function getPages($type, $locale = NULL) {
        $locale = $locale ? $locale : \MY_Controller::defaultLocale();
        $type = $this->getPagesTypes($type);

        if (!$type OR !$type['class'] OR !class_exists($type['class'])) {
application/modules/xbanners/src/Managers/BannerPageTypesManager.php on lines 81..92

Duplicated Code

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

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

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

Tuning

This issue has a mass of 110.

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

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

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

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

Refactorings

Further Reading

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

    public function getView($type, $locale = NULL) {
        $locale = $locale ? $locale : \MY_Controller::defaultLocale();
        $type = $this->getPagesTypes($type);

        if (!$type OR !$type['class'] OR !class_exists($type['class'])) {
application/modules/xbanners/src/Managers/BannerPageTypesManager.php on lines 100..111

Duplicated Code

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

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

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

Tuning

This issue has a mass of 110.

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

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

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

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

Refactorings

Further Reading

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

                if ($this->input->post('page_hidden')) {
                    $hidden = $this->input->post('page_hidden');
                } elseif ($this->input->post('cat_hidden')) {
                    $hidden = $this->input->post('cat_hidden');
                } elseif ($this->input->post('module_hidden')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 209..217
application/modules/menu/admin.php on lines 537..545
application/modules/menu/admin.php on lines 574..582
application/modules/menu/admin.php on lines 583..591
application/modules/menu/admin.php on lines 592..600
application/modules/menu/admin.php on lines 601..609

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

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

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

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

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

Refactorings

Further Reading

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

                if ($this->input->post('page_newpage')) {
                    $newpage = $this->input->post('page_newpage');
                } elseif ($this->input->post('cat_newpage')) {
                    $newpage = $this->input->post('cat_newpage');
                } elseif ($this->input->post('module_newpage')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 187..195
application/modules/menu/admin.php on lines 209..217
application/modules/menu/admin.php on lines 537..545
application/modules/menu/admin.php on lines 574..582
application/modules/menu/admin.php on lines 583..591
application/modules/menu/admin.php on lines 592..600

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

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 ($priorities) {
            $this->main_page_priority = $priorities['main_page_priority'];
            $this->cats_priority = $priorities['cats_priority'];
            $this->pages_priority = $priorities['pages_priority'];
            $this->sub_cats_priority = $priorities['sub_cats_priority'];
Severity: Major
Found in application/modules/sitemap/sitemap.php and 1 other location - About 1 hr to fix
application/modules/sitemap/sitemap.php on lines 290..299

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

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

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

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

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

Refactorings

Further Reading

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

                if ($this->input->post('page_hidden')) {
                    $hidden = $this->input->post('page_hidden');
                } elseif ($this->input->post('cat_hidden')) {
                    $hidden = $this->input->post('cat_hidden');
                } elseif ($this->input->post('module_hidden')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 187..195
application/modules/menu/admin.php on lines 209..217
application/modules/menu/admin.php on lines 537..545
application/modules/menu/admin.php on lines 583..591
application/modules/menu/admin.php on lines 592..600
application/modules/menu/admin.php on lines 601..609

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

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

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

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

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

Refactorings

Further Reading

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

                if ($this->input->post('page_parent_id')) {
                    $parent_id = $this->input->post('page_parent_id');
                } elseif ($this->input->post('cat_parent_id')) {
                    $parent_id = $this->input->post('cat_parent_id');
                } elseif ($this->input->post('module_parent_id')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 187..195
application/modules/menu/admin.php on lines 209..217
application/modules/menu/admin.php on lines 537..545
application/modules/menu/admin.php on lines 574..582
application/modules/menu/admin.php on lines 583..591
application/modules/menu/admin.php on lines 601..609

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

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

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

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

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

Refactorings

Further Reading

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

                if ($this->input->post('page_newpage')) {
                    $newpage = $this->input->post('page_newpage');
                } elseif ($this->input->post('cat_newpage')) {
                    $newpage = $this->input->post('cat_newpage');
                } elseif ($this->input->post('module_newpage')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 187..195
application/modules/menu/admin.php on lines 537..545
application/modules/menu/admin.php on lines 574..582
application/modules/menu/admin.php on lines 583..591
application/modules/menu/admin.php on lines 592..600
application/modules/menu/admin.php on lines 601..609

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

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 ($changfreq) {
            $this->main_page_changefreq = $changfreq['main_page_changefreq'];
            $this->categories_changefreq = $changfreq['categories_changefreq'];
            $this->products_categories_changefreq = $changfreq['products_categories_changefreq'];
            $this->products_sub_categories_changefreq = $changfreq['products_sub_categories_changefreq'];
Severity: Major
Found in application/modules/sitemap/sitemap.php and 1 other location - About 1 hr to fix
application/modules/sitemap/sitemap.php on lines 278..287

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

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

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

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

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

Refactorings

Further Reading

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

            if ($this->input->post('page_item_type')) {
                $item_type = $this->input->post('page_item_type');
            } elseif ($this->input->post('cat_item_type')) {
                $item_type = $this->input->post('cat_item_type');
            } elseif ($this->input->post('module_item_type')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 187..195
application/modules/menu/admin.php on lines 209..217
application/modules/menu/admin.php on lines 574..582
application/modules/menu/admin.php on lines 583..591
application/modules/menu/admin.php on lines 592..600
application/modules/menu/admin.php on lines 601..609

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

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 prune($bannerImageI18n = null)
    {
        if ($bannerImageI18n) {
            $this->addCond('pruneCond0', $this->getAliasedColName(BannerImageI18nTableMap::COL_ID), $bannerImageI18n->getId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(BannerImageI18nTableMap::COL_LOCALE), $bannerImageI18n->getLocale(), Criteria::NOT_EQUAL);
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 446..455

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

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

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

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

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

Refactorings

Further Reading

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

                if ($this->input->post('page_item_image')) {
                    $image = $this->input->post('page_item_image');
                } elseif ($this->input->post('cat_item_image')) {
                    $image = $this->input->post('cat_item_image');
                } elseif ($this->input->post('module_item_image')) {
Severity: Major
Found in application/modules/menu/admin.php and 6 other locations - About 1 hr to fix
application/modules/menu/admin.php on lines 187..195
application/modules/menu/admin.php on lines 209..217
application/modules/menu/admin.php on lines 537..545
application/modules/menu/admin.php on lines 574..582
application/modules/menu/admin.php on lines 592..600
application/modules/menu/admin.php on lines 601..609

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

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

        if (iconv_strlen($wlDescription, 'UTF-8') > $this->settings['maxWLDescLenght']) {
            $wlDescription = mb_substr($wlDescription, 0, (int) $this->settings['maxWLDescLenght'], 'utf-8');
            $this->errors[] = lang('List description limit exhausted', 'wishlist') . '. ' . lang('List description max count', 'wishlist') . ' - ' . $this->settings['maxWLDescLenght'];
        }
Severity: Major
Found in application/modules/wishlist/classes/ParentWishlist.php and 3 other locations - About 1 hr to fix
application/modules/wishlist/classes/BaseApi.php on lines 243..246
application/modules/wishlist/classes/BaseWishlist.php on lines 200..203
application/modules/wishlist/classes/ParentWishlist.php on lines 408..411

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

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

        if (mb_strlen($listName, 'utf-8') > $this->settings['maxListName']) {
            $listName = mb_substr($listName, 0, (int) $this->settings['maxListName'], 'utf-8');
            $this->errors[] = lang('Wishlist name will be changed', 'wishlist') . '. ' . lang('Maximum length of wishlist name', 'wishlist') . ' - ' . $this->settings['maxListName'];
        }
Severity: Major
Found in application/modules/wishlist/classes/ParentWishlist.php and 3 other locations - About 1 hr to fix
application/modules/wishlist/classes/BaseApi.php on lines 243..246
application/modules/wishlist/classes/BaseWishlist.php on lines 200..203
application/modules/wishlist/classes/ParentWishlist.php on lines 295..298

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

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

        if (iconv_strlen($wlDescription, 'UTF-8') > $this->settings['maxWLDescLenght']) {
            $wlDescription = mb_substr($wlDescription, 0, (int) $this->settings['maxWLDescLenght'], 'utf-8');
            $this->errors[] = lang('List description limit exhausted', 'wishlist') . '. ' . lang('List description max count', 'wishlist') . ' - ' . $this->settings['maxWLDescLenght'];
        }
Severity: Major
Found in application/modules/wishlist/classes/BaseApi.php and 3 other locations - About 1 hr to fix
application/modules/wishlist/classes/BaseWishlist.php on lines 200..203
application/modules/wishlist/classes/ParentWishlist.php on lines 295..298
application/modules/wishlist/classes/ParentWishlist.php on lines 408..411

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

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 prune($bannersI18n = null)
    {
        if ($bannersI18n) {
            $this->addCond('pruneCond0', $this->getAliasedColName(BannersI18nTableMap::COL_ID), $bannersI18n->getId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(BannersI18nTableMap::COL_LOCALE), $bannersI18n->getLocale(), Criteria::NOT_EQUAL);
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 552..561

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

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