TeaThemeOptions/TeaThemeOptions

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

Summary

Maintainability
C
1 day
Test Coverage

Function youtube has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    OlYoutube.prototype.youtube = function (){
        var _ol = this;

        //build wrapper
        var $wrap = $(document.createElement('div')).css({
Severity: Major
Found in src/Resources/assets/js/youtube/youtube.js - About 2 hrs to fix

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

        $.fn.olYoutube = 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/youtube/youtube.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/code/code.js on lines 131..142
    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

    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

            var $cont = $(document.createElement('div')).addClass('yt-container').css({
                bottom: '0',
                left: '0',
                overflow: 'hidden',
                position: 'fixed',
    Severity: Major
    Found in src/Resources/assets/js/youtube/youtube.js and 1 other location - About 1 hr to fix
    src/Resources/assets/js/youtube/youtube.js on lines 90..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 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 2 locations. Consider refactoring.
    Open

            var $stripes = $(document.createElement('div')).addClass('yt-stripes').css({
                bottom: '0',
                left: '0',
                overflow: 'hidden',
                position: 'fixed',
    Severity: Major
    Found in src/Resources/assets/js/youtube/youtube.js and 1 other location - About 1 hr to fix
    src/Resources/assets/js/youtube/youtube.js on lines 80..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 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 2 locations. Consider refactoring.
    Open

            _ol.options.height = Math.ceil(_ol.options.width / _ol.options.ratio);
    Severity: Minor
    Found in src/Resources/assets/js/youtube/youtube.js and 1 other location - About 30 mins to fix
    src/Resources/assets/js/youtube/youtube.js on lines 158..158

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

    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

            _ol.options.height = Math.ceil(_ol.options.width / _ol.options.ratio);
    Severity: Minor
    Found in src/Resources/assets/js/youtube/youtube.js and 1 other location - About 30 mins to fix
    src/Resources/assets/js/youtube/youtube.js on lines 34..34

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

    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