estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

 layoutRow: function(ch, w, coord, prop) {
   if(this.layout.horizontal()) {
     return this.layoutV(ch, w, coord, prop);
   } else {
     return this.layoutH(ch, w, coord, prop);
Severity: Major
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jit-2.0.1.js on lines 13526..13532

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

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 (endpoints && endpoints.length) {
                for ( var i = 0, j = endpoints.length; i < j; i++) {
                    endpoints[i].detachAll(params.fireEvent);
                }
            }
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 2248..2252

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

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

                        jsPlumbUtil.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function(e) { return e.id == listToRemoveFrom[i][1].endpoints[idx].id });
Severity: Major
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 3 other locations - About 1 hr to fix
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 3890..3890
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 3899..3899
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 3900..3900

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

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

                jsPlumbUtil.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function(e) { return e.id == listToAddTo[i][1].endpoints[oIdx].id });
Severity: Major
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 3 other locations - About 1 hr to fix
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 3889..3889
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 3890..3890
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 3899..3899

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

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 (endpoints && endpoints.length) {
                    for ( var i = 0, j = endpoints.length; i < j; i++) {
                        endpoints[i].detachAll(params.fireEvent);
                    }
                }
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 2235..2239

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

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

    layoutRow: function(ch, w, coord, prop) {
     if(this.layout.horizontal()) {
       return this.layoutH(ch, w, coord, prop);
     } else {
       return this.layoutV(ch, w, coord, prop);
Severity: Major
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jit-2.0.1.js on lines 13375..13381

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

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

    $("#project_organization_id").change(function(){
        $.ajax({
            url:"/update_organization_estimation_statuses",
            method: 'GET',
            data: {
Severity: Major
Found in app/assets/javascripts/projestimate_script.js and 1 other location - About 1 hr to fix
app/assets/javascripts/projestimate_script.js on lines 203..212

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

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

    $("#select_pbs_project_elements").on('click', function() {
        $.ajax({
            url: "/select_pbs_project_elements",
            method: "get",
            data: {
Severity: Major
Found in app/assets/javascripts/projestimate_script.js and 1 other location - About 1 hr to fix
app/assets/javascripts/projestimate_script.js on lines 577..586

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

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

  initialize: function(controller){
    var $RGraph = $jit.RGraph;

    var config = {
      interpolation: 'linear',
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

      normalizeDims: function() {
        //number of elements
        var root = this.delegate.graph.getNode(this.delegate.root), l=0;
        root.eachAdjacency(function() {
          l++;
    Severity: Minor
    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

              Bezier : function(params) {
                  var self = this,
                      _super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
                      curve = [    
                          { x:params.x1, y:params.y1},
      Severity: Minor
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

            jsPlumb.Overlays.Label = function(params) {
                var self = this;        
                this.labelStyle = params.labelStyle || jsPlumb.Defaults.LabelStyle;
                this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;
                params.create = function() {
        Severity: Minor
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                  var ContinuousAnchor = function(anchorParams) {
                      jsPlumbUtil.EventGenerator.apply(this);
                      this.type = "Continuous";
                      this.isDynamic = true;
                      this.isContinuous = true;
          Severity: Minor
          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                    select: function(event, ui) { //bind click event to link
                        var tab_index =  ui.index+1;
            
                        var anchor_value = "";
                        $(".current_tab").val("tabs-" + tab_index);
            Severity: Minor
            Found in app/assets/javascripts/pager.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 computeThIndexes has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            function computeThIndexes(t) {
                                var matrix = [],
                                    lookup = {},
                                    cols = 0, // determine the number of columns
                                    trs = $(t).find('thead:eq(0), tfoot').children('tr'), // children tr in tfoot - see issue #196
                Severity: Minor
                Found in app/assets/javascripts/pager.js - About 1 hr to fix

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

                          function drawScale() {
                  
                              //X axis line                                                          
                  
                              ctx.lineWidth = config.scaleLineWidth;
                  Severity: Minor
                  Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

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

                            function drawScale() {
                    
                                //X axis line                                                          
                    
                                ctx.lineWidth = config.scaleLineWidth;
                    Severity: Minor
                    Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

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

                              function drawScale() {
                      
                                  //X axis line                                                          
                      
                                  ctx.lineWidth = config.scaleLineWidth;
                      Severity: Minor
                      Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

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

                            function calculateScale(config, maxSteps, minSteps, maxValue, minValue, labelTemplateString) {
                                var graphMin, graphMax, graphRange, stepValue, numberOfSteps, valueRange, rangeOrderOfMagnitude, decimalNum;
                        
                                if (!config.logarithmic) { // no logarithmic scale
                                    valueRange = maxValue - minValue;
                        Severity: Minor
                        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language