Dogfalo/materialize

View on GitHub

Showing 181 of 181 total issues

Function mouseenter.tooltip has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        origin.on({'mouseenter.tooltip': function(e) {
          var showTooltip = function() {
            setAttributes();
            started = true;
            tooltipEl.velocity('stop');
Severity: Major
Found in js/tooltip.js - About 3 hrs to fix

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

                if ( scope_Handles.length > 1 ) {
    
                    if ( lookBackward && handleNumber > 0 ) {
                        to = Math.max(to, reference[handleNumber - 1] + options.margin);
                    }
    Severity: Major
    Found in extras/noUiSlider/nouislider.js and 1 other location - About 3 hrs to fix
    extras/noUiSlider/nouislider.js on lines 1737..1746

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

    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 ( scope_Handles.length > 1 && options.limit ) {
    
                    if ( lookBackward && handleNumber > 0 ) {
                        to = Math.min(to, reference[handleNumber - 1] + options.limit);
                    }
    Severity: Major
    Found in extras/noUiSlider/nouislider.js and 1 other location - About 3 hrs to fix
    extras/noUiSlider/nouislider.js on lines 1723..1732

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

    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

    Function showTooltip has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              var showTooltip = function() {
                setAttributes();
                started = true;
                tooltipEl.velocity('stop');
                backdrop.velocity('stop');
    Severity: Major
    Found in js/tooltip.js - About 3 hrs to fix

      Function placeDropdown has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function placeDropdown(eventType) {
              // Check for simultaneous focus and click events.
              if (eventType === 'focus') {
                isFocused = true;
              }
      Severity: Major
      Found in js/dropdown.js - About 3 hrs to fix

        Function testOptions has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function testOptions ( options ) {
        
                // To prove a fix for #537, freeze options here.
                // If the object is modified, an error will be thrown.
                // Object.freeze(options);
        Severity: Major
        Found in extras/noUiSlider/nouislider.js - About 3 hrs to fix

          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,
          Severity: Major
          Found in js/date_picker/picker.date.js - About 3 hrs to fix

            File search.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function ($) {
              $(document).ready(function() {
                window.index = lunr(function () {
                  this.field('title', {boost: 10});
                  this.field('body');
            Severity: Minor
            Found in jade/search.js - About 3 hrs to fix

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

                  ClockPicker.prototype.show = function(e){
                      // Not show again
                      if (this.isShown) {
                          return;
                      }
              Severity: Major
              Found in js/date_picker/picker.time.js - About 3 hrs to fix

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

                              $interval = setInterval(
                                function(){
                                  $active_index = $slider.find('.active').index();
                                  if ($slides.length == $active_index + 1) $active_index = 0; // loop to start
                                  else $active_index += 1;
                Severity: Major
                Found in js/slider.js and 2 other locations - About 2 hrs to fix
                js/slider.js on lines 253..262
                js/slider.js on lines 272..281

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

                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 3 locations. Consider refactoring.
                Open

                            $interval = setInterval(
                              function(){
                                $active_index = $slider.find('.active').index();
                                if ($slides.length == $active_index + 1) $active_index = 0; // loop to start
                                else $active_index += 1;
                Severity: Major
                Found in js/slider.js and 2 other locations - About 2 hrs to fix
                js/slider.js on lines 118..127
                js/slider.js on lines 272..281

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

                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

                                  $overlay.velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
                                    complete: function () {
                                      // Run 'onClose' when sidenav is closed via touch/swipe if applicable
                                      if (typeof(options.onClose) === 'function') {
                                        options.onClose.call(this, menu);
                Severity: Major
                Found in js/sideNav.js and 1 other location - About 2 hrs to fix
                js/sideNav.js on lines 309..317

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

                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

                                  $overlay.velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
                                    complete: function () {
                                      // Run 'onClose' when sidenav is closed via touch/swipe if applicable
                                      if (typeof(options.onClose) === 'function') {
                                        options.onClose.call(this, menu);
                Severity: Major
                Found in js/sideNav.js and 1 other location - About 2 hrs to fix
                js/sideNav.js on lines 277..285

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

                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 3 locations. Consider refactoring.
                Open

                          $interval = setInterval(
                            function(){
                              $active_index = $slider.find('.active').index();
                              if ($slides.length == $active_index + 1) $active_index = 0; // loop to start
                              else $active_index += 1;
                Severity: Major
                Found in js/slider.js and 2 other locations - About 2 hrs to fix
                js/slider.js on lines 118..127
                js/slider.js on lines 253..262

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

                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

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

                  var FABtoToolbar = function(btn) {
                    if (btn.attr('data-open') === "true") {
                      return;
                    }
                
                
                Severity: Major
                Found in js/buttons.js - About 2 hrs to fix

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

                      $.scrollSpy = function(selector, options) {
                        var defaults = {
                              throttle: 100,
                              scrollOffset: 200, // offset - 200 allows elements near bottom of page to scroll
                              activeClass: 'active',
                  Severity: Major
                  Found in js/scrollspy.js - About 2 hrs to fix

                    Function setHand has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        ClockPicker.prototype.setHand = function(x, y, roundBy5, dragging) {
                            var radian = Math.atan2(x, - y),
                                    isHours = this.currentView === 'hours',
                                    unit = Math.PI / (isHours || roundBy5? 6 : 30),
                                    z = Math.sqrt(x * x + y * y),
                    Severity: Major
                    Found in js/date_picker/picker.time.js - About 2 hrs to fix

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

                                      $('<div id="click-am">AM</div>').on("click", function() {
                                          self.spanAmPm.children('#click-am').addClass("text-primary");
                                          self.spanAmPm.children('#click-pm').removeClass("text-primary");
                                          self.amOrPm = "AM";
                                      }).appendTo(this.spanAmPm);
                      Severity: Major
                      Found in js/date_picker/picker.time.js and 1 other location - About 2 hrs to fix
                      js/date_picker/picker.time.js on lines 155..159

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

                      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

                                      $('<div id="click-pm">PM</div>').on("click", function() {
                                          self.spanAmPm.children('#click-pm').addClass("text-primary");
                                          self.spanAmPm.children('#click-am').removeClass("text-primary");
                                          self.amOrPm = 'PM';
                                      }).appendTo(this.spanAmPm);
                      Severity: Major
                      Found in js/date_picker/picker.time.js and 1 other location - About 2 hrs to fix
                      js/date_picker/picker.time.js on lines 150..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 90.

                      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

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

                          var calculateTapTarget = function() {
                            // Element or parent is fixed position?
                            var isFixed = origin.css('position') === 'fixed';
                            if (!isFixed) {
                              var parents = origin.parents();
                      Severity: Major
                      Found in js/tapTarget.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language