autolab/Autolab

View on GitHub
app/assets/javascripts/jquery.jeditable.js

Summary

Maintainability
D
2 days
Test Coverage

Function editable has 233 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.editable = function(target, options) {
            
        if ('disable' == target) {
            $(this).data('disabled.editable', true);
            return;
Severity: Major
Found in app/assets/javascripts/jquery.jeditable.js - About 1 day to fix

    File jquery.jeditable.js has 363 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Jeditable - jQuery in place edit plugin
     *
     * Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul
     *
    Severity: Minor
    Found in app/assets/javascripts/jquery.jeditable.js - About 4 hrs to fix

      Function buttons has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      buttons : function(settings, original) {
                          var form = this;
                          if (settings.submit) {
                              /* if given html string use that */
                              if (settings.submit.match(/>$/)) {
      Severity: Minor
      Found in app/assets/javascripts/jquery.jeditable.js - About 1 hr to fix

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

                            if (settings.rows) {
                                textarea.attr('rows', settings.rows);
                            } else if (settings.height != "none") {
                                textarea.height(settings.height);
                            }
        Severity: Major
        Found in app/assets/javascripts/jquery.jeditable.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.jeditable.js on lines 478..482

        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

                            if (settings.cols) {
                                textarea.attr('cols', settings.cols);
                            } else if (settings.width != "none") {
                                textarea.width(settings.width);
                            }
        Severity: Major
        Found in app/assets/javascripts/jquery.jeditable.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.jeditable.js on lines 473..477

        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

                            if (settings.height != 'none') {
                                settings.height = 
                                    settings.autoheight ? $(self).height() : settings.height;
                            }
        Severity: Minor
        Found in app/assets/javascripts/jquery.jeditable.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/jquery.jeditable.js on lines 160..163

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

        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 (settings.width != 'none') {
                                settings.width = 
                                    settings.autowidth ? $(self).width()  : settings.width;
                            }
        Severity: Minor
        Found in app/assets/javascripts/jquery.jeditable.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/jquery.jeditable.js on lines 164..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 51.

        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

                var buttons  = $.editable.types[settings.type].buttons 
                            || $.editable.types['defaults'].buttons;
        Severity: Major
        Found in app/assets/javascripts/jquery.jeditable.js and 3 other locations - About 35 mins to fix
        app/assets/javascripts/jquery.jeditable.js on lines 87..88
        app/assets/javascripts/jquery.jeditable.js on lines 89..90
        app/assets/javascripts/jquery.jeditable.js on lines 91..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 47.

        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

                var content  = $.editable.types[settings.type].content 
                            || $.editable.types['defaults'].content;
        Severity: Major
        Found in app/assets/javascripts/jquery.jeditable.js and 3 other locations - About 35 mins to fix
        app/assets/javascripts/jquery.jeditable.js on lines 85..86
        app/assets/javascripts/jquery.jeditable.js on lines 89..90
        app/assets/javascripts/jquery.jeditable.js on lines 91..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 47.

        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

                var element  = $.editable.types[settings.type].element 
                            || $.editable.types['defaults'].element;
        Severity: Major
        Found in app/assets/javascripts/jquery.jeditable.js and 3 other locations - About 35 mins to fix
        app/assets/javascripts/jquery.jeditable.js on lines 85..86
        app/assets/javascripts/jquery.jeditable.js on lines 87..88
        app/assets/javascripts/jquery.jeditable.js on lines 91..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 47.

        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

                var reset    = $.editable.types[settings.type].reset 
                            || $.editable.types['defaults'].reset;
        Severity: Major
        Found in app/assets/javascripts/jquery.jeditable.js and 3 other locations - About 35 mins to fix
        app/assets/javascripts/jquery.jeditable.js on lines 85..86
        app/assets/javascripts/jquery.jeditable.js on lines 87..88
        app/assets/javascripts/jquery.jeditable.js on lines 89..90

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

        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