Undev/redmine-stuff-to-do-plugin

View on GitHub
assets/javascripts/ui/ui.selectable.js

Summary

Maintainability
D
2 days
Test Coverage

Function _mouseDrag has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _mouseDrag: function(event) {
        var self = this;
        this.dragged = true;

        if (this.options.disabled)
Severity: Major
Found in assets/javascripts/ui/ui.selectable.js - About 2 hrs to fix

    Function _mouseStart has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _mouseStart: function(event) {
            var self = this;
    
            this.opos = [event.pageX, event.pageY];
    
    
    Severity: Minor
    Found in assets/javascripts/ui/ui.selectable.js - About 1 hr to fix

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

          _mouseStop: function(event) {
              var self = this;
      
              this.dragged = false;
      
      
      Severity: Minor
      Found in assets/javascripts/ui/ui.selectable.js - About 1 hr to fix

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

            _init: function() {
                var self = this;
        
                this.element.addClass("ui-selectable");
        
        
        Severity: Minor
        Found in assets/javascripts/ui/ui.selectable.js - About 1 hr to fix

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

                              if (!event.metaKey && !selectee.startselected) {
                                  selectee.$element.removeClass('ui-selected');
                                  selectee.selected = false;
          
                                  selectee.$element.addClass('ui-unselecting');
          Severity: Major
          Found in assets/javascripts/ui/ui.selectable.js and 1 other location - About 3 hrs to fix
          assets/javascripts/ui/ui.selectable.js on lines 100..111

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

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

                      if (!event.metaKey) {
                          selectee.$element.removeClass('ui-selected');
                          selectee.selected = false;
                          selectee.$element.addClass('ui-unselecting');
                          selectee.unselecting = true;
          Severity: Major
          Found in assets/javascripts/ui/ui.selectable.js and 1 other location - About 3 hrs to fix
          assets/javascripts/ui/ui.selectable.js on lines 191..203

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

          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

                      self.element.triggerHandler("selectableunselected", [event, {
                          selectable: self.element[0],
                          unselected: selectee.element,
                          options: options
                      }], options.unselected);
          Severity: Minor
          Found in assets/javascripts/ui/ui.selectable.js and 1 other location - About 50 mins to fix
          assets/javascripts/ui/ui.selectable.js on lines 235..239

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

          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

                      self.element.triggerHandler("selectableselected", [event, {
                          selectable: self.element[0],
                          selected: selectee.element,
                          options: options
                      }], options.selected);
          Severity: Minor
          Found in assets/javascripts/ui/ui.selectable.js and 1 other location - About 50 mins to fix
          assets/javascripts/ui/ui.selectable.js on lines 223..227

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

          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

                          hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
          Severity: Minor
          Found in assets/javascripts/ui/ui.selectable.js and 1 other location - About 30 mins to fix
          assets/javascripts/ui/ui.selectable.js on lines 144..144

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

          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

                          hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
          Severity: Minor
          Found in assets/javascripts/ui/ui.selectable.js and 1 other location - About 30 mins to fix
          assets/javascripts/ui/ui.selectable.js on lines 142..142

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

          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