mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

    next : function() {
        if ( this.getDataLength() > 1 ) {
            this.show( this.getNext(), false );
        }
        return this;
Severity: Major
Found in assets/js/galleria/galleria-1.3.5.js and 5 other locations - About 50 mins to fix
assets/js/galleria/galleria-1.1.js on lines 2841..2846
assets/js/galleria/galleria-1.1.js on lines 2854..2859
assets/js/galleria/galleria-1.3.3.js on lines 5169..5174
assets/js/galleria/galleria-1.3.3.js on lines 5182..5187
assets/js/galleria/galleria-1.3.5.js on lines 5203..5208

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

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

    prev : function() {
        if ( this.getDataLength() > 1 ) {
            this.show( this.getPrev(), true );
        }
        return this;
Severity: Major
Found in assets/js/galleria/galleria-1.3.5.js and 5 other locations - About 50 mins to fix
assets/js/galleria/galleria-1.1.js on lines 2841..2846
assets/js/galleria/galleria-1.1.js on lines 2854..2859
assets/js/galleria/galleria-1.3.3.js on lines 5169..5174
assets/js/galleria/galleria-1.3.3.js on lines 5182..5187
assets/js/galleria/galleria-1.3.5.js on lines 5190..5195

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

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

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

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

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

Refactorings

Further Reading

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

    if ($('#magnific_type').val() == 'popup' && $('#fsID').val() === '') {
        ccm_addError(ccm_t('gallery-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..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 52.

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

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

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

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

Refactorings

Further Reading

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

    if ($('#magnific_type').val() == 'vidMap' && $('#vidMapURL').val() === '') {
        ccm_addError(ccm_t('url-requried'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..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 52.

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

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

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

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

Refactorings

Further Reading

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

    if ($('#magnific_type').val() == 'vidMap' && $('#vidMapLinkText').val() === '') {
        ccm_addError(ccm_t('link-text-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..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 52.

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

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

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

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

Refactorings

Further Reading

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

    if ($('#magnific_type').val() == 'cssdialog' && $('#cssDialogLinkText').val() === '') {
        ccm_addError(ccm_t('dialog-link-text-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..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 52.

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

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

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

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

Refactorings

Further Reading

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

    if ($('#magnific_type').val() == 'cssdialog' && $('#cssDialogText').val() === '') {
        ccm_addError(ccm_t('dialog-text-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..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 52.

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

    prev : function() {
        if ( this.getDataLength() > 1 ) {
            this.show( this.getPrev(), true );
        }
        return this;
Severity: Major
Found in assets/js/galleria/galleria-1.1.js and 5 other locations - About 50 mins to fix
assets/js/galleria/galleria-1.1.js on lines 2841..2846
assets/js/galleria/galleria-1.3.3.js on lines 5169..5174
assets/js/galleria/galleria-1.3.3.js on lines 5182..5187
assets/js/galleria/galleria-1.3.5.js on lines 5190..5195
assets/js/galleria/galleria-1.3.5.js on lines 5203..5208

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

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

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

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

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

Refactorings

Further Reading

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

    if ($('#magnific_type').val() == 'cssdialog' && $('#dialogType').val() == 'choose') {
        ccm_addError(ccm_t('dialog-type-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81

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

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

    prev : function() {
        if ( this.getDataLength() > 1 ) {
            this.show( this.getPrev(), true );
        }
        return this;
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js and 5 other locations - About 50 mins to fix
assets/js/galleria/galleria-1.1.js on lines 2841..2846
assets/js/galleria/galleria-1.1.js on lines 2854..2859
assets/js/galleria/galleria-1.3.3.js on lines 5169..5174
assets/js/galleria/galleria-1.3.5.js on lines 5190..5195
assets/js/galleria/galleria-1.3.5.js on lines 5203..5208

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

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

    next : function() {
        if ( this.getDataLength() > 1 ) {
            this.show( this.getNext(), false );
        }
        return this;
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js and 5 other locations - About 50 mins to fix
assets/js/galleria/galleria-1.1.js on lines 2841..2846
assets/js/galleria/galleria-1.1.js on lines 2854..2859
assets/js/galleria/galleria-1.3.3.js on lines 5182..5187
assets/js/galleria/galleria-1.3.5.js on lines 5190..5195
assets/js/galleria/galleria-1.3.5.js on lines 5203..5208

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

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 ($('#magnific_type').val() == 'zoom' && $("#ccm-b-image-fm-value").val() === 0) {
        ccm_addError(ccm_t('image-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 55..57

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

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 ($('#magnific_type').val() == 'single' && $("#ccm-b-image-fm-value").val() === 0) {
        ccm_addError(ccm_t('image-required'));
    }
assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 64..66

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

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 (0 == $cat->getVar('cat_nb_photo')) {
                    $criteria = new \CriteriaCompo();
                    $criteria->add(new \Criteria('nleft', $cat->getVar('nleft'), '<'));
                    $criteria->add(new \Criteria('nright', $cat->getVar('nright'), '>'));
                    $catHandler->updateFieldValue('cat_nb_album', 'cat_nb_album + 1', $criteria);
Severity: Major
Found in admin/photo.php and 3 other locations - About 50 mins to fix
admin/photo.php on lines 242..247
public-modify.php on lines 86..91
public-modify.php on lines 93..98

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

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 (0 == $newCat->getVar('cat_nb_photo')) {
                        $criteria = new \CriteriaCompo();
                        $criteria->add(new \Criteria('nleft', $newCat->getVar('nleft'), '<'));
                        $criteria->add(new \Criteria('nright', $newCat->getVar('nright'), '>'));
                        $catHandler->updateFieldValue('cat_nb_album', 'cat_nb_album + 1', $criteria);
Severity: Major
Found in public-modify.php and 3 other locations - About 50 mins to fix
admin/photo.php on lines 183..188
admin/photo.php on lines 242..247
public-modify.php on lines 86..91

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

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 (0 == $cat->getVar('cat_nb_photo')) {
                    $criteria = new \CriteriaCompo();
                    $criteria->add(new \Criteria('nleft', $cat->getVar('nleft'), '<'));
                    $criteria->add(new \Criteria('nright', $cat->getVar('nright'), '>'));
                    $catHandler->updateFieldValue('cat_nb_album', 'cat_nb_album + 1', $criteria);
Severity: Major
Found in admin/photo.php and 3 other locations - About 50 mins to fix
admin/photo.php on lines 183..188
public-modify.php on lines 86..91
public-modify.php on lines 93..98

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

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 (1 == $oldCat->getVar('cat_nb_photo')) {
                        $criteria = new \CriteriaCompo();
                        $criteria->add(new \Criteria('nleft', $oldCat->getVar('nleft'), '<'));
                        $criteria->add(new \Criteria('nright', $oldCat->getVar('nright'), '>'));
                        $catHandler->updateFieldValue('cat_nb_album', 'cat_nb_album - 1', $criteria);
Severity: Major
Found in public-modify.php and 3 other locations - About 50 mins to fix
admin/photo.php on lines 183..188
admin/photo.php on lines 242..247
public-modify.php on lines 93..98

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

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

The parameter $entity_type is not named in camelCase.
Open

function magnific_popup_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
  // Items are some kind of entity reference, be it via image or file type.
  // Load the corresponding items into a common format for our formatter_view().
  $static = &drupal_static(__FUNCTION__, ['loaded_items' => [], 'thumbnail_schemes' => NULL]);
  $loaded_items = &$static['loaded_items'];

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Avoid variables with short names like $i. Configured minimum length is 3.
Open

                        $i = 1;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The parameter $image_height is not named in camelCase.
Open

    private function get_crop_dimensions($image_width, $image_height)
    {
        if ('false' === $this->smart_crop) {
            return ['width' => $this->container_width, 'height' => $this->container_height];
        }

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Severity
Category
Status
Source
Language