ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

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

  def miq_summary_alert_set_assigned(assigned, alert_profile_tag)
    rows = []
    data = {:title => _('Assigned To'), :mode => "miq_alert_set_assigned"}
    if !assigned[:objects].empty?
      if assigned[:objects].first.kind_of?(MiqEnterprise)
Severity: Minor
Found in app/helpers/miq_alert_set_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 remove_host has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def remove_host
    assert_privileges("host_aggregate_remove_host")
    @host_aggregate = find_record_with_rbac(HostAggregate, params[:id])

    case params[:button]
Severity: Minor
Found in app/controllers/host_aggregate_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_host has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def add_host
    assert_privileges("host_aggregate_add_host")
    @host_aggregate = find_record_with_rbac(HostAggregate, params[:id])

    case params[:button]
Severity: Minor
Found in app/controllers/host_aggregate_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 compare_section_data_cols has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def compare_section_data_cols(view, section, records)
    row = {}
    view.ids.each_with_index do |id, idx|
      if idx.zero?
        row.merge!(compare_add_txt_col(idx, @compressed ? "%:" : _("% Matched:")))
Severity: Minor
Found in app/controllers/application_controller/compare.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 tagging_edit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def tagging_edit(db = nil, assert = true)
    if nested_page?
      assert_privileges("#{controller_for_common_methods}_tag")
    elsif assert
      assert_privileges("#{@display && @display != "main" && @display != "output" ? @display.singularize : controller_for_common_methods}_tag")
Severity: Minor
Found in app/controllers/application_controller/tags.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 comp_record_data_expanded_existsmode has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def comp_record_data_expanded_existsmode(idx, _match, value_found, last_value)
    text = value_found ? _("Found") : _("Missing")
    if idx.zero? # On the base?
      if value_found # Base has the record
        drift_add_image_col(idx, "fa fa-plus", "cell-stripe", text)
Severity: Minor
Found in app/controllers/application_controller/compare.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 compare_to_json has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def compare_to_json(view)
    @rows = []
    @cols = []
    @compressed = session[:miq_compressed]
    session[:selected_sections] ||= []
Severity: Minor
Found in app/controllers/application_controller/compare.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 exp_commit_regkey has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def exp_commit_regkey(exp)
    if @edit[@expkey][:exp_regkey].blank?
      add_flash(_("A registry key name must be entered to commit this expression element"), :error)
    elsif @edit[@expkey][:exp_regval].blank? && @edit[@expkey][:exp_key] != "KEY EXISTS"
      add_flash(_("A registry value name must be entered to commit this expression element"), :error)
Severity: Minor
Found in app/controllers/application_controller/filter.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 import_automate_datastore has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def import_automate_datastore
    assert_privileges('miq_ae_class_import_export')
    if params[:selected_namespaces].present?
      selected_namespaces = determine_all_included_namespaces(params[:selected_namespaces])
      import_file_upload = ImportFileUpload.where(:id => params[:import_file_upload_id]).first
Severity: Minor
Found in app/controllers/miq_ae_tools_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 adv_search_build has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def adv_search_build(model)
    # Restore @edit hash if it's saved in @settings
    @expkey = :expression # Reset to use default expression key
    if session.fetch_path(:adv_search, model.to_s) && %w[tag service_tag].exclude?(@sb[:action])
      adv_search_model = session[:adv_search][model.to_s]
Severity: Minor
Found in app/controllers/application_controller/advanced_search.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 handle_bottom_cell has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def handle_bottom_cell(nodetype, presenter, locals)
    # Handle bottom cell
    if @pages || @in_a_form && locals[:action_url] != "rbac_tags_edit"
      if @pages
        presenter.hide(:form_buttons_div)
Severity: Minor
Found in app/controllers/ops_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 form_field_changed has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def form_field_changed
    assert_privileges('miq_ae_class_simulation')
    get_form_vars
    render :update do |page|
      page << javascript_prologue
Severity: Minor
Found in app/controllers/miq_ae_tools_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 edit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def edit
    assert_privileges("host_edit")
    if session[:host_items].nil?
      @host = find_record_with_rbac(Host, params[:id])

Severity: Minor
Found in app/controllers/host_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 set_right_cell_text has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def set_right_cell_text(id, rec = nil)
    nodes = id.split('-')
    case nodes[0]
    when "root"
      txt = _("Datastore")
Severity: Minor
Found in app/controllers/miq_ae_class_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 create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    assert_privileges("security_group_new")
    case params[:button]
    when "cancel"
      javascript_redirect(:action    => 'show_list',
Severity: Minor
Found in app/controllers/security_group_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 policy_build_edit_screen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def policy_build_edit_screen(edit_type = nil)
    @edit = {}
    @edit[:new] = {}
    @edit[:current] = {}
    @edit[:key] = "miq_policy_edit__#{@policy.id || "new"}"
Severity: Minor
Found in app/controllers/miq_policy_controller/policies.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 rbac_user_set_form_vars has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def rbac_user_set_form_vars
    copy = @sb[:typ] == "copy"
    # save a shadow copy of the record if record is being copied
    @user = copy ? @record.dup : @record
    @user.miq_groups = @record.miq_groups if copy
Severity: Minor
Found in app/controllers/ops_controller/ops_rbac.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 create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    assert_privileges("cloud_network_new")
    case params[:button]
    when "cancel"
      javascript_redirect(:action    => 'show_list',
Severity: Minor
Found in app/controllers/cloud_network_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 edit_form_params has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def edit_form_params
    options = {}
    # True by default
    params[:enabled] = false unless params[:enabled]
    options[:name] = params[:name] if params[:name] && params[:name] != @network.name
Severity: Minor
Found in app/controllers/cloud_network_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 vm_reconfigure has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def vm_reconfigure
          assert_privileges('vm_reconfigure_all', :any => true)

          # if coming in to edit from miq_request list view
          recs = checked_or_params
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/reconfigure.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

Severity
Category
Status
Source
Language