NUBIC/surveyor

View on GitHub
lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js

Summary

Maintainability
F
3 wks
Test Coverage

File jquery-ui-timepicker-addon.js has 1470 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jQuery timepicker addon
 * By: Trent Richardson [http://trentrichardson.com]
 * Version 1.2
 * Last Modified: 02/02/2013
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 3 days to fix

    Function parseTime has 154 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.datepicker.parseTime = function(timeFormat, timeString, options) {        
            var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
    
            // Strict parse requires the timeString to match the timeFormat exactly
            var strictParse = function(f, s, o){
    Severity: Major
    Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 6 hrs to fix

      Function _injectTimePicker has 146 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _injectTimePicker: function() {
                  var $dp = this.inst.dpDiv,
                      o = this.inst.settings,
                      tp_inst = this,
                      litem = '',
      Severity: Major
      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 5 hrs to fix

        Function strictParse has 114 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var strictParse = function(f, s, o){
        
                    // pattern for standard and localized AM/PM markers
                    var getPatternAmpm = function(amNames, pmNames) {
                        var markers = [];
        Severity: Major
        Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 4 hrs to fix

          Function _newInst has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _newInst: function($input, o) {
                      var tp_inst = new Timepicker(),
                          inlineSettings = {},
                          fns = {},
                          overrides, i;
          Severity: Major
          Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 4 hrs to fix

            Function _limitMinMaxDateTime has 111 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _limitMinMaxDateTime: function(dp_inst, adjustSliders) {
                        var o = this._defaults,
                            dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
            
                        if (!this._defaults.showTimepicker) {
            Severity: Major
            Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 4 hrs to fix

              Function _onTimeChange has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _onTimeChange: function() {
                          var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
                              minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
                              second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
                              millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
              Severity: Major
              Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 3 hrs to fix

                Function _optionDatepicker has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.datepicker._optionDatepicker = function(target, name, value) {
                        var inst = this._getInst(target),
                            name_clone;
                        if (!inst) {
                            return null;
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 3 hrs to fix

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

                      var Timepicker = function() {
                          this.regional = []; // Available regional settings, indexed by language code
                          this.regional[''] = { // Default regional settings
                              currentText: 'Now',
                              closeText: 'Done',
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 2 hrs to fix

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

                        $.datepicker.formatTime = function(format, time, options) {
                            options = options || {};
                            options = $.extend({}, $.timepicker._defaults, options);
                            time = $.extend({
                                hour: 0,
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 2 hrs to fix

                      Function handleRange has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.timepicker.handleRange = function(method, startTime, endTime, options) {
                              $.fn[method].call(startTime, $.extend({
                                  onClose: function(dateText, inst) {
                                      checkDates(this, endTime, dateText);
                                  },
                      Severity: Minor
                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

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

                                _updateDateTime: function(dp_inst) {
                                    dp_inst = this.inst || dp_inst;
                                    var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
                                        dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
                                        formatCfg = $.datepicker._getFormatConfig(dp_inst),
                        Severity: Minor
                        Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

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

                              var splitDateTime = function(dateFormat, dateTimeString, dateSettings, timeSettings) {
                                  try {
                                      // The idea is to get the number separator occurances in datetime and the time format requested (since time has 
                                      // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
                                      var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator,
                          Severity: Minor
                          Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

                            Function looseParse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    var looseParse = function(f,s,o){
                                        try{
                                            var d = new Date('2012-01-01 '+ s);
                                            if(isNaN(d.getTime())){
                                                d = new Date('2012-01-01T'+ s);
                            Severity: Minor
                            Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

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

                                      _parseTime: function(timeString, withDate) {
                                          if (!this.inst) {
                                              this.inst = $.datepicker._getInst(this.$input[0]);
                                          }
                              
                              
                              Severity: Minor
                              Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

                                Function create has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                                create: function(tp_inst, obj, unit, val, min, max, step){
                                Severity: Major
                                Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 50 mins to fix

                                  Function create has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                                  create: function(tp_inst, obj, unit, val, min, max, step){
                                  Severity: Major
                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 50 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if (overrides.hasOwnProperty(prop) && name[prop]) {
                                                            fns[prop] = name[prop];
                                                        }
                                    Severity: Major
                                    Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                          if(ap.indexOf('p') !== -1 && n < 12){
                                                                              n += 12;
                                                                          }
                                                                          else{
                                                                              if(ap.indexOf('a') !== -1 && n === 12){
                                      Severity: Major
                                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                    for (var h = o[litem+'Min']; h <= max[litem]; h += parseInt(o[litem+'Grid'], 10)) {
                                                                        gridSize[litem]++;
                                                                        var tmph = $.datepicker.formatTime(useAmpm(o.pickerTimeFormat || o.timeFormat)? 'hht':'HH', {hour:h}, o);                                    
                                                                        html += '<td data-for="'+litem+'">' + tmph + '</td>';
                                                                    }
                                        Severity: Major
                                        Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                      if (this.second >= this._defaults.secondMax) {
                                                                          this.second = this._defaults.secondMax;
                                                                          this._defaults.millisecMax = maxDateTime.getMilliseconds();
                                                                      } else {
                                                                          if (this.millisec > this._defaults.millisecMax) {
                                          Severity: Major
                                          Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                        if (this.second <= this._defaults.secondMin) {
                                                                            this.second = this._defaults.secondMin;
                                                                            this._defaults.millisecMin = minDateTime.getMilliseconds();
                                                                        } else {
                                                                            if (this.millisec < this._defaults.millisecMin) {
                                            Severity: Major
                                            Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                          for (var m = o[litem+'Min']; m <= max[litem]; m += parseInt(o[litem+'Grid'], 10)) {
                                                                              gridSize[litem]++;
                                                                              html += '<td data-for="'+litem+'">' + ((m < 10) ? '0' : '') + m + '</td>';
                                                                          }
                                              Severity: Major
                                              Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                            if (tz.substring(1) == '00:00') {
                                                                                tz = 'Z';
                                                                            }
                                                Severity: Major
                                                Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 45 mins to fix

                                                  Function parseDateTimeInternal has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
                                                  Severity: Minor
                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                                                    Function options has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                                    options: function(tp_inst, obj, unit, opts, val){
                                                    Severity: Minor
                                                    Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                                                      Function options has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                                      options: function(tp_inst, obj, unit, opts, val){
                                                      Severity: Minor
                                                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                                                        Function parseDateTime has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            $.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
                                                        Severity: Minor
                                                        Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                              return obj.slider(opts);
                                                          Severity: Major
                                                          Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                            return true;
                                                            Severity: Major
                                                            Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
                                                              Severity: Major
                                                              Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                                            return obj.slider(opts, val);
                                                                Severity: Major
                                                                Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 30 mins to fix

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

                                                                                  if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
                                                                                      this._defaults.hourMin = minDateTime.getHours();
                                                                                      if (this.hour <= this._defaults.hourMin) {
                                                                                          this.hour = this._defaults.hourMin;
                                                                                          this._defaults.minuteMin = minDateTime.getMinutes();
                                                                  Severity: Major
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 1 other location - About 2 days to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 591..622

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

                                                                  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 (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()) {
                                                                                      this._defaults.hourMax = maxDateTime.getHours();
                                                                                      if (this.hour >= this._defaults.hourMax) {
                                                                                          this.hour = this._defaults.hourMax;
                                                                                          this._defaults.minuteMax = maxDateTime.getMinutes();
                                                                  Severity: Major
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 1 other location - About 2 days to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 546..577

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                                  if (this.minute_slider) {
                                                                                      this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
                                                                                      this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
                                                                                  }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 631..634
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 639..642
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 643..646

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                                  if (this.millisec_slider) {
                                                                                      this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
                                                                                      this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
                                                                                  }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 631..634
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 635..638
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 639..642

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                                  if (this.hour_slider) {
                                                                                      this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
                                                                                      this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
                                                                                  }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 635..638
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 639..642
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 643..646

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                                  if (this.second_slider) {
                                                                                      this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
                                                                                      this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
                                                                                  }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 631..634
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 635..638
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 643..646

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

                                                                  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 (tp_inst) {
                                                                              if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
                                                                                  try {
                                                                                      $.datepicker._updateDatepicker(inst);
                                                                                  } catch (err) {
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 824..832

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

                                                                  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 (tp_inst) {
                                                                                      if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
                                                                                          try {
                                                                                              $.datepicker._updateDatepicker(inst);
                                                                                          } catch (err) {
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1371..1379

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

                                                                  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

                                                                              tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin? tp_inst._defaults.minuteMin : 
                                                                                              tp_inst._defaults.minute > tp_inst._defaults.minuteMax? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 240..241
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 244..245
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 246..247

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

                                                                  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

                                                                              tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin? tp_inst._defaults.hourMin : 
                                                                                              tp_inst._defaults.hour > tp_inst._defaults.hourMax? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 242..243
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 244..245
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 246..247

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

                                                                  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

                                                                              tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin? tp_inst._defaults.secondMin : 
                                                                                              tp_inst._defaults.second > tp_inst._defaults.secondMax? tp_inst._defaults.secondMax : tp_inst._defaults.second;
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 240..241
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 242..243
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 246..247

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

                                                                  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

                                                                              tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin? tp_inst._defaults.millisecMin : 
                                                                                              tp_inst._defaults.millisec > tp_inst._defaults.millisecMax? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 240..241
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 242..243
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 244..245

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

                                                                  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

                                                                          $.fn[method].call(endTime, $.extend({
                                                                              onClose: function(dateText, inst) {
                                                                                  checkDates(this, startTime, dateText);
                                                                              },
                                                                              onSelect: function(selectedDateTime) {
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1853..1860

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

                                                                  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

                                                                          $.fn[method].call(startTime, $.extend({
                                                                              onClose: function(dateText, inst) {
                                                                                  checkDates(this, endTime, dateText);
                                                                              },
                                                                              onSelect: function(selectedDateTime) {
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1861..1868

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

                                                                  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

                                                                              } else if (max) { //if max was set
                                                                                  if (max === 0) {
                                                                                      max = new Date();
                                                                                  } else {
                                                                                      max = new Date(max);
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1617..1635

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

                                                                  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 (min) { //if min was set
                                                                                  if (min === 0) {
                                                                                      min = new Date();
                                                                                  } else {
                                                                                      min = new Date(min);
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1625..1635

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                              if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
                                                                                  tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
                                                                              }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 270..272
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 276..278

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                              if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
                                                                                  tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
                                                                              }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 270..272
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 273..275

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                              if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
                                                                                  tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
                                                                              }
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 273..275
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 276..278

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

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

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

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

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

                                                                  Refactorings

                                                                  Further Reading

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

                                                                                  if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null) {
                                                                                      this.hourMaxOriginal = o.hourMax;
                                                                                      this.minuteMaxOriginal = o.minuteMax;
                                                                                      this.secondMaxOriginal = o.secondMax;
                                                                                      this.millisecMaxOriginal = o.millisecMax;
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 539..544

                                                                  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

                                                                                  if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null) {
                                                                                      this.hourMinOriginal = o.hourMin;
                                                                                      this.minuteMinOriginal = o.minuteMin;
                                                                                      this.secondMinOriginal = o.secondMin;
                                                                                      this.millisecMinOriginal = o.millisecMin;
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 584..589

                                                                  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

                                                                                  var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
                                                                                      maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 536..537

                                                                  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

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

                                                                                  var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
                                                                                      minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 581..582

                                                                  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

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

                                                                                      secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
                                                                  Severity: Major
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 3 other locations - About 55 mins to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 626..626
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 627..627
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 629..629

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

                                                                  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

                                                                                  var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
                                                                  Severity: Major
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 3 other locations - About 55 mins to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 627..627
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 628..628
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 629..629

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

                                                                  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

                                                                                      millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10);
                                                                  Severity: Major
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 3 other locations - About 55 mins to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 626..626
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 627..627
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 628..628

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

                                                                  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

                                                                                      minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
                                                                  Severity: Major
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 3 other locations - About 55 mins to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 626..626
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 628..628
                                                                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 629..629

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

                                                                  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(dp_inst.lastVal==""){
                                                                                  dp_inst.currentYear=dp_inst.selectedYear;
                                                                                  dp_inst.currentMonth=dp_inst.selectedMonth;
                                                                                  dp_inst.currentDay=dp_inst.selectedDay;
                                                                              }
                                                                  Severity: Minor
                                                                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js and 1 other location - About 40 mins to fix
                                                                  lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 4963..4967

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

                                                                  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