TeaThemeOptions/TeaThemeOptions

View on GitHub
src/Resources/assets/js/code/code.js

Summary

Maintainability
B
6 hrs
Test Coverage

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

    $.fn.olCode = function (method){
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        }
        else if (typeof method === 'object' || !method) {
Severity: Major
Found in src/Resources/assets/js/code/code.js and 17 other locations - About 4 hrs to fix
src/Resources/assets/js/background/background.js on lines 123..134
src/Resources/assets/js/checkall/checkall.js on lines 107..118
src/Resources/assets/js/checkit/checkit.js on lines 88..99
src/Resources/assets/js/color/color.js on lines 109..120
src/Resources/assets/js/date/date.js on lines 80..91
src/Resources/assets/js/dragndrop/dragndrop.js on lines 102..113
src/Resources/assets/js/link/link.js on lines 165..176
src/Resources/assets/js/maps/maps.js on lines 273..284
src/Resources/assets/js/modal/modal.js on lines 99..110
src/Resources/assets/js/multiselect/multiselect.js on lines 140..151
src/Resources/assets/js/range/range.js on lines 74..85
src/Resources/assets/js/social/social.js on lines 234..245
src/Resources/assets/js/textarea/textarea.js on lines 78..89
src/Resources/assets/js/toggle/toggle.js on lines 76..87
src/Resources/assets/js/tooltip/tooltip.js on lines 277..288
src/Resources/assets/js/upload/upload.js on lines 261..272
src/Resources/assets/js/youtube/youtube.js on lines 192..203

Duplicated Code

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

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

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

Tuning

This issue has a mass of 127.

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

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

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

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

Refactorings

Further Reading

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

    OlCode.prototype.blurMode = function (e){
        var _ol = this;
        _ol.$el.parent().removeClass(_ol.options.focused);
    };
Severity: Major
Found in src/Resources/assets/js/code/code.js and 1 other location - About 1 hr to fix
src/Resources/assets/js/code/code.js on lines 86..89

Duplicated Code

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

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

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

Tuning

This issue has a mass of 58.

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

    OlCode.prototype.focusMode = function (e){
        var _ol = this;
        _ol.$el.parent().addClass(_ol.options.focused);
    };
Severity: Major
Found in src/Resources/assets/js/code/code.js and 1 other location - About 1 hr to fix
src/Resources/assets/js/code/code.js on lines 81..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 58.

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

There are no issues that match your filters.

Category
Status