estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

                _super.addSegment("Bezier", {
                    x1:_tx, y1:_ty, x2:_sx, y2:_sy,
                    cp1x:_controlPoint[0], cp1y:_controlPoint[1],
                    cp2x:_controlPoint[0], cp2y:_controlPoint[1]
                });                
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 6816..6819

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

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(Math.max(l,k)-c<B)return e=a[b].x-a[0].x,m=a[b].y-a[0].y,f[0]=0+1*(e*(a[0].y-0)-m*(a[0].x-0))*(1/(0*e-1*m)),1}v(a,b,0.5,g,h);a=u(g,b,e,d+1);b=u(h,b,m,d+1);for(d=0;d<a;d++)f[d]=e[d];for(d=0;d<b;d++)f[d+a]=m[d];return a+b},v=function(a,b,f,d,g){for(var h=[[]],e=0;e<=b;e++)h[0][e]=a[e];for(a=1;a<=b;a++)for(e=0;e<=b-a;e++)h[a]||(h[a]=[]),h[a][e]||(h[a][e]={}),h[a][e].x=(1-f)*h[a-1][e].x+f*h[a-1][e+1].x,h[a][e].y=(1-f)*h[a-1][e].y+f*h[a-1][e+1].y;if(null!=d)for(e=0;e<=b;e++)d[e]=h[e][0];if(null!=g)for(e=
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 9639..9639

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

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.addClass = function(c, informEndpoints) {
            _ac(c);
            if (informEndpoints) {
                self.endpoints[0].addClass(c);
                self.endpoints[1].addClass(c);                    
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 5630..5636

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

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.removeClass = function(c, informEndpoints) {
            _rc(c);
            if (informEndpoints) {
                self.endpoints[0].removeClass(c);
                self.endpoints[1].removeClass(c);                    
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 5623..5629

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

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

    $("#group_id").change(
            function () {
              $.ajax({ url:'/load_security_for_selected_group',
                data:'group_id=' + this.value + '&project_id=' + $('#project_id').val()
              })
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 288..294

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

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

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

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

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

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

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

           construct: function(json) {
              var isGraph = ($.type(json) == 'array');
              var ans = new Graph(this.graphOptions, this.config.Node, this.config.Edge, this.config.Label);
              if(!isGraph) 
                  //make tree
      Severity: Minor
      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

          , show: function () {
              var $tip
                , pos
                , actualWidth
                , actualHeight
        Severity: Minor
        Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

          Method is_validate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def is_validate(val)
              pe_attribute = self.pe_attribute
              #if value is mandatory and not fill => false
              if self.is_mandatory and val.blank?
                false
          Severity: Minor
          Found in app/models/estimation_value.rb - About 1 hr to fix

            Method compute_probable_value has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def compute_probable_value(minimum, most_likely, maximum, estimation_value=nil)
                # Get the number of not null value
                input_data = {:min => minimum, :ml => most_likely, :max => maximum}
                not_integer_or_float = Array.new
                sum_of_not_null = 0.0
            Severity: Minor
            Found in app/helpers/module_projects_helper.rb - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if ((params.isTarget || forceInit) && jpcl.isDropSupported(_element)) {
                              var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || jsPlumb.Defaults.DropOptions;
                              dropOptions = jsPlumb.extend( {}, dropOptions);
                              dropOptions.scope = dropOptions.scope || self.scope;
                              var dropEvent = jpcl.dragEvents['drop'],
              Severity: Critical
              Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                                            if (cv === '' || wo.filter_serversideFiltering){
                                                $tb.children().show().removeClass(wo.filter_filteredRow);
                                            } else {
                                                // optimize searching only through already filtered rows - see #313
                                                searchFiltered = true;
                Severity: Critical
                Found in app/assets/javascripts/pager.js - About 1 hr to fix

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

                      if(type == 'current') {
                        data = this.data;
                      } else if(type == 'start') {
                        data = this.startData;
                      } else if(type == 'end') {
                  Severity: Major
                  Found in app/assets/javascripts/jit-2.0.1.js and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/jit-2.0.1.js on lines 4210..4216
                  app/assets/javascripts/jit-2.0.1.js on lines 4698..4704

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

                  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(type == "current") {
                          pos = this.pos;
                        } else if(type == "end") {
                          pos = this.endPos;
                        } else if(type == "start") {
                  Severity: Major
                  Found in app/assets/javascripts/jit-2.0.1.js and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/jit-2.0.1.js on lines 4183..4189
                  app/assets/javascripts/jit-2.0.1.js on lines 4210..4216

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

                  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(type == 'current') {
                        data = this.data;
                      } else if(type == 'start') {
                        data = this.startData;
                      } else if(type == 'end') {
                  Severity: Major
                  Found in app/assets/javascripts/jit-2.0.1.js and 2 other locations - About 1 hr to fix
                  app/assets/javascripts/jit-2.0.1.js on lines 4183..4189
                  app/assets/javascripts/jit-2.0.1.js on lines 4698..4704

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

                  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

                        'mouseup': function(e, win) {
                          var event = $.event.get(e, win);
                          that.handleEvent('MouseUp', e, win, 
                              that.makeEventObject(e, win), 
                              $.event.isRightClick(event));
                  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 1992..1996

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

                  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

                        'mousedown': function(e, win) {
                          var event = $.event.get(e, win);
                          that.handleEvent('MouseDown', e, win, that.makeEventObject(e, win), 
                              $.event.isRightClick(event));
                        },
                  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 1986..1991

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

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

                      ts.storage = function(table, key, value, options) {
                          table = $(table)[0];
                          var cookieIndex, cookies, date,
                              hasLocalStorage = false,
                              values = {},
                  Severity: Minor
                  Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

                    Function computePositions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      computePositions: function(par, ch, orn, prop) {
                        //compute children areas
                        var totalArea = 0;
                        par.eachSubnode(function(n) {
                          totalArea += n.getData('area', prop);
                    Severity: Minor
                    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language