estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Function color has 565 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    color : function(target, prop) {


        this.required = true; // refuse empty values?
        this.adjust = true; // adjust value to uniform notation?
Severity: Major
Found in app/assets/javascripts/jscolor.js - About 2 days to fix

    File bootstrap-datepicker.js has 1091 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // ################################# BOOTSTRAP DATE PICKER #################################
    
    /* =========================================================
     * bootstrap-datepicker.js
     * http://www.eyecon.ro/bootstrap-datepicker
    Severity: Major
    Found in app/assets/javascripts/bootstrap-datepicker.js - About 2 days to fix

      File jit-2.0.1-excanvas.js has 1084 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Copyright 2006 Google Inc.
      //
      // Licensed under the Apache License, Version 2.0 (the "License");
      // you may not use this file except in compliance with the License.
      // You may obtain a copy of the License at
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1-excanvas.js - About 2 days to fix

        Method display_inputs_with_activities has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
        Open

          def display_inputs_with_activities(module_project, last_estimation_result=nil)
            pbs_project_element = current_component
            res = String.new
            if module_project.compatible_with(current_component.work_element_type.alias)# || current_component
              pemodule = Pemodule.find(module_project.pemodule.id)
        Severity: Minor
        Found in app/helpers/projects_helper.rb - About 2 days to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File projects_helper.rb has 899 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module ProjectsHelper
        
          # This helper method will display Estimation Result according the estimation purpose (PBS and/or Activities)
          def display_results
            res = String.new
        Severity: Major
        Found in app/helpers/projects_helper.rb - About 2 days to fix

          Method execute_duplication_SAVE has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
          Open

            def execute_duplication_SAVE(project_id, new_organization_id, user_id)
          
              user = User.find(user_id)
          
              #begin
          Severity: Minor
          Found in app/workers/organization_duplicate_project_worker.rb - About 2 days to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          File organizations_controller.rb has 852 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class OrganizationsController < ApplicationController
            load_resource
            require 'rubygems'
            require 'securerandom'
            include ProjectsHelper
          Severity: Major
          Found in app/controllers/organizations_controller.rb - About 2 days to fix

            Function setMeasures has 401 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function setMeasures(data, config, ctx, height, width, ylabels, reverseLegend, reverseAxis, drawAxis, drawLegendOnData) {
               
                    if(config.canvasBackgroundColor != "none") ctx.canvas.style.background =config.canvasBackgroundColor;
            
                    var borderWidth = 0;
            Severity: Major
            Found in app/assets/javascripts/ChartNew.js - About 2 days to fix

              Function AnchorManager has 397 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  jsPlumb.AnchorManager = function(params) {
                      var _amEndpoints = {},
                          continuousAnchors = {},
                          continuousAnchorLocations = {},
                          userDefinedContinuousAnchorLocations = {},        
              Severity: Major
              Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 day to fix

                File jscolor.js has 821 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * jscolor, JavaScript Color Picker
                 *
                 * @version 1.4.3
                 * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
                Severity: Major
                Found in app/assets/javascripts/jscolor.js - About 1 day to fix

                  Function Connection has 380 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      jsPlumb.Connection = function(params) {
                          var self = this, visible = true, _internalHover, _superClassHover,
                              _jsPlumb = params["_jsPlumb"],
                              jpcl = jsPlumb.CurrentLibrary,
                              _att = jpcl.getAttribute,
                  Severity: Major
                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 day to fix

                    File projestimate_script.js has 771 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* ProjEstimate, Open Source project estimation web application
                     * Copyright (c) 2012-2013 Spirula (http://www.spirula.fr)
                     *
                     *    This program is free software: you can redistribute it and/or modify
                     *    it under the terms of the GNU Affero General Public License as
                    Severity: Major
                    Found in app/assets/javascripts/projestimate_script.js - About 1 day to fix

                      Method update has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def update
                          set_page_title 'Edit estimation'
                          @project = Project.find(params[:id])
                          @organization = @project.organization
                      
                      
                      Severity: Minor
                      Found in app/controllers/projects_controller.rb - About 1 day to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                              format: function(table, c, wo){
                                  if (c.parsers && !c.$table.hasClass('hasFilters')){
                                      var i, j, k, l, val, ff, x, xi, st, sel, str,
                                          ft, ft2, $th, rg, s, t, dis, col,
                                          fmt = ts.formatFloat,
                      Severity: Major
                      Found in app/assets/javascripts/pager.js - About 1 day to fix

                        Function ST has 352 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        $jit.ST= (function() {
                            // Define some private methods first...
                            // Nodes in path
                            var nodesInPath = [];
                            // Nodes to contract
                        Severity: Major
                        Found in app/assets/javascripts/jit-2.0.1.js - About 1 day to fix

                          Method update_records has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def self.update_records(external, local, fields)
                              loc_defined_rs_id = RecordStatus.find_by_name('Defined').id
                              loc_custom_rs_id = RecordStatus.find_by_name('Custom').id
                              loc_local_rs_id = RecordStatus.find_by_name('Local').id
                              ext_defined_rs_id = ExternalMasterDatabase::ExternalRecordStatus.find_by_name('Defined').id
                          Severity: Minor
                          Found in app/models/home.rb - About 1 day to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method execute_duplication_SAVE_NOT_WORKING has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def self.execute_duplication_SAVE_NOT_WORKING(project_id, parameters, create_from_template = nil)
                              #Project.transaction do
                                begin
                                  old_prj = Project.find(project_id)
                          
                          
                          Severity: Minor
                          Found in app/models/project.rb - About 1 day to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function doMouseMove has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function doMouseMove(ctx, config, event) {
                          
                              font = "<font face=" + config.annotateFontFamily + " size=" + config.annotateFontSize + "px style=\"font-style:" + config.annotateFontStyle + ";color:" + config.annotateFontColor + "\">";
                          
                              var annotateDIV = document.getElementById('divCursor');
                          Severity: Minor
                          Found in app/assets/javascripts/ChartNew.js - About 1 day to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method load_master_data! has 320 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.load_master_data!
                              db=Home::connect_external_database
                              #begin
                              record_status = ExternalMasterDatabase::ExternalRecordStatus.all
                              record_status.each do |i|
                          Severity: Major
                          Found in app/models/home.rb - About 1 day to fix

                            Method included has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def self.included(base)
                            
                                base.class_eval do
                            
                                  #self relation on master data : Parent<->Child
                            Severity: Minor
                            Found in lib/master_data_helper.rb - About 1 day to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language