OWASP/railsgoat

View on GitHub
app/assets/javascripts/bootstrap-timepicker.js

Summary

Maintainability
F
1 wk
Test Coverage

File bootstrap-timepicker.js has 686 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* =========================================================
 * bootstrap-timepicker.js
 * http://www.github.com/jdewit/bootstrap-timepicker
 * =========================================================
 * Copyright 2012
Severity: Major
Found in app/assets/javascripts/bootstrap-timepicker.js - About 1 day to fix

    Function getTemplate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            , getTemplate: function() {
                if (this.options.templates[this.options.template]) {
                    return this.options.templates[this.options.template];
                }
                if (this.showInputs) {
    Severity: Major
    Found in app/assets/javascripts/bootstrap-timepicker.js - About 3 hrs to fix

      Function elementKeypress has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              , elementKeypress: function(e) {
                  var input = this.$element.get(0);
                  switch (e.keyCode) {
                      case 0: //input
                      break;
      Severity: Major
      Found in app/assets/javascripts/bootstrap-timepicker.js - About 2 hrs to fix

        Function widgetKeypress has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                , widgetKeypress: function(e) {
                    var input = $(e.target).closest('input').attr('name');
        
                    switch (e.keyCode) {
                        case 9: //tab
        Severity: Major
        Found in app/assets/javascripts/bootstrap-timepicker.js - About 2 hrs to fix

          Function setValues has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  , setValues: function(time) {
                      if (this.showMeridian) {
                          var arr = time.split(' ');
                          var timeArray = arr[0].split(':');
                          this.meridian = arr[1];
          Severity: Major
          Found in app/assets/javascripts/bootstrap-timepicker.js - About 2 hrs to fix

            Function setDefaultTime has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    , setDefaultTime: function(defaultTime){
                        if (defaultTime) {
                            if (defaultTime === 'current') {
                                var dTime = new Date();
                                var hours = dTime.getHours();
            Severity: Minor
            Found in app/assets/javascripts/bootstrap-timepicker.js - About 1 hr to fix

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

                      , init: function () {
                          if (this.$element.parent().hasClass('input-append')) {
                              this.$element.parent('.input-append').find('.add-on').on('click', $.proxy(this.showWidget, this));
                              this.$element.on({
                                  focus: $.proxy(this.highlightUnit, this),
              Severity: Minor
              Found in app/assets/javascripts/bootstrap-timepicker.js - About 1 hr to fix

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

                        , showWidget: function(e) {
                            e.stopPropagation();
                            e.preventDefault();
                
                            if (this.open) {
                Severity: Minor
                Found in app/assets/javascripts/bootstrap-timepicker.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (hours > 12) {
                                                  hours = hours - 12;
                                              }
                  Severity: Major
                  Found in app/assets/javascripts/bootstrap-timepicker.js - About 45 mins to fix

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

                            , incrementSecond: function() {
                                var newVal = this.second + this.secondStep - (this.second % this.secondStep);
                                if (newVal > 59) {
                                    this.incrementMinute();
                                    this.second = newVal - 60;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 640..648

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

                    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

                            , incrementMinute: function() {
                                var newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
                                if (newVal > 59) {
                                    this.incrementHour();
                                    this.minute = newVal - 60;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 660..668

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

                    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

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

                                        this.$element.on({
                                            focus: $.proxy(this.highlightUnit, this),
                                            click: $.proxy(this.highlightUnit, this),
                                            keypress: $.proxy(this.elementKeypress, this),
                                            blur: $.proxy(this.blurElement, this)
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 59..64

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

                    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

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

                                    this.$element.on({
                                        focus: $.proxy(this.highlightUnit, this),
                                        click: $.proxy(this.highlightUnit, this),
                                        keypress: $.proxy(this.elementKeypress, this),
                                        blur: $.proxy(this.blurElement, this)
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 74..79

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

                    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

                                    case 40: // down arrow
                                        switch (this.highlightedUnit) {
                                            case 'hour':
                                                this.decrementHour();
                                            break;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 257..273

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

                    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

                                    case 38: // up arrow
                                        switch (this.highlightedUnit) {
                                            case 'hour':
                                                this.incrementHour();
                                            break;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 278..294

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

                    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

                                    case 40: // down arrow
                                        switch (input) {
                                            case 'hour':
                                                this.decrementHour();
                                            break;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 187..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 81.

                    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

                                    case 38: // up arrow
                                        switch (input) {
                                            case 'hour':
                                                this.incrementHour();
                                            break;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 204..220

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

                    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

                            , decrementMinute: function() {
                                var newVal = this.minute - this.minuteStep;
                                if (newVal < 0) {
                                    this.decrementHour();
                                    this.minute = newVal + 60;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 670..678

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

                    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

                            , decrementSecond: function() {
                                var newVal = this.second - this.secondStep;
                                if (newVal < 0) {
                                    this.decrementMinute();
                                    this.second = newVal + 60;
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 650..658

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

                    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.showSeconds) {
                                        this.$widget.find('span.bootstrap-timepicker-second').text(this.second < 10 ? '0' + this.second : this.second);
                                    }
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 470..472

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

                    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.showSeconds) {
                                        this.$widget.find('input.bootstrap-timepicker-second').val(this.second < 10 ? '0' + this.second : this.second);
                                    }
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 479..481

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

                    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

                                    } else if (this.second < 0) {
                                        this.second = 0;
                                    } else if (this.second >= 60) {
                                        this.second = 59;
                                    }
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 323..327
                    app/assets/javascripts/bootstrap-timepicker.js on lines 339..343
                    app/assets/javascripts/bootstrap-timepicker.js on lines 346..350

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

                    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

                                     if (this.hour >= 24) {
                                        this.hour = 23;
                                    } else if (this.hour < 0) {
                                        this.hour = 0;
                                    }
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 323..327
                    app/assets/javascripts/bootstrap-timepicker.js on lines 346..350
                    app/assets/javascripts/bootstrap-timepicker.js on lines 355..359

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

                    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

                                if (this.minute < 0) {
                                    this.minute = 0;
                                } else if (this.minute >= 60) {
                                    this.minute = 59;
                                }
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 323..327
                    app/assets/javascripts/bootstrap-timepicker.js on lines 339..343
                    app/assets/javascripts/bootstrap-timepicker.js on lines 355..359

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

                    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

                                    if (this.hour > 12) {
                                        this.hour = 12;
                                    } else if (this.hour < 1) {
                                        this.hour = 1;
                                    }
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 3 other locations - About 55 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 339..343
                    app/assets/javascripts/bootstrap-timepicker.js on lines 346..350
                    app/assets/javascripts/bootstrap-timepicker.js on lines 355..359

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

                    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 pos = $.extend({}, this.$element.offset(), {
                                    height: this.$element[0].offsetHeight
                                });
                    Severity: Minor
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 1 other location - About 35 mins to fix
                    app/assets/javascripts/bootstrap.js on lines 1911..1913

                    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 3 locations. Consider refactoring.
                    Open

                            , highlightMinute: function() {
                                this.highlightedUnit = 'minute';
                                this.$element.get(0).setSelectionRange(3,5);
                            }
                    Severity: Minor
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 2 other locations - About 30 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 587..590
                    app/assets/javascripts/bootstrap-timepicker.js on lines 597..600

                    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 3 locations. Consider refactoring.
                    Open

                            , highlightHour: function() {
                                this.highlightedUnit = 'hour';
                                this.$element.get(0).setSelectionRange(0,2);
                            }
                    Severity: Minor
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 2 other locations - About 30 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 592..595
                    app/assets/javascripts/bootstrap-timepicker.js on lines 597..600

                    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 3 locations. Consider refactoring.
                    Open

                            , highlightSecond: function() {
                                this.highlightedUnit = 'second';
                                this.$element.get(0).setSelectionRange(6,8);
                            }
                    Severity: Minor
                    Found in app/assets/javascripts/bootstrap-timepicker.js and 2 other locations - About 30 mins to fix
                    app/assets/javascripts/bootstrap-timepicker.js on lines 587..590
                    app/assets/javascripts/bootstrap-timepicker.js on lines 592..595

                    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