estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

    ext_pemodules.each do |ext_module|
      ext_attr_modules.each do |ext_attr_module|
        if ext_module.id == ext_attr_module.pemodule_id and ext_module.record_status_id == ext_defined_rs_id
          loc_module = Pemodule.find_by_uuid(ext_module.uuid)
          ext_attr = ExternalMasterDatabase::ExternalPeAttribute.find_by_id(ext_attr_module.pe_attribute_id)
Severity: Major
Found in app/models/home.rb and 1 other location - About 1 hr to fix
app/models/home.rb on lines 413..422

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

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

    ext_pemodules.each do |ext_module|
      ext_attr_modules.each do |ext_attr_module|
        if ext_module.id == ext_attr_module.pemodule_id and ext_module.record_status_id == ext_defined_rs_id
          loc_module = Pemodule.find_by_uuid(ext_module.uuid)
          ext_attr = ExternalMasterDatabase::ExternalPeAttribute.find_by_id(ext_attr_module.pe_attribute_id)
Severity: Major
Found in app/models/home.rb and 1 other location - About 1 hr to fix
app/models/home.rb on lines 80..89

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

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

    'contains': function(node, mpos) {
      var pos = node.pos.getc(true), 
          width = node.getData('width'),
          height = node.getData('height'),
          algnPos = this.getAlignedPos(pos, width, height),
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

        'contains': function(node, mpos) {
          var pos = node.pos.getc(true), 
              width = node.getData('width'),
              height = node.getData('height'),
              algnPos = this.getAlignedPos(pos, width, height),
    Severity: Minor
    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

        enter: function(n){
          if(this.busy) return;
          this.busy = true;
          
          var that = this,
      Severity: Minor
      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

          initialize: function(controller) {
            var config = {
              animate: false,
              orientation: "h",
              offset: 2,
        Severity: Minor
        Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

            updateJSON: function(json, onComplete) {
              if(this.busy) return;
              this.busy = true;
              
              var delegate = this.delegate,
          Severity: Minor
          Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                jsPlumb.Connectors.Bezier = function(params) {
                    params = params || {};
            
                    var self = this,
                        _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments),
            Severity: Minor
            Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

              Method duplicate_wbs_activity has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def duplicate_wbs_activity
                  #Update ancestry depth caching
                  WbsActivityElement.rebuild_depth_cache!
              
                  begin
              Severity: Minor
              Found in app/controllers/wbs_activities_controller.rb - About 1 hr to fix

                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

                        this.setPaintStyle(this.endpoints[0].connectorStyle || 
                                           this.endpoints[1].connectorStyle || 
                                           params.paintStyle || 
                                           _jsPlumb.Defaults.PaintStyle || 
                                           jsPlumb.Defaults.PaintStyle, true);
                Severity: Major
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5847..5851

                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

                        this.setHoverPaintStyle(this.endpoints[0].connectorHoverStyle || 
                                                this.endpoints[1].connectorHoverStyle || 
                                                params.hoverPaintStyle || 
                                                _jsPlumb.Defaults.HoverPaintStyle || 
                                                jsPlumb.Defaults.HoverPaintStyle, true);
                Severity: Major
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5841..5845

                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

                Function onClick has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      onClick: function (id, options) {
                        var canvas = this.canvas, that = this, Geom = this.geom, config = this.config;
                        var innerController = {
                            Move: {
                                enable: true,
                Severity: Minor
                Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                  Function $setRoot has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function $setRoot() {
                                  if(this.config.multitree && clickedNode.data.$orn) {
                                      var orn = clickedNode.data.$orn;
                                      var opp = {
                                              'left': 'right',
                  Severity: Minor
                  Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                    Function paint has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            this.paint = function(style) {        
                                if (style !== null) {                
                                    var segments = self.getSegments(), p = { "path":"" },
                                        d = [self.x,self.y,self.w,self.h];
                                    
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                      Function stopEvent has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      function() {
                                          var originalEvent = jpcl.getDropEvent(arguments);                    
                                          _ju.removeWithFunction(params.endpointsByElement[placeholderInfo.id], function(e) {
                                              return e.id == floatingEndpoint.id;
                                          });
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                              onPlaceLabel: function(domElement, node) {
                                if(!nodeLabels[node.id]) return;
                                var labels = nodeLabels[node.id],
                                    wrapperStyle = labels.wrapper.style,
                                    labelStyle = labels.label.style,
                        Severity: Minor
                        Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language