angelakuo/citydogshare

View on GitHub
public/assets/materialize/date_picker/picker.date-5924b278beda2df8570f137f72b37e2d0f516acbc11a0994d1abb74380f078ef.js

Summary

Maintainability
F
6 days
Test Coverage

File picker.date-5924b278beda2df8570f137f72b37e2d0f516acbc11a0994d1abb74380f078ef.js has 852 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Date picker for pickadate.js v3.5.0
 * http://amsul.github.io/pickadate.js/date.htm
 */

    Function nodes has 266 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    DatePicker.prototype.nodes = function( isOpen ) {
    
        var
            calendar = this,
            settings = calendar.settings,

      Function DatePicker has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function DatePicker( picker, settings ) {
      
          var calendar = this,
              element = picker.$node[ 0 ],
              elementValue = element.value,

        Function activate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        DatePicker.prototype.activate = function( type, datesToEnable ) {
        
            var calendar = this,
                disabledItems = calendar.item.disable,
                disabledItemsCount = disabledItems.length

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

          DatePicker.prototype.formats = (function() {
          
              // Return the length of the first word in a collection.
              function getWordLengthFromCollection( string, collection, dateObject ) {
          
          

            Function validate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            DatePicker.prototype.validate = function( type, dateObject, options ) {
            
                var calendar = this,
            
                    // Keep a reference to the original date.

              Consider simplifying this complex logical expression.
              Open

                  if ( !options || !options.nav ) if (
                      /* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) ||
                      /* 2 */ ( isFlippedBase && calendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) ||
                      /* 3 */ ( !isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick) )
                  ) {

                Function item has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                item: function( rowCounter ) {
                
                                    // If Monday is the first day and the month starts on Sunday, shift the date back a week.
                                    var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0
                
                

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

                  DatePicker.defaults = (function( prefix ) {
                  
                      return {
                  
                          // The title label to use for the month nav buttons

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

                            createYearLabel = function(override) {
                    
                                var focusedYear = viewsetObject.year,
                    
                                // If years selector is set to a literal "true", set it to 5. Otherwise

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

                              createMonthLabel = function(override) {
                      
                                  var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull
                      
                                   // Materialize modified

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

                                                    item: function( targetDate ) {
                        
                                                        // Convert the time date from a relative date to a target date.
                                                        targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])
                        
                        

                          Function deactivate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          DatePicker.prototype.deactivate = function( type, datesToDisable ) {
                          
                              var calendar = this,
                                  disabledItems = calendar.item.disable.slice(0)
                          
                          

                            Function navigate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            DatePicker.prototype.navigate = function( type, value, options ) {
                            
                                var targetDateObject,
                                    targetYear,
                                    targetMonth,

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

                              DatePicker.prototype.set = function( type, value, options ) {
                              
                                  var calendar = this,
                                      calendarItem = calendar.item
                              
                              

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

                                DatePicker.prototype.create = function( type, value, options ) {
                                
                                    var isInfiniteValue,
                                        calendar = this
                                
                                

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      else if ( _.isDate( unitToEnable ) ) {
                                                          matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
                                                      }

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if ( !matchFound[3] ) matchFound.push( 'inverted' )

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabledAfterTarget && interval > 0 ) || ( !hasEnabledBeforeTarget && interval < 0 ) ) ) {
                                                  interval *= -1
                                              }

                                        Consider simplifying this complex logical expression.
                                        Open

                                                        if (
                                                            _.isInteger( unitToDisable ) ||
                                                            _.isDate( unitToDisable ) ||
                                                            $.isArray( unitToDisable ) ||
                                                            ( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )

                                          There are no issues that match your filters.

                                          Category
                                          Status