estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Avoid too many return statements within this function.
Open

            else return [ midx + (1 * dx) , midy + (-1 * dy) ];
Severity: Major
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return ts.sortText(table, b, a);
    Severity: Major
    Found in app/assets/javascripts/pager.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];
      Severity: Major
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            if ( xD > yD ) { return 1; }
        Severity: Major
        Found in app/assets/javascripts/pager.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              if (xF > yF) { return 1; }
          Severity: Major
          Found in app/assets/javascripts/pager.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];
            Severity: Major
            Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return 0;
              Severity: Major
              Found in app/assets/javascripts/pager.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    if (xF < yF) { return -1; }
                Severity: Major
                Found in app/assets/javascripts/pager.js - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return false
                  Severity: Major
                  Found in app/models/attribute_module.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                              return false
                    Severity: Major
                    Found in app/models/estimation_value.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return false
                      Severity: Major
                      Found in app/models/attribute_module.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                  redirect_to redirect_apply(edit_project_path(@project, :anchor => session[:anchor]), nil, organization_estimations_path(@project.organization)) and return
                        Severity: Major
                        Found in app/controllers/projects_controller.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                    redirect_to redirect_apply(edit_project_path(@project, :anchor => session[:anchor]), nil, organization_setting_path(@project.organization, anchor: "tabs-estimation-models")) and return
                          Severity: Major
                          Found in app/controllers/projects_controller.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                  redirect_to organization_estimations_path(@current_organization), :flash => {:error => I18n.t(:error_project_checkout_failed)} and return
                            Severity: Major
                            Found in app/controllers/projects_controller.rb - About 30 mins to fix

                              Method project_estimation_statuses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def project_estimation_statuses(organization=nil)
                                  if new_record? || self.estimation_status.nil? #|| !self.organization.estimation_statuses.include?(self.estimation_status)
                                    # For new record
                                    if organization.nil?
                                      nil
                              Severity: Minor
                              Found in app/models/project.rb - About 25 mins 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 scrollFunction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function scrollFunction(){
                                  for (var i=0;i<dynamicDisplayList["length"];i++) {
                                    if (isScrolledIntoView(dynamicDisplay[dynamicDisplayList[i]][5]) && dynamicDisplay[dynamicDisplayList[i]][2]==false) {
                                      dynamicDisplay[dynamicDisplayList[i]][1]=true;
                                      switch(dynamicDisplay[dynamicDisplayList[i]][6]){
                              Severity: Minor
                              Found in app/assets/javascripts/ChartNew.js - About 25 mins 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 fmtChartJS has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function fmtChartJS(config,value,fmt){
                              
                              //alert(fmt);
                                if(fmt=="notformatted")
                                {
                              Severity: Minor
                              Found in app/assets/javascripts/ChartNew.js - About 25 mins 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 has_new_complement_child? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def has_new_complement_child?
                                  has_new_additional_child = false
                                  if self.has_children? && !self.is_root?
                                    self.children.each do |child|
                                      has_new_additional_child = child.wbs_activity_element.nil? && child.wbs_activity.nil?
                              Severity: Minor
                              Found in app/models/wbs_project_element.rb - About 25 mins 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 show_project_history_graph has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def show_project_history_graph(project)
                                  require 'gratr/import'
                                  require 'gratr/dot'
                              
                                  #ObjectSpace.each_object(Module) do |m|
                              Severity: Minor
                              Found in app/helpers/projects_helper.rb - About 25 mins 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 show_module_project_results_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def show_module_project_results_view
                                  if params[:module_project_id]
                                    @module_project = ModuleProject.find(params[:module_project_id])
                                    @project = @module_project.project
                                    @project_organization = @project.organization
                              Severity: Minor
                              Found in app/controllers/module_projects_controller.rb - About 25 mins 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