ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method set_session_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def set_session_data
    session[:miq_template_lastaction]   = @lastaction
    session[:miq_template_showtype]     = @showtype
    session[:miq_compressed]            = @compressed unless @compressed.nil?
    session[:miq_exists_mode]           = @exists_mode unless @exists_mode.nil?
Severity: Minor
Found in app/controllers/miq_template_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 ap_set_record_vars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def ap_set_record_vars(mems, scanitemset)
    unless mems.empty?
      mems_to_delete = []
      mems.each { |m| mems_to_delete.push(m) }
      ap_deletescanitems(mems_to_delete)
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.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 ap_set_form_vars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def ap_set_form_vars
    @edit = {}
    session[:file_names] = []
    session[:reg_entries] = []
    session[:nteventlog_entries] = []
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.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 init_show has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def init_show
    return unless super
    if !@explorer && @display == "main"
      tree_node_id = TreeBuilder.build_node_id(@record)
      session[:exp_parms] = {:display => @display, :refresh => params[:refresh], :id => tree_node_id}
Severity: Minor
Found in app/controllers/storage_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 rbac_group_set_filters has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def rbac_group_set_filters(group)
    group.entitlement ||= Entitlement.new
    if @edit[:new][:use_filter_expression]
      group.entitlement.set_managed_filters(nil) if group.entitlement.get_managed_filters.present?
      group.entitlement.filter_expression = @edit[:new][:filter_expression]["???"] ? nil : MiqExpression.new(@edit[:new][:filter_expression])
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 rebuild_toolbars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def rebuild_toolbars(record_showing, presenter)
    c_tb = build_toolbar(center_toolbar_filename) unless @in_a_form
    v_tb = build_toolbar('download_view_tb') unless record_showing || (x_active_tree == :storage_pod_tree && x_node == 'root') || @in_a_form
    cb_tb = build_toolbar(custom_toolbar_explorer)

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

  def button
    @refresh_div = "main_div" # Default div for button.rjs to refresh
    timeprofile_delete if params[:pressed] == "tp_delete"
    copy_record if params[:pressed] == "tp_copy"
    edit_record if params[:pressed] == "tp_edit"
Severity: Minor
Found in app/controllers/configuration_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 rsop_show_options has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def rsop_show_options
    assert_privileges('policy_simulation')
    @explorer = true
    if params.key?(:passed)
      if params[:passed] == "null" || params[:passed] == ""
Severity: Minor
Found in app/controllers/miq_policy_rsop_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 pxe_wimg_edit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def pxe_wimg_edit
    assert_privileges("pxe_wimg_edit")
    case params[:button]
    when "cancel"
      add_flash(_("Edit of Windows Image \"%{name}\" was cancelled by the user") % {:name => session[:edit][:wimg].name})
Severity: Minor
Found in app/controllers/pxe_controller/pxe_servers.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 resizevms has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def resizevms
          case params[:pressed]
          when "instance_resize"
            assert_privileges("instance_resize")
          when "miq_request_edit"
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/resize.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 launch_external_logging has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def launch_external_logging
      assert_privileges('ems_container_launch_external_logging')
      record = self.class.model.find(params[:id])
      ems = record.ext_management_system
      route_name = ems.external_logging_route_name
Severity: Minor
Found in app/controllers/mixins/containers_external_logging_support_mixin.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 assert_privileges_for_edit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def assert_privileges_for_edit
    feature = case params[:button]
              when "cancel"
                params[:id] ? 'chargeback_rates_new' : 'chargeback_rates_edit'
              when "save", "add"
Severity: Minor
Found in app/controllers/chargeback_rate_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 button has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def button
    @edit = session[:edit] # Restore @edit for adv search box
    params[:display] = @display if display_methods.include?(@display) # Were we displaying nested list

    # Handle Toolbar Policy Tag Button
Severity: Minor
Found in app/controllers/configuration_profile_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 retirevms has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def retirevms
          assert_privileges(params[:pressed])
          # check to see if coming from show_list or drilled into vms from another CI
          if request.parameters[:controller] == "vm" || %w[all_vms instances vms].include?(params[:display])
            rec_cls = "vm"
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/retire.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 playbook_options_field_changed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def playbook_options_field_changed
      assert_privileges(params[:id] == 'new' ? 'ab_button_new' : 'ab_button_edit')
      @edit = session[:edit]
      @edit[:new][:inventory_type] = params[:inventory_type] if params[:inventory_type]
      playbook_box_edit
Severity: Minor
Found in app/controllers/mixins/playbook_options.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 iso_datastore_get_node_info has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def iso_datastore_get_node_info(treenodeid)
    if treenodeid == "root"
      iso_datastore_list
      @right_cell_text = _("All ISO Datastores")
      @right_cell_div  = "iso_datastore_list"
Severity: Minor
Found in app/controllers/pxe_controller/iso_datastores.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 rsop_option_changed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def rsop_option_changed
    assert_privileges('policy_simulation')
    if params[:event_typ]
      @sb[:rsop][:event] = params[:event_typ].presence
      @sb[:rsop][:event_value] = nil
Severity: Minor
Found in app/controllers/miq_policy_rsop_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 st_catalog_delete has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def st_catalog_delete
    assert_privileges("st_catalog_delete")
    elements = []
    if params[:id]
      elements.push(params[:id])
Severity: Minor
Found in app/controllers/catalog_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 x_show has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def x_show
    @sb[:action] = nil
    @explorer = true
    if x_active_tree == :stcat_tree
      assert_privileges("st_catalog_view")
Severity: Minor
Found in app/controllers/catalog_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 st_set_form_vars has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def st_set_form_vars
    @edit = {}
    @edit[:rec_id] = @record.id
    @edit[:key] = "st_edit__#{@record.id || "new"}"
    @edit[:url] = "servicetemplate_edit"
Severity: Minor
Found in app/controllers/catalog_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

Severity
Category
Status
Source
Language