estimancy/projestimate

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

Summary

Maintainability
F
1 wk
Test Coverage

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

// ################################# BOOTSTRAP DATE PICKER #################################

/* =========================================================
 * bootstrap-datepicker.js
 * http://www.eyecon.ro/bootstrap-datepicker
Severity: Major
Found in app/assets/javascripts/bootstrap-datepicker.js - About 2 days to fix

    Function fill has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            fill: function() {
                var d = new Date(this.viewDate),
                    year = d.getUTCFullYear(),
                    month = d.getUTCMonth(),
                    startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
    Severity: Major
    Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

      Function click has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              click: function(e) {
                  e.preventDefault();
                  var target = $(e.target).closest('span, td, th');
                  if (target.length == 1) {
                      switch(target[0].nodeName.toLowerCase()) {
      Severity: Major
      Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

        Function parseDate has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                parseDate: function(date, format, language) {
                    if (date instanceof Date) return date;
                    if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
                        var part_re = /([\-+]\d+)([dmwy])/,
                            parts = date.match(/([\-+]\d+)([dmwy])/g),
        Severity: Major
        Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

          Function keydown has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  keydown: function(e){
                      if (this.picker.is(':not(:visible)')){
                          if (e.keyCode == 27) // allow escape to hide and re-show picker
                              this.show();
                          return;
          Severity: Major
          Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

            Function _buildEvents has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _buildEvents: function(){
                        if (this.isInput) { // single input
                            this._events = [
                                [this.element, {
                                    focus: $.proxy(this.show, this),
            Severity: Major
            Found in app/assets/javascripts/bootstrap-datepicker.js - About 2 hrs to fix

              Function _process_options has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _process_options: function(opts){
                          // Store raw options for reference
                          this._o = $.extend({}, this._o, opts);
                          // Processed options
                          var o = this.o = $.extend({}, this._o);
              Severity: Minor
              Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

                Function Datepicker has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var Datepicker = function(element, options) {
                        var that = this;
                
                        this._process_options(options);
                
                
                Severity: Minor
                Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

                  Function datepicker has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $.fn.datepicker = function ( option ) {
                          var args = Array.apply(null, arguments);
                          args.shift();
                          var internal_return,
                              this_return;
                  Severity: Minor
                  Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

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

                            getClassNames: function(date){
                                var cls = [],
                                    year = this.viewDate.getUTCFullYear(),
                                    month = this.viewDate.getUTCMonth(),
                                    currentDate = this.date.valueOf(),
                    Severity: Minor
                    Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

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

                              updateNavArrows: function() {
                                  if (!this._allow_update) return;
                      
                                  var d = new Date(this.viewDate),
                                      year = d.getUTCFullYear(),
                      Severity: Minor
                      Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

                        Function moveMonth has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                moveMonth: function(date, dir){
                                    if (!dir) return date;
                                    var new_date = new Date(date.valueOf()),
                                        day = new_date.getUTCDate(),
                                        month = new_date.getUTCMonth(),
                        Severity: Minor
                        Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      } else if (target.is('.new')) {
                                                          if (month == 11) {
                                                              month = 0;
                                                              year += 1;
                                                          } else {
                          Severity: Major
                          Found in app/assets/javascripts/bootstrap-datepicker.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (this.o.minViewMode === 2) {
                                                                this._setDate(UTCDate(year, month, day,0,0,0,0));
                                                            }
                            Severity: Major
                            Found in app/assets/javascripts/bootstrap-datepicker.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                              if (month === 0) {
                                                                  month = 11;
                                                                  year -= 1;
                                                              } else {
                                                                  month -= 1;
                              Severity: Major
                              Found in app/assets/javascripts/bootstrap-datepicker.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if (this.o.minViewMode === 1) {
                                                                    this._setDate(UTCDate(year, month, day,0,0,0,0));
                                                                }
                                Severity: Major
                                Found in app/assets/javascripts/bootstrap-datepicker.js - About 45 mins to fix

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

                                                              case 'M':
                                                                  filtered = $(dates[language].monthsShort).filter(function(){
                                                                      var m = this.slice(0, parts[i].length),
                                                                          p = parts[i].slice(0, m.length);
                                                                      return m == p;
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 4 hrs to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 1135..1142

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

                                  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 'MM':
                                                                  filtered = $(dates[language].months).filter(function(){
                                                                      var m = this.slice(0, parts[i].length),
                                                                          p = parts[i].slice(0, m.length);
                                                                      return m == p;
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 4 hrs to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 1143..1150

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

                                  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

                                          _unapplyEvents: function(evs){
                                              for (var i=0, el, ev; i<evs.length; i++){
                                                  el = evs[i][0];
                                                  ev = evs[i][1];
                                                  el.off(ev);
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 160..166

                                  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

                                          _applyEvents: function(evs){
                                              for (var i=0, el, ev; i<evs.length; i++){
                                                  el = evs[i][0];
                                                  ev = evs[i][1];
                                                  el.on(ev);
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 167..173

                                  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

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

                                                      if (this.dateWithinRange(newDate)){
                                                          this.date = newDate;
                                                          this.viewDate = newViewDate;
                                                          this.setValue();
                                                          this.update();
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 804..811

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

                                  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

                                                      if (this.dateWithinRange(newDate)){
                                                          this.date = newDate;
                                                          this.viewDate = newViewDate;
                                                          this.setValue();
                                                          this.update();
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 829..836

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

                                  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

                                              switch (o.minViewMode) {
                                                  case 1:
                                                  case 'months':
                                                      o.minViewMode = 1;
                                                      break;
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 112..123

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

                                  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

                                              switch(o.startView){
                                                  case 2:
                                                  case 'decade':
                                                      o.startView = 2;
                                                      break;
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 125..136

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

                                  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

                                              this.picker.find('tfoot th.clear')
                                                  .text(dates[this.o.language].clear)
                                                  .toggle(this.o.clearBtn !== false);
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 477..479

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

                                  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

                                              this.picker.find('tfoot th.today')
                                                  .text(dates[this.o.language].today)
                                                  .toggle(this.o.todayBtn !== false);
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 480..482

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 59.

                                  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, {
                                                          focus: $.proxy(this.show, this),
                                                          keyup: $.proxy(this.update, this),
                                                          keydown: $.proxy(this.keydown, this)
                                                      }]
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 187..191

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

                                  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.find('input'), {
                                                          focus: $.proxy(this.show, this),
                                                          keyup: $.proxy(this.update, this),
                                                          keydown: $.proxy(this.keydown, this)
                                                      }],
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 177..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 56.

                                  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

                                              if (this.isInput) {
                                                  element = this.element;
                                              } else if (this.component){
                                                  element = this.element.find('input');
                                              }
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 55 mins to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 849..853

                                  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

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

                                                  if (this.isInput) {
                                                      element = this.element;
                                                  } else if (this.component){
                                                      element = this.element.find('input');
                                                  }
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 55 mins to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 713..717

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

                                          setDaysOfWeekDisabled: function(daysOfWeekDisabled){
                                              this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
                                              this.update();
                                              this.updateNavArrows();
                                          },
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 338..342
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 344..348

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

                                  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

                                          setEndDate: function(endDate){
                                              this._process_options({endDate: endDate});
                                              this.update();
                                              this.updateNavArrows();
                                          },
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 338..342
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 350..354

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

                                  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

                                          setStartDate: function(startDate){
                                              this._process_options({startDate: startDate});
                                              this.update();
                                              this.updateNavArrows();
                                          },
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 2 other locations - About 40 mins to fix
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 344..348
                                  app/assets/javascripts/bootstrap-datepicker.js on lines 350..354

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

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

                                      $.fn.datepicker.noConflict = function(){
                                          $.fn.datepicker = old;
                                          return this;
                                      };
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js and 8 other locations - About 35 mins to fix
                                  app/assets/javascripts/bootstrap.js on lines 147..150
                                  app/assets/javascripts/bootstrap.js on lines 247..250
                                  app/assets/javascripts/bootstrap.js on lines 445..448
                                  app/assets/javascripts/bootstrap.js on lines 615..618
                                  app/assets/javascripts/bootstrap.js on lines 787..790
                                  app/assets/javascripts/bootstrap.js on lines 1025..1028
                                  app/assets/javascripts/bootstrap.js on lines 1815..1818
                                  app/assets/javascripts/bootstrap.js on lines 2148..2151

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

                                  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