estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function StackedBar has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.StackedBar = function (data, options) {

        chart.StackedBar.defaults = {
                  inGraphDataShow: false,
                  inGraphDataPaddingX: 0,
Severity: Major
Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

    Method update has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def update
        authorize! :manage_estimation_widgets, @project
    
        @views_widget = ViewsWidget.find(params[:id])
        @view_id = @views_widget.view_id
    Severity: Major
    Found in app/controllers/views_widgets_controller.rb - About 2 hrs to fix

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

                      var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || jsPlumb.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || jsPlumb.Defaults.EndpointStyle;
      Severity: Major
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 2 other locations - About 2 hrs to fix
      app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5761..5766
      app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5783..5783

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

      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

                      var ep = params.endpoints[index] 
                              || params.endpoint
                              || _jsPlumb.Defaults.Endpoints[index]
                              || jsPlumb.Defaults.Endpoints[index]
                              || _jsPlumb.Defaults.Endpoint
      Severity: Major
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 2 other locations - About 2 hrs to fix
      app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5770..5770
      app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5783..5783

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

      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

                      var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || jsPlumb.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || jsPlumb.Defaults.EndpointHoverStyle;
      Severity: Major
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 2 other locations - About 2 hrs to fix
      app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5761..5766
      app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5770..5770

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

      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

      $jit.ST.Label.SVG = new Class({
        Implements: [$jit.ST.Label.DOM, Graph.Label.SVG],
      
        initialize: function(viz) {
          this.viz = viz;
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jit-2.0.1.js on lines 9773..9779

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

      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 lg = ctx.createRadialGradient(posx + (width - offset)/2, 
                                                posy + (height - offset)/2, 1, 
                                                posx + (width-offset)/2, posy + (height-offset)/2, 
                                                width < height? height : width);
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jit-2.0.1.js on lines 15734..15735

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

      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 ((angle > jsGraphAnnotate[ctx.canvas.id][i][5] && angle < jsGraphAnnotate[ctx.canvas.id][i][6]) || (angle > jsGraphAnnotate[ctx.canvas.id][i][5]-2*Math.PI && angle < jsGraphAnnotate[ctx.canvas.id][i][6]-2*Math.PI)|| (angle > jsGraphAnnotate[ctx.canvas.id][i][5]+2*Math.PI && angle < jsGraphAnnotate[ctx.canvas.id][i][6]+2*Math.PI)) {
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/ChartNew.js on lines 426..426

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

      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

      $jit.ST.Label.HTML = new Class({
        Implements: [$jit.ST.Label.DOM, Graph.Label.HTML],
      
        initialize: function(viz) {
          this.viz = viz;
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jit-2.0.1.js on lines 9751..9757

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

      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 lg = ctx.createRadialGradient(posx + (width-offst)/2, posy + (height-offst)/2, 1, 
                    posx + (width-offst)/2, posy + (height-offst)/2, width < height? height : width);
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/jit-2.0.1.js on lines 14265..14268

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

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

          'render': function(from, to, r, canvas){
            var ctx = canvas.getCtx();  
            var centerOfCircle = computeArcThroughTwoPoints(from, to);
            if (centerOfCircle.a > 1000 || centerOfCircle.b > 1000
                || centerOfCircle.ratio < 0) {
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

        Function draw has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                this.draw = function(component, currentConnectionPaintStyle) {
        
                    var hxy, mid, txy, tail, cxy;
                    if (component.pointAlongPathFrom) {
        
        
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 2 hrs to fix

          Function format has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  format: function(table, c, wo){
                      var time, klass, $el, $tar,
                          t = ts.themes,
                          $t = c.$table,
                          theme = c.theme !== 'default' ? c.theme : wo.uitheme || 'jui',
          Severity: Major
          Found in app/assets/javascripts/pager.js - About 2 hrs to fix

            Function calculateDrawingSizes has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function calculateDrawingSizes() {
                        var midX, mxlb,maxL,maxR,iter,nbiter,prevMaxSize,prevMidX;                        
            
                        var rotationDegree = (2 * Math.PI) / data.datasets[0].data.length;
                        var rotateAngle=config.startAngle*Math.PI/180;
            Severity: Major
            Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

              File users_controller.rb has 255 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              class UsersController < ApplicationController
                require 'securerandom'
              
                #before_filter :verify_authentication, :except => [:show, :create_inactive_user]
                before_filter :load_data, :only => [:update, :edit, :new, :create, :create_inactive_user]
              Severity: Minor
              Found in app/controllers/users_controller.rb - About 2 hrs to fix

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

                function mergeChartConfig(defaults, userDefined) {
                        var returnObj = {};
                        for (var attrname in defaults) { returnObj[attrname] = defaults[attrname]; }
                        for (var attrname in userDefined) { returnObj[attrname] = userDefined[attrname]; }
                        return returnObj;
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/ChartNew.js on lines 3997..4002

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

                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

                    function mergeChartConfig(defaults, userDefined) {
                        var returnObj = {};
                        for (var attrname in defaults) { returnObj[attrname] = defaults[attrname]; }
                        for (var attrname in userDefined) { returnObj[attrname] = userDefined[attrname]; }
                        return returnObj;
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/ChartNew.js on lines 240..245

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

                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, l=prop.length; i < l; i++) {
                                adj[accessors[p].setter](prop[i], adj[accessors[p].getter](prop[i]), 'start');
                              }
                Severity: Major
                Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/jit-2.0.1.js on lines 6888..6890

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

                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, l=prop.length; i < l; i++) {
                              node[accessors[p].setter](prop[i], node[accessors[p].getter](prop[i]), 'start');
                            }
                Severity: Major
                Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/jit-2.0.1.js on lines 6897..6899

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

                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

                    $.tablesorter.addParser({
                        id: "inputs",
                        is: function(){
                            return false;
                        },
                Severity: Major
                Found in app/assets/javascripts/pager.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/pager.js on lines 2952..2961

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

                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

                Severity
                Category
                Status
                Source
                Language