Dogfalo/materialize

View on GitHub
js/date_picker/picker.js

Summary

Maintainability
F
4 days
Test Coverage

Function PickerConstructor has 427 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {

    // If there’s no element, return the picker constructor.
    if ( !ELEMENT ) return PickerConstructor

Severity: Major
Found in js/date_picker/picker.js - About 2 days to fix

    File picker.js has 568 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * pickadate.js v3.5.0, 2014/04/13
     * By Amsul, http://amsul.ca
     * Hosted on http://amsul.github.io/pickadate.js
     * Licensed under MIT
    Severity: Major
    Found in js/date_picker/picker.js - About 1 day to fix

      Function prepareElementRoot has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function prepareElementRoot() {
      
              P.$root.
      
                  on({
      Severity: Major
      Found in js/date_picker/picker.js - About 2 hrs to fix

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

                    open: function( dontGiveFocus ) {
        
                        // If it’s already open, do nothing.
                        if ( STATE.open ) return P
        
        
        Severity: Minor
        Found in js/date_picker/picker.js - About 1 hr to fix

          Function start has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      start: function() {
          
                          // If it’s already started, do nothing.
                          if ( STATE && STATE.start ) return P
          
          
          Severity: Minor
          Found in js/date_picker/picker.js - About 1 hr to fix

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

                function prepareElement() {
            
                    $ELEMENT.
            
                        // Store the picker data by component name.
            Severity: Minor
            Found in js/date_picker/picker.js - About 1 hr to fix

              Function prepareElementHidden has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function prepareElementHidden() {
              
                      var name
              
                      if ( SETTINGS.hiddenName === true ) {
              Severity: Minor
              Found in js/date_picker/picker.js - About 1 hr to fix

                Avoid too many return statements within this function.
                Open

                                    return P.component.get( thing )
                Severity: Major
                Found in js/date_picker/picker.js - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status