throrin19/materialBootstrap

View on GitHub

Showing 70 of 70 total issues

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

    Dropdown.prototype.toggle = function (e) {
        var $this = $(this);

        if ($this.is('.disabled, :disabled')) return;

Severity: Minor
Found in js/libs/materialbootstrap/dropdown.js - About 1 hr to fix

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

            this.$selector2.css({
                'top'               : (this.$bar.position().top - 5) + 'px',
                'border-color'      : materialColors[this.color],
                'background-color'  : materialColors[this.color]
            });
    Severity: Major
    Found in js/libs/materialbootstrap/slider.js and 1 other location - About 1 hr to fix
    js/libs/materialbootstrap/slider.js on lines 490..494

    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.$selector1.css({
                'top'               : (this.$bar.position().top - 5) + 'px',
                'border-color'      : materialColors[this.color],
                'background-color'  : materialColors[this.color]
            });
    Severity: Major
    Found in js/libs/materialbootstrap/slider.js and 1 other location - About 1 hr to fix
    js/libs/materialbootstrap/slider.js on lines 495..499

    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

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

        Range.prototype.init = function init(opts) {
            opts = $.extend({}, opts, this.roundValues(opts.value1, opts.value2, opts));
    
            if (!materialColors[opts.color]) {
                this.color = 'indigo';
    Severity: Minor
    Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                  if (this.prevX2 == 0) {
                      this.prevX2 = e.pageX;
                      this.left2  = +this.$selector2.css('left').replace('px', '');
                  }
      Severity: Major
      Found in js/libs/materialbootstrap/slider.js and 3 other locations - About 1 hr to fix
      js/libs/materialbootstrap/slider.js on lines 261..264
      js/libs/materialbootstrap/slider.js on lines 515..518
      js/libs/materialbootstrap/slider.js on lines 750..753

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

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

                  if (this.prevX == 0) {
                      this.prevX = e.pageX;
                      this.left  = +this.$selector.css('left').replace('px', '');
                  }
      Severity: Major
      Found in js/libs/materialbootstrap/slider.js and 3 other locations - About 1 hr to fix
      js/libs/materialbootstrap/slider.js on lines 515..518
      js/libs/materialbootstrap/slider.js on lines 550..553
      js/libs/materialbootstrap/slider.js on lines 750..753

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

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

                  if (this.prevX1 == 0) {
                      this.prevX1 = e.pageX;
                      this.left1  = +this.$selector1.css('left').replace('px', '');
                  }
      Severity: Major
      Found in js/libs/materialbootstrap/slider.js and 3 other locations - About 1 hr to fix
      js/libs/materialbootstrap/slider.js on lines 261..264
      js/libs/materialbootstrap/slider.js on lines 550..553
      js/libs/materialbootstrap/slider.js on lines 750..753

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

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

                  if (this.prevX == 0) {
                      this.prevX = e.pageX;
                      this.left  = +this.$selector.css('left').replace('px', '');
                  }
      Severity: Major
      Found in js/libs/materialbootstrap/slider.js and 3 other locations - About 1 hr to fix
      js/libs/materialbootstrap/slider.js on lines 261..264
      js/libs/materialbootstrap/slider.js on lines 515..518
      js/libs/materialbootstrap/slider.js on lines 550..553

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

      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 events has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Selector.prototype.events = function events() {
              this.$selector.bind('mousedown', function () {
                  this.mouseDown();
              }.bind(this));
              $(document).bind('mousemove', function (e) {
      Severity: Minor
      Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

            Slider.prototype.init = function init(opts) {
                var color = opts.color;
                // controls on value
                if (!opts.value) {
                    opts.value = opts.min;
        Severity: Minor
        Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

              function Element(options) {
                  var defaultOptions = {
                          min         : 0,
                          max         : 100,
                          value       : 0,
          Severity: Minor
          Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                Tab.prototype.activate = function (element, container, callback) {
                    var $active    = container.find('> .active');
                    var transition = callback
                        && $.support.transition
                        && $active.hasClass('fade');
            Severity: Minor
            Found in js/libs/materialbootstrap/tab.js - About 1 hr to fix

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

                  Range.prototype.resizeSlider = function resizeSlider() {
                      var originalWidth   = this.$element.width(),
                          width           = originalWidth;
              
                      // placement
              Severity: Minor
              Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                    Selector.prototype.create = function create() {
                        this.$element.addClass('material-slider ' + this.color);
                
                        if (this.opts.disabled === true) {
                            this.$element.addClass('disabled');
                Severity: Minor
                Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                      Tab.prototype.show = function () {
                          var $this    = this.element;
                          var $ul      = $this.closest('ul:not(.dropdown-menu)');
                          var selector = $this.data('target');
                  
                  
                  Severity: Minor
                  Found in js/libs/materialbootstrap/tab.js - About 1 hr to fix

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

                        Slider.prototype.events = function events() {
                            this.$selector.bind('mousedown', function () {
                                this.mouseDown();
                            }.bind(this));
                            $(document).bind('mousemove', function (e) {
                    Severity: Minor
                    Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                          function InputGroupFocus(options) {
                              return this.each(function () {
                                  var $this = $(this),
                                      $addon = $this.find('.text-field-group-addon'),
                                      $input = $this.find('input');
                      Severity: Minor
                      Found in js/libs/materialbootstrap/input.js - About 1 hr to fix

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

                            Range.prototype.mouseMoveRight = function mouseMoveRight(e) {
                                if (this.pressed2 === true && this.opts.disabled !== true) {
                                    if (this.prevX2 == 0) {
                                        this.prevX2 = e.pageX;
                                        this.left2  = +this.$selector2.css('left').replace('px', '');
                        Severity: Minor
                        Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                              Range.prototype.mouseMoveLeft = function mouseMoveLeft(e) {
                                  if (this.pressed1 === true && this.opts.disabled !== true) {
                                      if (this.prevX1 == 0) {
                                          this.prevX1 = e.pageX;
                                          this.left1  = +this.$selector1.css('left').replace('px', '');
                          Severity: Minor
                          Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix

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

                                Selector.prototype.init = function init(opts) {
                                    opts.value = common.roundValue(opts.value, opts);
                            
                                    if (!materialColors[opts.color]) {
                                        this.color = 'indigo';
                            Severity: Minor
                            Found in js/libs/materialbootstrap/slider.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language