estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function calculateDrawingSize has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function calculateDrawingSize() {

            var lgtxt;

            var cumulativeAngle = -config.startAngle * (Math.PI / 180)+2*Math.PI ,
Severity: Minor
Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

    Function calculateDrawingSize has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function calculateDrawingSize() {
    
                var lgtxt;
                var cumulativeAngle = -config.startAngle * (Math.PI / 180)+2*Math.PI ,
                   cumvalue = 0;
    Severity: Minor
    Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

      Method results has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def results
          #No authorize required since everyone can search
          if params[:search].class == Array
            classes = params[:search][:classes].map { |i| String::keep_clean_space(i).camelcase.constantize }
          else
      Severity: Minor
      Found in app/controllers/searches_controller.rb - About 1 hr to fix

        Method update_master_data! has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.update_master_data!
            db=Home::connect_external_database
            puts 'Updating from Master Data...'
        
            #begin
        Severity: Minor
        Found in app/models/home.rb - About 1 hr 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 update_install has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def update_install
          #No authorize required
          begin
              expire_fragment('about_page')
        
        
        Severity: Minor
        Found in app/controllers/homes_controller.rb - About 1 hr 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 display_results has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def display_results
            res = String.new
            unless @project.nil?
              #pbs_project_element = @pbs_project_element || @project.root_component
              pbs_project_element = @pbs_project_element || current_component
        Severity: Minor
        Found in app/helpers/projects_helper.rb - About 1 hr 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 display_value has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def display_value(value, est_val, mp_id)
            module_project = ModuleProject.find(mp_id)
            est_val_pe_attribute = est_val.pe_attribute
            precision = est_val_pe_attribute.precision.nil? ? user_number_precision : est_val_pe_attribute.precision
            if est_val_pe_attribute.alias == "retained_size" || est_val_pe_attribute.alias == "theorical_size"
        Severity: Minor
        Found in app/helpers/projects_helper.rb - About 1 hr 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 set_element_value_with_activities has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def set_element_value_with_activities(estimation_result, module_project)
            authorize! :execute_estimation_plan, @project
        
            result_with_consistency = Hash.new
            consistency = true
        Severity: Minor
        Found in app/controllers/projects_controller.rb - About 1 hr 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 add_wbs_activity_to_project has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def add_wbs_activity_to_project
            @project = Project.find(params[:project_id])
        
            @pe_wbs_project_activity = @project.pe_wbs_projects.activities_wbs.first
            @wbs_project_elements_root = @project.wbs_project_element_root
        Severity: Minor
        Found in app/controllers/projects_controller.rb - About 1 hr 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 getAlignedPos has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            getAlignedPos: function(pos, width, height) {
                var nconfig = this.node;
                var square, orn;
                if(nconfig.align == "center") {
                    square = {
        Severity: Minor
        Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

          Function onCreateLabel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                onCreateLabel: function(domElement, node) {
                  var labelConf = config.Label,
                      valueArray = node.getData('valueArray'),
                      acum = $.reduce(valueArray, function(x, y) { return x + y; }, 0);
                  var nlbs = {
          Severity: Minor
          Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

            Function multipleColumns has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    multipleColumns: function( c, $input ) {
                        // look for multiple columns "1-3,4-6,8" in data-column
                        var ranges, singles, indx,
                            wo = c.widgetOptions,
                        // only target "all" column inputs on initialization
            Severity: Minor
            Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

              Function spectrum has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.spectrum = function (opts, extra) {
              
                      if (typeof opts == "string") {
              
                          var returnValue = this;
              Severity: Minor
              Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

                Function paint has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        this.paint = function(params, containerExtents) {
                            if (path == null) {
                                path = _node("path");
                                params.connector.svg.appendChild(path);
                                self.attachListeners(path, params.connector);
                Severity: Minor
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                  Function makeAnchor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          this.makeAnchor = function() {
                              var _a = function(t, p) {
                                  if (jsPlumb.Anchors[t]) return new jsPlumb.Anchors[t](p);
                                  if (!_currentInstance.Defaults.DoNotThrowErrors)
                                      throw { msg:"jsPlumb: unknown anchor type '" + t + "'" };
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                    Function on_start_drag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        fn.on_start_drag = function(event, ui) {
                            this.$helper.add(this.$player).add(this.$wrapper).addClass('dragging');
                    
                            this.highest_col = this.get_highest_occupied_cell().col;
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                      Function drag_handler has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          fn.drag_handler = function(e) {
                              var node = e.target.nodeName;
                              // skip if drag is disabled, or click was not done with the mouse primary button
                              if (this.disabled || e.which !== 1 && !isTouch) {
                                  return;
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                        Function animationLoop has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function animationLoop(config, drawScale, drawData, ctx, clrx, clry, clrwidth, clrheight, midPosX, midPosY, borderX, borderY, data) {
                        
                                var cntiter=0;
                                
                                if (isIE() < 9 && isIE() != false) config.animation = false;
                        Severity: Minor
                        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                          Method display_balancing_output has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def display_balancing_output(module_project)
                              #pbs_project_element = @pbs_project_element || @project.root_component
                              pbs_project_element = current_component
                          
                              res = String.new
                          Severity: Minor
                          Found in app/helpers/projects_helper.rb - About 1 hr to fix

                            Method create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def create
                                authorize! :manage, User
                            
                                set_page_title 'New user'
                            
                            
                            Severity: Minor
                            Found in app/controllers/users_controller.rb - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language