octoblu/meshblu

View on GitHub
docs/js/jqBootstrapValidation.js

Summary

Maintainability
F
1 wk
Test Coverage

Function init has 349 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      init : function( options ) {

        var settings = $.extend(true, {}, defaults);

        settings.options = $.extend(true, settings.options, options);
Severity: Major
Found in docs/js/jqBootstrapValidation.js - About 1 day to fix

    File jqBootstrapValidation.js has 731 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* jqBootstrapValidation
     * A plugin for automating validation on Twitter Bootstrap formatted forms.
     *
     * v1.3.6
     *
    Severity: Major
    Found in docs/js/jqBootstrapValidation.js - About 1 day to fix

      Function validate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              validate: function ($this, value, validator) {
                if (""+validator.lastValue === ""+value && validator.lastFinished === true) {
                  return validator.lastValid === false;
                }
      
      
      Severity: Minor
      Found in docs/js/jqBootstrapValidation.js - About 1 hr to fix

        Function validate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                validate: function ($this, value, validator) {
                  if (validator.lastValue === value && validator.lastFinished) {
                    return !validator.lastValid;
                  }
        
        
        Severity: Minor
        Found in docs/js/jqBootstrapValidation.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                          if (value || value.length || (params && params.includeEmpty) || (!!settings.validatorTypes[validatorType].blockSubmit && params && !!params.submitting)) {
                            $.each(validatorTypeArray, function (i, validator) {
                              if (settings.validatorTypes[validatorType].validate($this, value, validator)) {
                                errorsFound.push(validator.message);
                              }
          Severity: Major
          Found in docs/js/jqBootstrapValidation.js - About 1 hr to fix

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

                        maxchecked: {
                            name: "maxchecked",
                            init: function ($this, name) {
                                var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]");
                                elements.bind("click.validation", function () {
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 1 day to fix
            docs/js/jqBootstrapValidation.js on lines 768..782

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

            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

                        minchecked: {
                            name: "minchecked",
                            init: function ($this, name) {
                                var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]");
                                elements.bind("click.validation", function () {
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 1 day to fix
            docs/js/jqBootstrapValidation.js on lines 753..767

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

            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 ($this.attr("min") !== undefined || $this.attr("aria-valuemin") !== undefined) {
                          var min = ($this.attr("min") !== undefined ? $this.attr("min") : $this.attr("aria-valuemin"));
                          message = "Too low: Minimum of '" + min + "'<!-- data-validation-min-message to override -->";
                          if ($this.data("validationMinMessage")) {
                            message = $this.data("validationMinMessage");
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 5 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 119..127

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

            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 ($this.attr("max") !== undefined || $this.attr("aria-valuemax") !== undefined) {
                          var max = ($this.attr("max") !== undefined ? $this.attr("max") : $this.attr("aria-valuemax"));
                          message = "Too high: Maximum of '" + max + "'<!-- data-validation-max-message to override -->";
                          if ($this.data("validationMaxMessage")) {
                            message = $this.data("validationMaxMessage");
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 5 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 131..139

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

            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

                        if ($this.attr("maxlength") !== undefined) {
                          message = "Too long: Maximum of '" + $this.attr("maxlength") + "' characters<!-- data-validation-maxlength-message to override -->";
                          if ($this.data("validationMaxlengthMessage")) {
                            message = $this.data("validationMaxlengthMessage");
                          }
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 2 other locations - About 3 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 154..161
            docs/js/jqBootstrapValidation.js on lines 197..204

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

            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

                        if ($this.attr("minchecked") !== undefined) {
                          message = "Not enough options checked; Minimum of '" + $this.attr("minchecked") + "' required<!-- data-validation-minchecked-message to override -->";
                          if ($this.data("validationMincheckedMessage")) {
                            message = $this.data("validationMincheckedMessage");
                          }
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 2 other locations - About 3 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 143..150
            docs/js/jqBootstrapValidation.js on lines 154..161

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

            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

                        if ($this.attr("minlength") !== undefined) {
                          message = "Too short: Minimum of '" + $this.attr("minlength") + "' characters<!-- data-validation-minlength-message to override -->";
                          if ($this.data("validationMinlengthMessage")) {
                            message = $this.data("validationMinlengthMessage");
                          }
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 2 other locations - About 3 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 143..150
            docs/js/jqBootstrapValidation.js on lines 197..204

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

            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

                        minlength: {
                            name: "minlength",
                            init: function ($this, name) {
                                return {minlength: $this.data("validation" + name + "Minlength")};
                            },
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 3 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 733..742

            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

                        maxlength: {
                            name: "maxlength",
                            init: function ($this, name) {
                                return {maxlength: $this.data("validation" + name + "Maxlength")};
                            },
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 3 hrs to fix
            docs/js/jqBootstrapValidation.js on lines 743..752

            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

                        if ($this.attr("required") !== undefined || $this.attr("aria-required") !== undefined) {
                          message = settings.builtInValidators.required.message;
                          if ($this.data("validationRequiredMessage")) {
                            message = $this.data("validationRequiredMessage");
                          }
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 1 hr to fix
            docs/js/jqBootstrapValidation.js on lines 175..181

            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

                        if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "number") {
                          message = settings.builtInValidators.number.message;
                          if ($this.data("validationNumberMessage")) {
                            message = $this.data("validationNumberMessage");
                          }
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 1 hr to fix
            docs/js/jqBootstrapValidation.js on lines 165..171

            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

                    init: function ($this, name) {
                      return {
                        validatorName: name,
                        url: $this.data("validation" + name + "Ajax"),
                        lastValue: $this.val(),
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 1 hr to fix
            docs/js/jqBootstrapValidation.js on lines 573..581

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

            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

                    init: function ($this, name) {
                      return {
                        validatorName: name,
                        callback: $this.data("validation" + name + "Callback"),
                        lastValue: $this.val(),
            Severity: Major
            Found in docs/js/jqBootstrapValidation.js and 1 other location - About 1 hr to fix
            docs/js/jqBootstrapValidation.js on lines 623..631

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

            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