estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function computeArcThroughTwoPoints has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function computeArcThroughTwoPoints(p1, p2){
        var aDen = (p1.x * p2.y - p1.y * p2.x), bDen = aDen;
        var sq1 = p1.squaredNorm(), sq2 = p2.squaredNorm();
        // Fall back to a straight line
        if (aDen == 0)
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

    Function compute has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      compute: function(graph, prop, opt) {
        this.initializeLabel(opt);
        var label = this.label, style = label.style;
        graph.eachNode(function(n) {
          var autoWidth  = n.getData('autoWidth'),
    Severity: Minor
    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

      Function preprocessSum has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          preprocessSum: function(graph) {
              var viz = this.viz;
              graph.eachNode(function(elem) {
                  if(!viz.graph.hasNode(elem.id)) {
                      viz.graph.addNode(elem);
      Severity: Minor
      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                this.draw = function(component, currentConnectionPaintStyle) {
                    var td = _getDimensions();
                    if (td != null && td.length == 2) {
                        var cxy = {x:0,y:0};
                        if (component.pointOnPath) {
        Severity: Minor
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

          Function SvgEndpoint has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var SvgEndpoint = window.SvgEndpoint = function(params) {
                  var self = this,
                      _super = SvgComponent.apply(this, [ {
                          cssClass:params["_jsPlumb"].endpointClass, 
                          originalArgs:arguments, 
          Severity: Minor
          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

            Function get_offset has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                fn.get_offset = function(e) {
                    e.preventDefault();
                    var mouse_actual_pos = this.get_mouse_pos(e);
                    var diff_x = Math.round(
                        mouse_actual_pos.left - this.mouse_init_pos.left);
            Severity: Minor
            Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

              Function buildSelect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                                  buildSelect = function(i, updating, onlyavail){
                                      var o, t, arry = [], currentVal;
                                      i = parseInt(i, 10);
                                      t = $ths.filter('[data-column="' + i + '"]:last');
                                      // t.data('placeholder') won't work in jQuery older than 1.4.3
              Severity: Minor
              Found in app/assets/javascripts/pager.js - About 1 hr to fix

                Function CanvasRenderingContext2D_ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function CanvasRenderingContext2D_(canvasElement) {
                    this.m_ = createMatrixIdentity();
                
                    this.mStack_ = [];
                    this.aStack_ = [];
                Severity: Minor
                Found in app/assets/javascripts/jit-2.0.1-excanvas.js - About 1 hr to fix

                  Method create_inactive_user has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def create_inactive_user
                      #No authorize required since everyone can ask for new account which will be validated by an Admin
                  
                      unless (params[:email].blank? || params[:first_name].blank? || params[:last_name].blank? || params[:login_name].blank?)
                        user = User.where('login_name = ? OR email = ?', params[:login_name], params[:email]).first
                  Severity: Minor
                  Found in app/controllers/users_controller.rb - About 1 hr to fix

                    Method set_technology_size_type_abacus has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def set_technology_size_type_abacus
                        authorize! :edit_organizations, Organization
                    
                        @organization = Organization.find(params[:organization])
                        @technologies = @organization.organization_technologies
                    Severity: Minor
                    Found in app/controllers/organizations_controller.rb - About 1 hr to fix

                      Method pemodule_input has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def pemodule_input(level, est_val, module_project, level_estimation_values, pbs_project_element, attribute_type="", read_only_value=false)
                      
                          est_val_pe_attribute = est_val.pe_attribute
                          if est_val_pe_attribute.attr_type == 'integer' or est_val_pe_attribute.attr_type == 'float'
                      
                      
                      Severity: Minor
                      Found in app/helpers/projects_helper.rb - About 1 hr to fix

                        Method update_views_and_widgets has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def update_views_and_widgets(new_prj, old_mp, new_mp)
                            #For initialization module level
                            if old_mp.pemodule.alias == Projestimate::Application::INITIALIZATION
                              #Copy the views and widgets for the new project
                              new_view = View.create(organization_id: new_prj.organization_id, name: "#{new_prj.to_s} : view for #{new_mp.to_s}", description: "Please rename the view's name and description if needed.")
                        Severity: Minor
                        Found in app/controllers/projects_controller.rb - About 1 hr to fix

                          Method destroy has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def destroy
                              @project = Project.find(params[:id])
                              authorize! :delete_project, @project
                          
                              is_model = @project.is_model
                          Severity: Minor
                          Found in app/controllers/projects_controller.rb - About 1 hr to fix

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

                                        if (animationDecimal >= 1) {
                                            totvalue = 0;
                                            for (var i = 0; i < data.length; i++) totvalue += data[i].value;
                                        }
                            Severity: Major
                            Found in app/assets/javascripts/ChartNew.js and 2 other locations - About 1 hr to fix
                            app/assets/javascripts/ChartNew.js on lines 1873..1876
                            app/assets/javascripts/ChartNew.js on lines 2073..2076

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

                            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 3 locations. Consider refactoring.
                            Open

                                        if (animationDecimal >= 1) {
                                            totvalue = 0;
                                            for (var i = 0; i < data.length; i++) totvalue += data[i].value;
                                        }
                            Severity: Major
                            Found in app/assets/javascripts/ChartNew.js and 2 other locations - About 1 hr to fix
                            app/assets/javascripts/ChartNew.js on lines 1393..1396
                            app/assets/javascripts/ChartNew.js on lines 2073..2076

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

                            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 3 locations. Consider refactoring.
                            Open

                                        if (animationDecimal >= 1) {
                                            totvalue = 0;
                                            for (var i = 0; i < data.length; i++) totvalue += data[i].value;
                                        }
                            Severity: Major
                            Found in app/assets/javascripts/ChartNew.js and 2 other locations - About 1 hr to fix
                            app/assets/javascripts/ChartNew.js on lines 1393..1396
                            app/assets/javascripts/ChartNew.js on lines 1873..1876

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

                            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

                              Graph.Node.prototype[m] = function() {
                                return Graph.Util[m].apply(Graph.Util, [this].concat(Array.prototype.slice.call(arguments)));
                              };
                            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 5273..5275

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

                            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

                                  return this.nodeHelper.rectangle.contains({x: npos.x + width/2, y: npos.y + height/2}, pos, width, height);
                            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 15768..15768

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

                            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

                                  return this.nodeHelper.rectangle.contains({x: npos.x + width/2, y: npos.y + height/2}, pos, width, height);
                            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 14290..14290

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

                            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

                              Graph.prototype[m] = function() {
                                return Graph.Util[m].apply(Graph.Util, [this].concat(Array.prototype.slice.call(arguments)));
                              };
                            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 5280..5282

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

                            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