estimancy/projestimate

View on GitHub
app/assets/javascripts/jquery.gridster.js

Summary

Maintainability
F
3 wks
Test Coverage

File jquery.gridster.js has 2316 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! gridster.js - v0.5.6 - 2014-09-25
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */

;(function(root, factory) {
Severity: Major
Found in app/assets/javascripts/jquery.gridster.js - About 6 days to fix

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

        fn.mutate_widget_in_gridmap = function($widget, wgd, new_wgd) {
            var old_size_x = wgd.size_x;
            var old_size_y = wgd.size_y;
    
            var old_cells_occupied = this.get_cells_occupied(wgd);
    Severity: Major
    Found in app/assets/javascripts/jquery.gridster.js - About 2 hrs to fix

      Function on_resize has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          fn.on_resize = function(event, ui) {
              var rel_x = (ui.pointer.diff_left);
              var rel_y = (ui.pointer.diff_top);
              var wbd_x = this.options.widget_base_dimensions[0];
              var wbd_y = this.options.widget_base_dimensions[1];
      Severity: Major
      Found in app/assets/javascripts/jquery.gridster.js - About 2 hrs to fix

        Function generate_stylesheet has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            fn.generate_stylesheet = function(opts) {
                var styles = '';
                var max_size_x = this.options.max_size_x || this.cols;
                var max_rows = 0;
                var max_cols = 0;
        Severity: Minor
        Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

          Function find_collisions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              fn.find_collisions = function(player_data_coords){
                  var self = this;
                  var overlapping_region = this.options.overlapping_region;
                  var colliders_coords = [];
                  var colliders_data = [];
          Severity: Minor
          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

            Function on_start_resize has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                fn.on_start_resize = function(event, ui) {
                    this.$resized_widget = ui.$player.closest('.gs-w');
                    this.resize_coords = this.$resized_widget.coords();
                    this.resize_wgd = this.resize_coords.grid;
                    this.resize_initial_width = this.resize_coords.coords.width;
            Severity: Minor
            Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

              Function on_stop_drag has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  fn.on_stop_drag = function(event, ui) {
                      this.$helper.add(this.$player).add(this.$wrapper)
                          .removeClass('dragging');
              
                      ui.position.left = ui.position.left + this.baseX;
              Severity: Minor
              Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                Function _traversing_widgets has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    fn._traversing_widgets = function(type, direction, col, row, callback) {
                        var ga = this.gridmap;
                        if (!ga[col]) { return; }
                
                        var cr, max;
                Severity: Minor
                Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                  Function can_go_up_to_row has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      fn.can_go_up_to_row = function(widget_grid_data, col, row) {
                          var ga = this.gridmap;
                          var result = true;
                          var urc = []; // upper_rows_in_columns
                          var actual_row = widget_grid_data.row;
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                        fn.set_placeholder = function(col, row) {
                            var phgd = $.extend({}, this.placeholder_grid_data);
                            var $nexts = this.widgets_below({
                                    col: phgd.col,
                                    row: phgd.row,
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                          fn.on_start_drag = function(event, ui) {
                              this.$helper.add(this.$player).add(this.$wrapper).addClass('dragging');
                      
                              this.highest_col = this.get_highest_occupied_cell().col;
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                            fn.drag_handler = function(e) {
                                var node = e.target.nodeName;
                                // skip if drag is disabled, or click was not done with the mouse primary button
                                if (this.disabled || e.which !== 1 && !isTouch) {
                                    return;
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                          Function can_go_widget_up has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              fn.can_go_widget_up = function(widget_grid_data) {
                                  var p_bottom_row = widget_grid_data.row + widget_grid_data.size_y - 1;
                                  var result = true;
                                  var upper_rows = [];
                                  var min_row = 10000;
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                            Function add_widget has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                fn.add_widget = function(html, size_x, size_y, col, row, max_size, min_size) {
                                    var pos;
                                    size_x || (size_x = 1);
                                    size_y || (size_y = 1);
                            
                            
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                  fn.on_drag = function(event, ui) {
                                      //break if dragstop has been fired
                                      if (this.$player === null) {
                                          return false;
                                      }
                              Severity: Minor
                              Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                    fn.resize_widget = function($widget, size_x, size_y, callback) {
                                        var wgd = $widget.coords().grid;
                                        var col = wgd.col;
                                        var max_cols = this.options.max_cols;
                                        var old_size_y = wgd.size_y;
                                Severity: Minor
                                Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                      fn.set_player = function(col, row, no_player) {
                                          var self = this;
                                          if (!no_player) {
                                              this.empty_cells_player_occupies();
                                          }
                                  Severity: Minor
                                  Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                        fn.get_valid_rows = function(widget_grid_data, upper_rows, min_row) {
                                            var p_top_row = widget_grid_data.row;
                                            var p_bottom_row = widget_grid_data.row + widget_grid_data.size_y - 1;
                                            var size_y = widget_grid_data.size_y;
                                            var r = min_row - 1;
                                    Severity: Minor
                                    Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                          fn.can_go_player_up = function(widget_grid_data) {
                                              var p_bottom_row = widget_grid_data.row + widget_grid_data.size_y - 1;
                                              var result = true;
                                              var upper_rows = [];
                                              var min_row = 10000;
                                      Severity: Minor
                                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                            fn.scroll_in = function(axis, data) {
                                                var dir_prop = dir_map[axis];
                                        
                                                var area_size = 50;
                                                var scroll_inc = 30;
                                        Severity: Minor
                                        Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                              fn.register_widget = function($el) {
                                                  var isDOM = $el instanceof jQuery;
                                                  var wgd = isDOM ? this.dom_to_coords($el) : $el;
                                                  var posChanged = false;
                                                  isDOM || ($el = wgd.el);
                                          Severity: Minor
                                          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                                            Function get_offset has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                fn.get_offset = function(e) {
                                                    e.preventDefault();
                                                    var mouse_actual_pos = this.get_mouse_pos(e);
                                                    var diff_x = Math.round(
                                                        mouse_actual_pos.left - this.mouse_init_pos.left);
                                            Severity: Minor
                                            Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                                              Function move_widget_down has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  fn.move_widget_down = function($widget, y_units) {
                                                      var el_grid_data, actual_row, moved, y_diff;
                                              
                                                      if (y_units <= 0) { return false; }
                                              
                                              
                                              Severity: Minor
                                              Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                                                Function next_position has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    fn.next_position = function(size_x, size_y) {
                                                        size_x || (size_x = 1);
                                                        size_y || (size_y = 1);
                                                        var ga = this.gridmap;
                                                        var cols_l = ga.length;
                                                Severity: Minor
                                                Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                                                  Function move_widget_up has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      fn.move_widget_up = function($widget, y_units) {
                                                          var el_grid_data = $widget.coords().grid;
                                                          var actual_row = el_grid_data.row;
                                                          var moved = [];
                                                          var can_go_up = true;
                                                  Severity: Minor
                                                  Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                                        fn.on_dragstart = function(e) {
                                                            e.preventDefault();
                                                    
                                                            if (this.is_dragging) { return this; }
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                                                          fn.draggable = function() {
                                                              var self = this;
                                                              var draggable_options = $.extend(true, {}, this.options.draggable, {
                                                                  offset_left: this.options.widget_margins[0],
                                                                  offset_top: this.options.widget_margins[1],
                                                      Severity: Minor
                                                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                                                        Function add_widget has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            fn.add_widget = function(html, size_x, size_y, col, row, max_size, min_size) {
                                                        Severity: Major
                                                        Found in app/assets/javascripts/jquery.gridster.js - About 50 mins to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                  if ((b.x1 >= a.x1 && b.x1 <= a.x2) ||
                                                                      (b.x2 >= a.x1 && b.x2 <= a.x2) ||
                                                                      (a.x1 >= b.x1 && a.x2 <= b.x2)
                                                                  ) { x = true; }
                                                          Severity: Major
                                                          Found in app/assets/javascripts/jquery.gridster.js - About 40 mins to fix

                                                            Consider simplifying this complex logical expression.
                                                            Open

                                                                    if ((b.y1 >= a.y1 && b.y1 <= a.y2) ||
                                                                        (b.y2 >= a.y1 && b.y2 <= a.y2) ||
                                                                        (a.y1 >= b.y1 && a.y2 <= b.y2)
                                                                    ) { y = true; }
                                                            Severity: Major
                                                            Found in app/assets/javascripts/jquery.gridster.js - About 40 mins to fix

                                                              Function _traversing_widgets has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                  fn._traversing_widgets = function(type, direction, col, row, callback) {
                                                              Severity: Minor
                                                              Found in app/assets/javascripts/jquery.gridster.js - About 35 mins to fix

                                                                Function empty_cells has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                    fn.empty_cells = function(col, row, size_x, size_y, $exclude) {
                                                                Severity: Minor
                                                                Found in app/assets/javascripts/jquery.gridster.js - About 35 mins to fix

                                                                  Function remove_empty_cells has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                      fn.remove_empty_cells = function(col, row, size_x, size_y, exclude) {
                                                                  Severity: Minor
                                                                  Found in app/assets/javascripts/jquery.gridster.js - About 35 mins to fix

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

                                                                        fn.set_widget_max_size = function($widget, max_size) {
                                                                            $widget = typeof $widget === 'number' ?
                                                                                this.$widgets.eq($widget) : $widget;
                                                                    
                                                                            if (!$widget.length) { return this; }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 4 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1233..1244

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

                                                                    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

                                                                        fn.set_widget_min_size = function($widget, min_size) {
                                                                            $widget = typeof $widget === 'number' ?
                                                                                this.$widgets.eq($widget) : $widget;
                                                                    
                                                                            if (!$widget.length) { return this; }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 4 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1256..1267

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

                                                                    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 ((b.x1 >= a.x1 && b.x1 <= a.x2) ||
                                                                                (b.x2 >= a.x1 && b.x2 <= a.x2) ||
                                                                                (a.x1 >= b.x1 && a.x2 <= b.x2)
                                                                            ) { x = true; }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 3 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 195..198

                                                                    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 ((b.y1 >= a.y1 && b.y1 <= a.y2) ||
                                                                                (b.y2 >= a.y1 && b.y2 <= a.y2) ||
                                                                                (a.y1 >= b.y1 && a.y2 <= b.y2)
                                                                            ) { y = true; }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 3 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 190..193

                                                                    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

                                                                        fn.get_targeted_columns = function(from_col) {
                                                                            var max = (from_col || this.player_grid_data.col) +
                                                                                (this.player_grid_data.size_x - 1);
                                                                            var cols = [];
                                                                            for (var col = from_col; col <= max; col++) {
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 3 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3358..3366

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

                                                                    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

                                                                        fn.get_targeted_rows = function(from_row) {
                                                                            var max = (from_row || this.player_grid_data.row) +
                                                                                (this.player_grid_data.size_y - 1);
                                                                            var rows = [];
                                                                            for (var row = from_row; row <= max; row++) {
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 3 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3340..3348

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

                                                                    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

                                                                            for (i = opts.rows; i >= 0; i--) {
                                                                                styles += (opts.namespace + ' [data-row="' + (i + 1) + '"] { top:' +
                                                                                    ((i * opts.widget_base_dimensions[1]) +
                                                                                    (i * opts.widget_margins[1]) +
                                                                                    ((i + 1) * opts.widget_margins[1]) ) + 'px; }\n');
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3669..3674

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

                                                                    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

                                                                            for (i = opts.cols; i >= 0; i--) {
                                                                                styles += (opts.namespace + ' [data-col="'+ (i + 1) + '"] { left:' +
                                                                                    ((i * opts.widget_base_dimensions[0]) +
                                                                                    (i * opts.widget_margins[0]) +
                                                                                    ((i + 1) * opts.widget_margins[0])) + 'px; }\n');
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3677..3682

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

                                                                    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

                                                                            for (i = 0; i < last_n_rows; i++) {
                                                                                if ($.inArray(this.last_rows[i], rows) === -1) {
                                                                                    (end_callback || $.noop).call(this, this.last_rows[i]);
                                                                                }
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2286..2290

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

                                                                    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

                                                                            for (i = 0; i< last_n_cols; i++) {
                                                                                if ($.inArray(this.last_cols[i], cols) === -1) {
                                                                                    (stop_callback || $.noop).call(this, this.last_cols[i]);
                                                                                }
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2324..2328

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

                                                                    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

                                                                            for (i = 0; i < n_rows; i++) {
                                                                                if ($.inArray(rows[i], this.last_rows) === -1) {
                                                                                    (start_callback || $.noop).call(this, rows[i]);
                                                                                }
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2280..2284

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

                                                                    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

                                                                            for (i = 0; i < n_cols; i++) {
                                                                                if ($.inArray(cols[i], this.last_cols) === -1) {
                                                                                    (start_callback || $.noop).call(this, cols[i]);
                                                                                }
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2318..2322

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

                                                                    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

                                                                            for (var j = 0, jl = new_colliders_coords.length; j < jl; j++) {
                                                                                if ($.inArray(new_colliders_coords[j], last) === -1) {
                                                                                    stop_callback.call(this, new_colliders_coords[j]);
                                                                                }
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 240..244

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

                                                                    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

                                                                            for (var i = 0, il = last.length; i < il; i++) {
                                                                                if ($.inArray(last[i], new_colliders_coords) === -1) {
                                                                                    start_callback.call(this, last[i]);
                                                                                }
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 246..251

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

                                                                    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 (col) {
                                                                                $widgets = $widgets.add(
                                                                                    this.$widgets.filter(function() {
                                                                                        var tcol = $(this).attr('data-col');
                                                                                        return (tcol === col || tcol > col);
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3579..3586

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

                                                                    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 (row) {
                                                                                $widgets = $widgets.add(
                                                                                    this.$widgets.filter(function() {
                                                                                        var trow = $(this).attr('data-row');
                                                                                        return (trow === row || trow > row);
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3570..3577

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

                                                                    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

                                                                        fn.for_each_column_occupied = function(el_grid_data, callback) {
                                                                            for (var i = 0; i < el_grid_data.size_x; i++) {
                                                                                var col = el_grid_data.col + i;
                                                                                callback.call(this, col, el_grid_data);
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3447..3452

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

                                                                    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

                                                                    ;(function(root, factory) {
                                                                    
                                                                        if (typeof define === 'function' && define.amd) {
                                                                            define('gridster-coords', ['jquery'], factory);
                                                                        } else {
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 431..854

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

                                                                    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

                                                                    ;(function(root, factory) {
                                                                    
                                                                        if (typeof define === 'function' && define.amd) {
                                                                            define('gridster-draggable', ['jquery'], factory);
                                                                        } else {
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 5..121

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

                                                                    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

                                                                        fn.for_each_row_occupied = function(el_grid_data, callback) {
                                                                            for (var i = 0; i < el_grid_data.size_y; i++) {
                                                                                var row = el_grid_data.row + i;
                                                                                callback.call(this, row, el_grid_data);
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3428..3433

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

                                                                    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

                                                                            for (var x = 1; x <= max_size_x; x++) {
                                                                                styles += (opts.namespace + ' [data-sizex="' + x + '"] { width:' +
                                                                                    (x * opts.widget_base_dimensions[0] +
                                                                                    (x - 1) * (opts.widget_margins[0] * 2)) + 'px; }\n');
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3684..3688

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

                                                                    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

                                                                            for (var y = 1; y <= opts.rows; y++) {
                                                                                styles += (opts.namespace + ' [data-sizey="' + y + '"] { height:' +
                                                                                    (y * opts.widget_base_dimensions[1] +
                                                                                    (y - 1) * (opts.widget_margins[1] * 2)) + 'px; }\n');
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3690..3694

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

                                                                    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

                                                                            $.each(new_cells_occupied.cols, function(i, col) {
                                                                                if ($.inArray(col, old_cells_occupied.cols) === -1) {
                                                                                    occupied_cols.push(col);
                                                                                }
                                                                            });
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 3 other locations - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1361..1365
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1375..1379
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1382..1386

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

                                                                    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

                                                                            $.each(old_cells_occupied.cols, function(i, col) {
                                                                                if ($.inArray(col, new_cells_occupied.cols) === -1) {
                                                                                    empty_cols.push(col);
                                                                                }
                                                                            });
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 3 other locations - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1368..1372
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1375..1379
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1382..1386

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

                                                                    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

                                                                            $.each(old_cells_occupied.rows, function(i, row) {
                                                                                if ($.inArray(row, new_cells_occupied.rows) === -1) {
                                                                                    empty_rows.push(row);
                                                                                }
                                                                            });
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 3 other locations - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1361..1365
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1368..1372
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1382..1386

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

                                                                    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

                                                                            $.each(new_cells_occupied.rows, function(i, row) {
                                                                                if ($.inArray(row, old_cells_occupied.rows) === -1) {
                                                                                    occupied_rows.push(row);
                                                                                }
                                                                            });
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 3 other locations - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1361..1365
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1368..1372
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1375..1379

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

                                                                    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

                                                                            var left = Math.round(this.el_init_offset.left +
                                                                                diff_x - this.baseX + $(window).scrollLeft() - this.win_offset_x);
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 582..583

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

                                                                    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

                                                                            var top = Math.round(this.el_init_offset.top +
                                                                                diff_y - this.baseY + $(window).scrollTop() - this.win_offset_y);
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 580..581

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

                                                                    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

                                                                                width: (new_wgd.size_x * this.options.widget_base_dimensions[0] +
                                                                                    ((new_wgd.size_x - 1) * this.options.widget_margins[0]) * 2),
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1416..1417

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

                                                                    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

                                                                                height: (new_wgd.size_y * this.options.widget_base_dimensions[1] +
                                                                                    ((new_wgd.size_y - 1) * this.options.widget_margins[1]) * 2)
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1414..1415

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

                                                                    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 (trow > 0 && this.is_widget(col, trow) &&
                                                                                            $.inArray(ga[col][trow], matched) === -1
                                                                                        ) {
                                                                                            cr = callback.call(ga[col][trow], col, trow);
                                                                                            matched.push(ga[col][trow]);
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3486..3492

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

                                                                    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 (this.is_widget(col, trow) &&
                                                                                            $.inArray(ga[col][trow], matched) === -1
                                                                                        ) {
                                                                                            cr = callback.call(ga[col][trow], col, trow);
                                                                                            matched.push(ga[col][trow]);
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3475..3481

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

                                                                    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

                                                                            for (i = 0; i < el_grid_data.size_x; i++) {
                                                                                var col = el_grid_data.col + i;
                                                                                cells.cols.push(col);
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3387..3390

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

                                                                    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

                                                                            for (i = 0; i < el_grid_data.size_y; i++) {
                                                                                var row = el_grid_data.row + i;
                                                                                cells.rows.push(row);
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 1 hr to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 3382..3385

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

                                                                    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

                                                                        fn.enable_resize = function() {
                                                                            this.$el.removeClass('gs-resize-disabled');
                                                                            this.resize_api.enable();
                                                                            return this;
                                                                        };
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 50 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1140..1144

                                                                    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

                                                                        fn.disable_resize = function() {
                                                                            this.$el.addClass('gs-resize-disabled');
                                                                            this.resize_api.disable();
                                                                            return this;
                                                                        };
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 50 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1153..1157

                                                                    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

                                                                            !this.resize_dir.bottom && (css_props.width = Math.max(Math.min(
                                                                                this.resize_initial_width + rel_x, max_width), min_width));
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 50 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2226..2227

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

                                                                    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.resize_dir.right && (css_props.height = Math.max(Math.min(
                                                                                this.resize_initial_height + rel_y, max_height), min_height));
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 50 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2224..2225

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

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

                                                                            if (this.options.resize.start) {
                                                                                this.options.resize.start.call(this, event, ui, this.$resized_widget);
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 2 other locations - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2148..2150
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2247..2249

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

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

                                                                            if (this.options.resize.resize) {
                                                                                this.options.resize.resize.call(this, event, ui, this.$resized_widget);
                                                                            }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 2 other locations - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2117..2119
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2148..2150

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

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

                                                                                if (this.options.resize.stop) {
                                                                                    this.options.resize.stop.call(this, event, ui, this.$resized_widget);
                                                                                }
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 2 other locations - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2117..2119
                                                                    app/assets/javascripts/jquery.gridster.js on lines 2247..2249

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

                                                                    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 (empty_rows.length) {
                                                                                var rows_to_remove_holes = [
                                                                                    new_wgd.col, new_wgd.row, new_wgd.size_x, new_wgd.size_y, $widget
                                                                                ];
                                                                                this.remove_empty_cells.apply(this, rows_to_remove_holes);
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1397..1400

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

                                                                    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 (occupied_rows.length) {
                                                                                var rows_to_empty = [new_wgd.col, new_wgd.row, new_wgd.size_x, new_wgd.size_y, $widget];
                                                                                this.empty_cells.apply(this, rows_to_empty);
                                                                            }
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1438..1443

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

                                                                    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

                                                                                $el.attr({
                                                                                    'data-col': wgd.col,
                                                                                    'data-row': wgd.row,
                                                                                    'data-sizex': wgd.size_x,
                                                                                    'data-sizey': wgd.size_y
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1420..1425

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

                                                                    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

                                                                            $widget.attr({
                                                                                'data-col': new_wgd.col,
                                                                                'data-row': new_wgd.row,
                                                                                'data-sizex': new_wgd.size_x,
                                                                                'data-sizey': new_wgd.size_y
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 40 mins to fix
                                                                    app/assets/javascripts/jquery.gridster.js on lines 1707..1712

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

                                                                    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

                                                                            var $nexts = this.widgets_below({
                                                                                    col: phgd.col,
                                                                                    row: phgd.row,
                                                                                    size_y: phgd.size_y,
                                                                                    size_x: phgd.size_x
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 35 mins to fix
                                                                    app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 6181..6181

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

                                                                    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