estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Method show_element_name has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

  def show_element_name(element)
    if element.attributes.has_key? 'record_status_id'
      if element.is_root?
        "<span class='#{h element.record_status.to_s }'>#{h element.name} </span>"
      else
Severity: Minor
Found in app/helpers/wbs_activity_elements_helper.rb - About 7 hrs 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 drawPicker has 193 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function drawPicker(x, y) {
            if(!jscolor.picker) {
                jscolor.picker = {
                    box : document.createElement('div'),
                    boxB : document.createElement('div'),
Severity: Major
Found in app/assets/javascripts/jscolor.js - About 7 hrs to fix

    File views_widgets_helper.rb has 478 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ViewsWidgetsHelper
    
      # Get the label widget data
      def get_label_widget_data(view_widget_id)
        view_widget = ViewsWidget.find(view_widget_id)
    Severity: Minor
    Found in app/helpers/views_widgets_helper.rb - About 7 hrs to fix

      Method initialize has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

        def initialize(user, organization)
      
          #Uncomment in order to authorize everybody to manage all the app
          if Rails.env == "test" || user.super_admin == true
            can :manage, :all
      Severity: Minor
      Found in app/models/ability.rb - About 7 hrs 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 Tree has 180 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Layouts.Tree = (function() {
        //Layout functions
        var slice = Array.prototype.slice;
      
        /*
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js - About 7 hrs to fix

        Function AbstractConnector has 173 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            jsPlumb.Connectors.AbstractConnector = function(params) {
                
                AbstractComponent.apply(this, arguments);
        
                var self = this,
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 6 hrs to fix

          Method get_chart_data_by_phase_and_profile has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

            def get_chart_data_by_phase_and_profile(pbs_project_element, module_project, estimation_value, view_widget)
              result = String.new
              stacked_data = Array.new
              profiles_wbs_data = Hash.new
              probable_est_value = estimation_value.send("string_data_probable")
          Severity: Minor
          Found in app/helpers/views_widgets_helper.rb - About 6 hrs 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 checkout has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

            def checkout
              old_prj = Project.find(params[:project_id])
          
              authorize! :commit_project, old_prj
          
          
          Severity: Minor
          Found in app/controllers/projects_controller.rb - About 6 hrs 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 save_estimation_results has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

            def save_estimation_results(start_module_project, input_attributes, output_data)
              #@project = current_project
              authorize! :execute_estimation_plan, @project
          
              @pbs_project_element = current_component
          Severity: Minor
          Found in app/controllers/projects_controller.rb - About 6 hrs 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 _compute has 160 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this._compute = function(paintInfo, params) {
                      
                      if (params.clearEdits)
                          userSuppliedSegments = null;
                      
          Severity: Major
          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 6 hrs to fix

            Method execute_duplication has 157 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def execute_duplication(project_id, new_organization_id)
                #begin
                  old_prj = Project.find(project_id)
                  new_organization = Organization.find(new_organization_id)
            
            
            Severity: Major
            Found in app/controllers/organizations_controller.rb - About 6 hrs to fix

              Method execute_duplication has 156 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def execute_duplication(project_id, new_organization_id, user_id)
              
                  user = User.find(user_id)
              
                  #begin
              Severity: Major
              Found in app/workers/organization_duplicate_project_worker.rb - About 6 hrs to fix

                Function _initDropTarget has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var _initDropTarget = function(canvas, forceInit, isTransient, endpoint) {
                            if ((params.isTarget || forceInit) && jpcl.isDropSupported(_element)) {
                                var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || jsPlumb.Defaults.DropOptions;
                                dropOptions = jsPlumb.extend( {}, dropOptions);
                                dropOptions.scope = dropOptions.scope || self.scope;
                Severity: Major
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 6 hrs to fix

                  Function initializeViz has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    initializeViz: function() {
                      var config = this.config, that = this;
                      var nodeType = config.type.split(":")[0],
                          horz = config.orientation == 'horizontal',
                          nodeLabels = {};
                  Severity: Major
                  Found in app/assets/javascripts/jit-2.0.1.js - About 6 hrs to fix

                    Function overlayCapableJsPlumbUIComponent has 151 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            overlayCapableJsPlumbUIComponent = window.overlayCapableJsPlumbUIComponent = function(params) {
                                jsPlumbUIComponent.apply(this, arguments);
                                var self = this;            
                                this.overlays = [];
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 6 hrs to fix

                      Function initializeViz has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        initializeViz: function() {
                          var config = this.config,
                              that = this,
                              nodeType = config.type.split(":")[0],
                              nodeLabels = {};
                      Severity: Major
                      Found in app/assets/javascripts/jit-2.0.1.js - About 5 hrs to fix

                        Function initialize has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function initialize() {
                        
                                    if (IE) {
                                        container.find("*:not(input)").attr("unselectable", "on");
                                    }
                        Severity: Major
                        Found in app/assets/javascripts/spectrum.js - About 5 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (existing) {
                                          self.endpoints[index] = existing;
                                          existing.addConnection(self);                    
                                      } else {
                                          if (!params.endpoints) params.endpoints = [ null, null ];
                          Severity: Critical
                          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 5 hrs to fix

                            Method display_balancing_input has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def display_balancing_input(module_project, last_estimation_result)
                                pbs_project_element = current_component
                                #Get the current balancing attribute
                                @current_balancing_attribute = current_balancing_attribute
                            
                            
                            Severity: Minor
                            Found in app/helpers/projects_helper.rb - About 5 hrs 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 138 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    format: function(table, c, wo) {
                                        // filter widget doesn't initialize on an empty table. Fixes #449
                                        if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
                                            return;
                                        }
                            Severity: Major
                            Found in app/assets/javascripts/tablesorter.min.js - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language