tongueroo/jack

View on GitHub

Showing 72 of 72 total issues

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

  function Plugin(option) {
    return this.each(function () {
      var $this = $(this)
      var data  = $this.data('bs.dropdown')

Severity: Major
Found in docs/js/bootstrap.js and 1 other location - About 3 hrs to fix
docs/js/bootstrap.js on lines 130..138

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

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

  function Plugin(option) {
    return this.each(function () {
      var $this = $(this)
      var data  = $this.data('bs.alert')

Severity: Major
Found in docs/js/bootstrap.js and 1 other location - About 3 hrs to fix
docs/js/bootstrap.js on lines 784..792

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

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

                error: function() {
                    // Fail message
                    $('#success').html("<div class='alert alert-danger'>");
                    $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
                        .append("</button>");
Severity: Major
Found in docs/js/contact_me.js and 1 other location - About 3 hrs to fix
docs/js/contact_me.js on lines 30..42

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

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

                success: function() {
                    // Success message
                    $('#success').html("<div class='alert alert-success'>");
                    $('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
                        .append("</button>");
Severity: Major
Found in docs/js/contact_me.js and 1 other location - About 3 hrs to fix
docs/js/contact_me.js on lines 43..52

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

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

Function show has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Tooltip.prototype.show = function () {
    var e = $.Event('show.bs.' + this.type)

    if (this.hasContent() && this.enabled) {
      this.$element.trigger(e)
Severity: Major
Found in docs/js/bootstrap.js - About 2 hrs to fix

    Function slide has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      Carousel.prototype.slide = function (type, next) {
        var $active   = this.$element.find('.item.active')
        var $next     = next || $active[type]()
        var isCycling = this.interval
        var direction = type == 'next' ? 'left' : 'right'
    Severity: Minor
    Found in docs/js/bootstrap.js - About 1 hr to fix

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

        $(window).on('load', function () {
          $('[data-ride="carousel"]').each(function () {
            var $carousel = $(this)
            Plugin.call($carousel, $carousel.data())
          })
      Severity: Major
      Found in docs/js/bootstrap.js and 1 other location - About 1 hr to fix
      docs/js/bootstrap.js on lines 1835..1840

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

      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

        $(window).on('load.bs.scrollspy.data-api', function () {
          $('[data-spy="scroll"]').each(function () {
            var $spy = $(this)
            Plugin.call($spy, $spy.data())
          })
      Severity: Major
      Found in docs/js/bootstrap.js and 1 other location - About 1 hr to fix
      docs/js/bootstrap.js on lines 488..493

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

      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

      Function submitSuccess has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              submitSuccess: function($form, event) {
                  event.preventDefault(); // prevent default submit behaviour
                  // get values from FORM
                  var name = $("input#name").val();
                  var email = $("input#email").val();
      Severity: Minor
      Found in docs/js/contact_me.js - About 1 hr to fix

        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

        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

          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

          Function show has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Modal.prototype.show = function (_relatedTarget) {
              var that = this
              var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
          
              this.$element.trigger(e)
          Severity: Minor
          Found in docs/js/bootstrap.js - About 1 hr to fix

            Function backdrop has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              Modal.prototype.backdrop = function (callback) {
                var that = this
                var animate = this.$element.hasClass('fade') ? 'fade' : ''
            
                if (this.isShown && this.options.backdrop) {
            Severity: Minor
            Found in docs/js/bootstrap.js - About 1 hr to fix

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

                Tooltip.prototype.applyPlacement = function (offset, placement) {
                  var $tip   = this.tip()
                  var width  = $tip[0].offsetWidth
                  var height = $tip[0].offsetHeight
              
              
              Severity: Minor
              Found in docs/js/bootstrap.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

                  Function checkPosition has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Affix.prototype.checkPosition = function () {
                      if (!this.$element.is(':visible')) return
                  
                      var scrollHeight = $(document).height()
                      var scrollTop    = this.$target.scrollTop()
                  Severity: Minor
                  Found in docs/js/bootstrap.js - About 1 hr to fix

                    Function show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Collapse.prototype.show = function () {
                        if (this.transitioning || this.$element.hasClass('in')) return
                    
                        var startEvent = $.Event('show.bs.collapse')
                        this.$element.trigger(startEvent)
                    Severity: Minor
                    Found in docs/js/bootstrap.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language