drhenner/ror_ecommerce

View on GitHub
app/assets/javascripts/jquery.datePicker-2.1.2.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.datePicker-2.1.2.js has 739 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
Severity: Major
Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 day to fix

    Function display has 123 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                display : function(eleAlignTo)
                {
                    if ($(this.ele).is('.dp-disabled')) return;
                    
                    eleAlignTo = eleAlignTo || this.ele;
    Severity: Major
    Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 4 hrs to fix

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

                  _renderCalendar : function()
                  {
                      // set the title...
                      $('h2', this.context).html(Date.monthNames[this.displayedMonth] + ' ' + this.displayedYear);
                      
      Severity: Major
      Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 3 hrs to fix

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

                renderCalendar  :   function(s)
                {
                    var dc = function(a)
                    {
                        return document.createElement(a);
        Severity: Major
        Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 3 hrs to fix

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

                  datePicker : function(s)
                  {            
                      if (!$.event._dpCache) $.event._dpCache = [];
                      
                      // initialise the date picker controller with the relevant settings...
          Severity: Major
          Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 2 hrs to fix

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

                        setSelected : function(d, v, moveToMonth, dispatchEvents)
                        {
                            if (v == this.isSelected(d)) // this date is already un/selected
                            {
                                return;
            Severity: Minor
            Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 hr to fix

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

                          setDisplayedMonth : function(m, y, rerender)
                          {
                              if (this.startDate == undefined || this.endDate == undefined) {
                                  return;
                              }
              Severity: Minor
              Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 1 hr to fix

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

                    var _w = function(f, a1, a2, a3, a4)
                Severity: Minor
                Found in app/assets/javascripts/jquery.datePicker-2.1.2.js - About 35 mins to fix

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

                                  if (this.displayedYear == this.startDate.getFullYear() && this.displayedMonth == this.startDate.getMonth()) {
                                      $('.dp-nav-prev-year', this.context).addClass('disabled');
                                      $('.dp-nav-prev-month', this.context).addClass('disabled');
                                      $('.dp-calendar td.other-month', this.context).each(
                                          function()
                  Severity: Major
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 day to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 946..988

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

                  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.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) {
                                      $('.dp-nav-next-year', this.context).addClass('disabled');
                                      $('.dp-nav-next-month', this.context).addClass('disabled');
                                      $('.dp-calendar td.other-month', this.context).each(
                                          function()
                  Severity: Major
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 day to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 903..945

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

                  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.displayedYear == ed.getFullYear() && this.displayedMonth == ed.getMonth()) {
                                              $('.dp-calendar td.other-month', this.context).each(
                                                  function()
                                                  {
                                                      var $this = $(this);
                  Severity: Major
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 933..943

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

                  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.displayedYear == sd.getFullYear() && this.displayedMonth == sd.getMonth()) {
                                              $('dp-calendar td.other-month', this.context).each(
                                                  function()
                                                  {
                                                      var $this = $(this);
                  Severity: Major
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 976..986

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

                  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.horizontalPosition == $.dpConst.POS_RIGHT) {
                                          $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset);
                                      }
                  Severity: Major
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 822..824

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 69.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                      if (this.verticalPosition == $.dpConst.POS_BOTTOM) {
                                          $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset);
                                      }
                  Severity: Major
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 825..827

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 69.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                                          $('<a class="dp-nav-next-year" href="#" title="' + $.dpText.TEXT_NEXT_YEAR + '">&gt;&gt;</a>')
                                                              .bind(
                                                                  'click',
                                                                  function()
                                                                  {
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 55 mins to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 784..791

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 53.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                                          $('<a class="dp-nav-next-month" href="#" title="' + $.dpText.TEXT_NEXT_MONTH + '">&gt;</a>')
                                                              .bind(
                                                                  'click',
                                                                  function()
                                                                  {
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.datePicker-2.1.2.js and 1 other location - About 55 mins to fix
                  app/assets/javascripts/jquery.datePicker-2.1.2.js on lines 776..783

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 53.

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

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

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

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

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status