codn/adminpanel

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

Summary

Maintainability
F
2 wks
Test Coverage

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

/*!
 * Datepicker for Bootstrap v1.5.0-dev (https://github.com/eternicode/bootstrap-datepicker)
 *
 * Copyright 2012 Stefan Petre
 * Improvements by Andrew Rowls
Severity: Major
Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 days to fix

    Function fill has 124 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/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

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

              keydown: function(e){
                  if (!this.picker.is(':visible')){
                      if (e.keyCode === 40 || e.keyCode === 27) // allow down to re-show picker
                          this.show();
                      return;
      Severity: Major
      Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

        Function _process_options has 118 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: Major
        Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

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

                  parseDate: function(date, format, language){
                      if (!date)
                          return undefined;
                      if (date instanceof Date)
                          return date;
          Severity: Major
          Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

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

                    click: function(e){
                        e.preventDefault();
                        var target = $(e.target).closest('span, td, th'),
                            year, month, day;
                        if (target.length === 1){
            Severity: Major
            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 4 hrs to fix

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

                      _buildEvents: function(){
                          var events = {
                              keyup: $.proxy(function(e){
                                  if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
                                      this.update();
              Severity: Major
              Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 2 hrs to fix

                Function place has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        place: function(){
                            if (this.isInline)
                                return this;
                            var calendarWidth = this.picker.outerWidth(),
                                calendarHeight = this.picker.outerHeight(),
                Severity: Major
                Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 2 hrs to fix

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

                          update: function(){
                              if (!this._allow_update)
                                  return this;
                  
                              var oldDates = this.dates.copy(),
                  Severity: Major
                  Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 2 hrs to fix

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

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

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

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

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

                                moveMonth: function(date, dir){
                                    if (!date)
                                        return undefined;
                                    if (!dir)
                                        return date;
                        Severity: Minor
                        Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 1 hr to fix

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

                              var DateArray = (function(){
                                  var extras = {
                                      get: function(i){
                                          return this.slice(i)[0];
                                      },
                          Severity: Minor
                          Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 1 hr to fix

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

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

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

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

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

                                        dateUpdated: function(e){
                                            // `this.updating` is a workaround for preventing infinite recursion
                                            // between `changeDate` triggering and `setUTCDate` calling.  Until
                                            // there is a better mechanism.
                                            if (this.updating)
                                Severity: Minor
                                Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

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

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                            if (this.viewMode === 1)
                                                                                this._trigger('changeYear', this.viewDate);
                                    Severity: Major
                                    Found in app/assets/javascripts/adminpanel/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));
                                                                      }
                                      Severity: Major
                                      Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                        if (month === 0){
                                                                            month = 11;
                                                                            year -= 1;
                                                                        }
                                                                        else {
                                        Severity: Major
                                        Found in app/assets/javascripts/adminpanel/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));
                                                                              this.showMode();
                                                                          } else {
                                                                              this.showMode(-1);
                                          Severity: Major
                                          Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js - About 45 mins to fix

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

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

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

                                            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, ch; i < evs.length; i++){
                                                            el = evs[i][0];
                                                            if (evs[i].length === 2){
                                                                ch = undefined;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 6 hrs to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 275..288

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

                                            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 (!!o.endDate){
                                                                if (o.endDate instanceof Date)
                                                                    o.endDate = this._local_to_utc(this._zero_time(o.endDate));
                                                                else
                                                                    o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 193..201

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

                                            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 (!!o.startDate){
                                                                if (o.startDate instanceof Date)
                                                                    o.startDate = this._local_to_utc(this._zero_time(o.startDate));
                                                                else
                                                                    o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 204..212

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

                                            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 (e.ctrlKey){
                                                                    newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
                                                                    newViewDate = this.moveYear(focusDate, dir);
                                                                    this._trigger('changeYear', this.viewDate);
                                                                }
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1261..1276
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1266..1276
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1294..1304

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

                                            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 (e.shiftKey){
                                                                    newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
                                                                    newViewDate = this.moveMonth(focusDate, dir);
                                                                    this._trigger('changeMonth', this.viewDate);
                                                                }
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1261..1276
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1289..1304
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1294..1304

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

                                            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 (e.ctrlKey){
                                                                    newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
                                                                    newViewDate = this.moveYear(focusDate, dir);
                                                                    this._trigger('changeYear', this.viewDate);
                                                                }
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1266..1276
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1289..1304
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1294..1304

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

                                            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 (e.shiftKey){
                                                                    newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
                                                                    newViewDate = this.moveMonth(focusDate, dir);
                                                                    this._trigger('changeMonth', this.viewDate);
                                                                }
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1261..1276
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1266..1276
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1289..1304

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

                                            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(newViewDate)){
                                                                    this.focusDate = this.viewDate = newViewDate;
                                                                    this.setValue();
                                                                    this.fill();
                                                                    e.preventDefault();
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1277..1282

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 64.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                                        case 'M':
                                                                            filtered = $(dates[language].monthsShort).filter(match_part);
                                                                            val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
                                                                            break;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1687..1690

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 64.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                                if (this.dateWithinRange(newViewDate)){
                                                                    this.focusDate = this.viewDate = newViewDate;
                                                                    this.setValue();
                                                                    this.fill();
                                                                    e.preventDefault();
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1305..1310

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 64.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                                        case 'MM':
                                                                            filtered = $(dates[language].months).filter(match_part);
                                                                            val = $.inArray(filtered[0], dates[language].months) + 1;
                                                                            break;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1691..1694

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 64.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

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

                                            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.minViewMode){
                                                            case 1:
                                                            case 'months':
                                                                o.minViewMode = 1;
                                                                break;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 152..163

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 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

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

                                                        if (this.isInput){
                                                            element = this.element;
                                                        }
                                                        else if (this.component){
                                                            element = this.element.find('input');
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 55 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 530..534
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1350..1355

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

                                                            if (this.isInput){
                                                                element = this.element;
                                                            }
                                                            else if (this.component){
                                                                element = this.element.find('input');
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 55 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 530..534
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1164..1169

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

                                                        if (this.isInput) {
                                                            element = this.element;
                                                        } else if (this.component) {
                                                            element = this.element.find('input');
                                                        }
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 55 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1164..1169
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 1350..1355

                                            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

                                                    setStartDate: function(startDate){
                                                        this._process_options({startDate: startDate});
                                                        this.update();
                                                        this.updateNavArrows();
                                                        return this;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 50 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 596..601
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 603..608

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 51.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                    setDaysOfWeekDisabled: function(daysOfWeekDisabled){
                                                        this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
                                                        this.update();
                                                        this.updateNavArrows();
                                                        return this;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 50 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 589..594
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 596..601

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 51.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                    setEndDate: function(endDate){
                                                        this._process_options({endDate: endDate});
                                                        this.update();
                                                        this.updateNavArrows();
                                                        return this;
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 2 other locations - About 50 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 589..594
                                            app/assets/javascripts/adminpanel/bootstrap-datepicker.js on lines 603..608

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 51.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

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

                                                $.fn.datepicker.noConflict = function(){
                                                    $.fn.datepicker = old;
                                                    return this;
                                                };
                                            Severity: Major
                                            Found in app/assets/javascripts/adminpanel/bootstrap-datepicker.js and 8 other locations - About 35 mins to fix
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 281..284
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 451..454
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 759..762
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 1379..1382
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 1480..1483
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 1643..1646
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 1831..1834
                                            app/assets/javascripts/adminpanel/bootstrap.js on lines 2154..2157

                                            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