HabitatMap/AirCasting

View on GitHub
app/javascript/jquery.ui.daterangepicker.js

Summary

Maintainability
F
3 wks
Test Coverage

File jquery.ui.daterangepicker.js has 1472 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This is not the original library! The code has been customized.

/**
 * @version: 3.0.3
 * @author: Dan Grossman http://www.dangrossman.info/
Severity: Major
Found in app/javascript/jquery.ui.daterangepicker.js - About 3 days to fix

    Function DateRangePicker has 348 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var DateRangePicker = function (element, options, cb) {
        //default settings for options
        this.parentEl = "body";
        this.element = $(element);
        this.startDate = moment().startOf("day");
    Severity: Major
    Found in app/javascript/jquery.ui.daterangepicker.js - About 1 day to fix

      Function renderCalendar has 224 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          renderCalendar: function (side) {
            //
            // Build the matrix of dates that will populate the calendar
            //
      
      
      Severity: Major
      Found in app/javascript/jquery.ui.daterangepicker.js - About 1 day to fix

        Function renderTimePicker has 159 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderTimePicker: function (side) {
              // Don't bother updating the time picker if it's currently disabled
              // because an end date hasn't been clicked yet
              if (side == "right" && !this.endDate) return;
        
        
        Severity: Major
        Found in app/javascript/jquery.ui.daterangepicker.js - About 6 hrs to fix

          Function move has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              move: function () {
                var parentOffset = { top: 0, left: 0 },
                  containerTop;
                var parentRightEdge = $(window).width();
                if (!this.parentEl.is("body")) {
          Severity: Major
          Found in app/javascript/jquery.ui.daterangepicker.js - About 2 hrs to fix

            Function clickDate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                clickDate: function (e) {
                  if (!$(e.target).hasClass("available")) return;
            
                  var title = $(e.target).attr("data-title");
                  var row = title.substr(1, 1);
            Severity: Major
            Found in app/javascript/jquery.ui.daterangepicker.js - About 2 hrs to fix

              Function updateMonthsInView has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  updateMonthsInView: function () {
                    if (this.endDate) {
                      //if both dates are visible already, do nothing
                      if (
                        !this.singleDatePicker &&
              Severity: Major
              Found in app/javascript/jquery.ui.daterangepicker.js - About 2 hrs to fix

                Function calculateChosenLabel has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    calculateChosenLabel: function () {
                      var customRange = true;
                      var i = 0;
                      for (var range in this.ranges) {
                        if (this.timePicker) {
                Severity: Minor
                Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

                  Function monthOrYearChanged has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      monthOrYearChanged: function (e) {
                        var isLeft = $(e.target).closest(".drp-calendar").hasClass("left"),
                          leftOrRight = isLeft ? "left" : "right",
                          cal = this.container.find(".drp-calendar." + leftOrRight);
                  
                  
                  Severity: Minor
                  Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

                    Function updateCalendars has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        updateCalendars: function () {
                          if (this.timePicker) {
                            var hour, minute, second;
                            if (this.endDate) {
                              hour = parseInt(this.container.find(".left .hourselect").val(), 10);
                    Severity: Minor
                    Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

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

                          timeChanged: function (e) {
                            var cal = $(e.target).closest(".drp-calendar"),
                              isLeft = cal.hasClass("left");
                      
                            var hour = parseInt(cal.find(".hourselect").val(), 10);
                      Severity: Minor
                      Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

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

                            hoverDate: function (e) {
                              //ignore dates that can't be selected
                              if (!$(e.target).hasClass("available")) return;
                        
                              var title = $(e.target).attr("data-title");
                        Severity: Minor
                        Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

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

                              setEndDate: function (endDate) {
                                if (typeof endDate === "string")
                                  this.endDate = moment(endDate, this.locale.format);
                          
                                if (typeof endDate === "object") this.endDate = moment(endDate);
                          Severity: Minor
                          Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

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

                                setStartDate: function (startDate) {
                                  if (typeof startDate === "string")
                                    this.startDate = moment(startDate, this.locale.format);
                            
                                  if (typeof startDate === "object") this.startDate = moment(startDate);
                            Severity: Minor
                            Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

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

                                  show: function (e) {
                                    if (this.isShowing) return;
                              
                                    // Create a click proxy that is private to this instance of datepicker, for unbinding
                                    this._outsideClickProxy = $.proxy(function (e) {
                              Severity: Minor
                              Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

                                Function updateView has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    updateView: function () {
                                      if (this.timePicker) {
                                        this.renderTimePicker("left");
                                        this.renderTimePicker("right");
                                        if (!this.endDate) {
                                Severity: Minor
                                Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (
                                            !this.singleDatePicker &&
                                            this.leftCalendar.month &&
                                            this.rightCalendar.month &&
                                            (this.startDate.format("YYYY-MM") ==
                                  Severity: Major
                                  Found in app/javascript/jquery.ui.daterangepicker.js - About 1 hr to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                if (ampm === "PM" && hour < 12) hour += 12;
                                    Severity: Major
                                    Found in app/javascript/jquery.ui.daterangepicker.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if (ampm === "AM" && hour === 12) hour = 0;
                                      Severity: Major
                                      Found in app/javascript/jquery.ui.daterangepicker.js - About 45 mins to fix

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

                                                if (this.timePicker) {
                                                  var hour = parseInt(
                                                    this.container.find(".right .hourselect").val(),
                                                    10
                                                  );
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 day to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1541..1559

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

                                        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.timePicker) {
                                                  var hour = parseInt(
                                                    this.container.find(".left .hourselect").val(),
                                                    10
                                                  );
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 day to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1568..1586

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

                                        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.endDate) {
                                                  hour = parseInt(this.container.find(".left .hourselect").val(), 10);
                                                  minute = parseInt(
                                                    this.container.find(".left .minuteselect").val(),
                                                    10
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 7 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 705..719

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

                                        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 {
                                                  hour = parseInt(this.container.find(".right .hourselect").val(), 10);
                                                  minute = parseInt(
                                                    this.container.find(".right .minuteselect").val(),
                                                    10
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 7 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 691..705

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

                                        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.maxDate && this.startDate.isAfter(this.maxDate)) {
                                                this.startDate = this.maxDate.clone();
                                                if (this.timePicker && this.timePickerIncrement)
                                                  this.startDate.minute(
                                                    Math.floor(this.startDate.minute() / this.timePickerIncrement) *
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 4 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 523..530

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

                                        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.minDate && this.startDate.isBefore(this.minDate)) {
                                                this.startDate = this.minDate.clone();
                                                if (this.timePicker && this.timePickerIncrement)
                                                  this.startDate.minute(
                                                    Math.round(this.startDate.minute() / this.timePickerIncrement) *
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 4 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 532..539

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

                                        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.maxDate) {
                                                if (
                                                  year > this.maxDate.year() ||
                                                  (year == this.maxDate.year() && month > this.maxDate.month())
                                                ) {
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 3 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1688..1696

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

                                        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.minDate) {
                                                if (
                                                  year < this.minDate.year() ||
                                                  (year == this.minDate.year() && month < this.minDate.month())
                                                ) {
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 3 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1698..1706

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

                                        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.minDate &&
                                                  calendar[row][col].format("YYYY-MM-DD") ==
                                                    this.minDate.format("YYYY-MM-DD") &&
                                                  calendar[row][col].isBefore(this.minDate) &&
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 3 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 797..805

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 105.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                  if (selected.second() == i && !disabled) {
                                                    html +=
                                                      '<option value="' +
                                                      i +
                                                      '" selected="selected">' +
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 3 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1135..1151

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 105.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (
                                                  this.maxDate &&
                                                  calendar[row][col].format("YYYY-MM-DD") ==
                                                    this.maxDate.format("YYYY-MM-DD") &&
                                                  calendar[row][col].isAfter(this.maxDate) &&
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 3 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 787..795

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 105.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (selected.minute() == i && !disabled) {
                                                  html +=
                                                    '<option value="' +
                                                    i +
                                                    '" selected="selected">' +
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 3 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1171..1187

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 105.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (
                                                  this.leftCalendar.month.format("YYYY-MM") !=
                                                    this.startDate.format("YYYY-MM") &&
                                                  this.rightCalendar.month.format("YYYY-MM") !=
                                                    this.startDate.format("YYYY-MM")
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 674..685

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 81.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              if (
                                                this.maxDate &&
                                                this.linkedCalendars &&
                                                !this.singleDatePicker &&
                                                this.rightCalendar.month > this.maxDate
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 661..672

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 81.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              this.container
                                                .find(".drp-selected")
                                                .html(
                                                  this.startDate.format(this.locale.format) +
                                                    this.locale.separator +
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 616..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 79.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                this.container
                                                  .find(".drp-selected")
                                                  .html(
                                                    this.startDate.format(this.locale.format) +
                                                      this.locale.separator +
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 578..584

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

                                        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 {
                                                this.rightCalendar.month.month(month).year(year);
                                                if (this.linkedCalendars)
                                                  this.leftCalendar.month = this.rightCalendar.month
                                                    .clone()
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1708..1714

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 77.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              if (isLeft) {
                                                this.leftCalendar.month.month(month).year(year);
                                                if (this.linkedCalendars)
                                                  this.rightCalendar.month = this.leftCalendar.month
                                                    .clone()
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 2 hrs to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1714..1720

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 77.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                  !this.singleDatePicker &&
                                                  this.leftCalendar.month &&
                                                  this.rightCalendar.month &&
                                                  (this.startDate.format("YYYY-MM") ==
                                                    this.leftCalendar.month.format("YYYY-MM") ||
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 632..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 70.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.container
                                              .find(".drp-buttons")
                                              .on(
                                                "click.daterangepicker",
                                                "button.applyBtn",
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 440..443

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.container
                                              .find(".drp-calendar")
                                              .on("click.daterangepicker", ".prev", $.proxy(this.clickPrev, this))
                                              .on("click.daterangepicker", ".next", $.proxy(this.clickNext, this))
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 474..485

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                  if (
                                                    this.startDate.format(format) ==
                                                      this.ranges[range][0].format(format) &&
                                                    this.endDate.format(format) == this.ranges[range][1].format(format)
                                                  ) {
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1628..1640

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                  if (
                                                    this.startDate.format("YYYY-MM-DD") ==
                                                      this.ranges[range][0].format("YYYY-MM-DD") &&
                                                    this.endDate.format("YYYY-MM-DD") ==
                                                      this.ranges[range][1].format("YYYY-MM-DD")
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1614..1625

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                  } else {
                                                    monthHtml +=
                                                      "<option value='" +
                                                      m +
                                                      "'" +
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 848..857

                                        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

                                                  ) {
                                                    monthHtml +=
                                                      "<option value='" +
                                                      m +
                                                      "'" +
                                        Severity: Major
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 1 hr to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 857..866

                                        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

                                                if (
                                                  maxDate &&
                                                  selected.clone().hour(0).minute(0).second(0).isAfter(maxDate)
                                                )
                                                  pm_html = ' disabled="disabled" class="disabled"';
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 55 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1203..1207

                                        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 (
                                                  minDate &&
                                                  selected.clone().hour(12).minute(0).second(0).isBefore(minDate)
                                                )
                                                  am_html = ' disabled="disabled" class="disabled"';
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 55 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1209..1213

                                        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

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

                                                if (this.container.offset().left < 0) {
                                                  this.container.css({
                                                    right: "auto",
                                                    left: 9,
                                                  });
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1304..1309

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              var date = cal.hasClass("left")
                                                ? this.leftCalendar.calendar[row][col]
                                                : this.rightCalendar.calendar[row][col];
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1526..1528

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              var date = cal.hasClass("left")
                                                ? this.leftCalendar.calendar[row][col]
                                                : this.rightCalendar.calendar[row][col];
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1484..1486

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (this.container.offset().left < 0) {
                                                  this.container.css({
                                                    right: "auto",
                                                    left: 9,
                                                  });
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1288..1293

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

                                        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 (dateString.length === 2) {
                                                start = moment(dateString[0], this.locale.format);
                                                end = moment(dateString[1], this.locale.format);
                                              }
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 316..322

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

                                        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 (split.length == 2) {
                                                  start = moment(split[0], this.locale.format);
                                                  end = moment(split[1], this.locale.format);
                                                } else if (this.singleDatePicker && val !== "") {
                                                  start = moment(val, this.locale.format);
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1782..1785

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

                                        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 {
                                                this.rightCalendar.month.add(1, "month");
                                                if (this.linkedCalendars) this.leftCalendar.month.add(1, "month");
                                              }
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1456..1459

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 51.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              if (cal.hasClass("left")) {
                                                this.leftCalendar.month.subtract(1, "month");
                                                if (this.linkedCalendars) this.rightCalendar.month.subtract(1, "month");
                                              } else {
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 50 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1469..1472

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 51.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              if (typeof options.locale.monthNames === "object")
                                                this.locale.monthNames = options.locale.monthNames.slice();
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 40 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 153..154

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 48.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                              if (typeof options.locale.daysOfWeek === "object")
                                                this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 40 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 156..157

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 48.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                containerTop =
                                                  this.element.offset().top +
                                                  this.element.outerHeight() -
                                                  parentOffset.top;
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 30 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1266..1269

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 45.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                containerTop =
                                                  this.element.offset().top -
                                                  this.container.outerHeight() -
                                                  parentOffset.top;
                                        Severity: Minor
                                        Found in app/javascript/jquery.ui.daterangepicker.js and 1 other location - About 30 mins to fix
                                        app/javascript/jquery.ui.daterangepicker.js on lines 1271..1274

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 45.

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

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

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

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

                                        Refactorings

                                        Further Reading

                                        There are no issues that match your filters.

                                        Category
                                        Status