estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

                        ctx.lineTo(yAxisPosX + yStart[j] + animPc * HorizontalCalculateOffset(calculatedScale.graphMin + data.datasets[i].data[j], calculatedScale, valueHop) + (config.barStrokeWidth / 2), barOffset + barWidth);
Severity: Major
Found in app/assets/javascripts/ChartNew.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ChartNew.js on lines 2986..2986

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

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

        remove : function(l, v) {
            var idx = jsPlumbUtil.indexOf(l, v);    
            if (idx > -1) l.splice(idx, 1);
            return idx != -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 265..269

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

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

    isZero: function () {
      var almostZero = 0.0001, abs = Math.abs;
      return abs(this.x) < almostZero && abs(this.y) < almostZero;
    }
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 3451..3454

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

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

    isZero: function () {
      var almostZero = 0.0001, abs = Math.abs;
      return abs(this.theta) < almostZero && abs(this.rho) < almostZero;
    },
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 3888..3891

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

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

                    ctx.lineTo(barOffset + barWidth, xAxisPosY - animPc * calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2));
Severity: Major
Found in app/assets/javascripts/ChartNew.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ChartNew.js on lines 2613..2613

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

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

                        ctx.lineTo(yAxisPosX + yStart[j] + animPc * HorizontalCalculateOffset(calculatedScale.graphMin + data.datasets[i].data[j], calculatedScale, valueHop) + (config.barStrokeWidth / 2), barOffset);
Severity: Major
Found in app/assets/javascripts/ChartNew.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ChartNew.js on lines 2987..2987

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

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

                        ctx.lineTo(barOffset + barWidth, xAxisPosY - animPc * calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2));
Severity: Major
Found in app/assets/javascripts/ChartNew.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ChartNew.js on lines 3319..3319

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

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

  onClick: function(id, opt){
    if (this.root != id && !this.busy) {
      this.busy = true;
      this.root = id;
      var that = this;
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

        createLabelContainer: function(type, idLabel, dim) {
          var NS = 'http://www.w3.org/2000/svg';
          if(type == 'HTML' || type == 'Native') {
            return $E('div', {
              'id': idLabel,
    Severity: Minor
    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

        onMouseMove: function(e, win, event) {
         var label, evt = $.event.get(e, win);
         if(this.pressed) {
           this.moved = true;
           this.config.onDragMove(this.pressed, event, evt);
      Severity: Minor
      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                this.setId = function(el, newId, doNotSetAttribute) {
                
                    var id = el.constructor == String ? el : _currentInstance.getId(el),
                        sConns = _currentInstance.getConnections({source:id, scope:'*'}, true),
                        tConns = _currentInstance.getConnections({target:id, scope:'*'}, true);
        Severity: Minor
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                  this.selectEndpoints = function(params) {
                      params = params || {};
                      params.scope = params.scope || "*";
                      var noElementFilters = !params.element && !params.source && !params.target,            
                          elements = noElementFilters ? "*" : prepareList(params.element),
          Severity: Minor
          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                    _updateOffset = function(params) {
                        var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId;
                        if (_suspendDrawing && !timestamp) timestamp = _suspendedAt;
                        if (!recalc) {
                            if (timestamp && timestamp === offsetTimestamps[elId])
            Severity: Minor
            Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                                  opposite:function(axis) {  
                                      var pi = paintInfo,
                                          idx = axis == "x" ? 0 : 1, 
                                          areInProximity = {
                                              "x":function() {                                    
              Severity: Minor
              Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                    _applyStyles = function(parent, node, style, dimensions, uiComponent) {
                        
                        if (style.gradient) {
                            _updateGradient(parent, node, style, dimensions, uiComponent);            
                        }
                Severity: Minor
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                  function select_or_unselect_all(clicked_elt){
                      var mp_id = $(clicked_elt).data("mp_id");
                      var rows_or_cols = $(clicked_elt).data("rows_or_cols");
                      var at_least_one_selected = false;
                      var number_of_elt = 0;
                  Severity: Minor
                  Found in app/assets/javascripts/projestimate_script.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 drawScale has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function drawScale() {
                                  for (var i = 0; i < calculatedScale.steps; i++) {
                                      //If the line object is there
                                      if (config.scaleShowLine) {
                                          ctx.beginPath();
                      Severity: Minor
                      Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                        Method send_feedback has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def send_feedback
                            # No authorize required since everyone can send a feedback if the feature have been enabled using the allow_feedback admin settings.
                            latest_record_version = Version.last.nil? ? Version.create(:comment => 'No update data has been save') : Version.last
                            @latest_repo_update = latest_record_version.repository_latest_update #Home::latest_repo_update
                            @latest_local_update = latest_record_version.local_latest_update
                        Severity: Minor
                        Found in app/controllers/users_controller.rb - About 1 hr to fix

                          Method display_results_without_activities has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def display_results_without_activities(module_project)
                              res = String.new
                              pbs_project_element = @pbs_project_element || current_component
                          
                              pemodule = Pemodule.find(module_project.pemodule.id)
                          Severity: Minor
                          Found in app/helpers/projects_helper.rb - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language