ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Method edit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def edit
      assert_privileges("#{permission_prefix}_edit")
      begin
        @ems = find_record_with_rbac(model, params[:id]) ## TODO is params[:id] supposed to be checked_item_id? This assumes only one id is passed in
      rescue => err
Severity: Minor
Found in app/controllers/mixins/ems_common.rb - About 55 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 special_page_breadcrumb has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def special_page_breadcrumb(variable, explorer = false, x_node = nil)
      # breadcrumb_url = url(controller_url, notshow, variable.first[:id])
      # EMS has key instead of name
      return if !variable || variable.count != 1

Severity: Minor
Found in app/controllers/mixins/breadcrumbs_mixin.rb - About 55 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 st_upload_image has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def st_upload_image
    assert_privileges("st_catalog_edit")

    err = false
    identify_catalog(params[:id])
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 55 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 dialog_get_node_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def dialog_get_node_info(treenodeid)
    if treenodeid == "root"
      dialog_list
      @right_cell_text = _("All Dialogs")
    else
Severity: Minor
Found in app/controllers/miq_ae_customization_controller/dialogs.rb - About 55 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 ot_remove_submit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def ot_remove_submit
    assert_privileges("orchestration_template_remove")
    elements = find_records_with_rbac(OrchestrationTemplate, checked_or_params)
    elements.each do |ot|
      if ot.in_use?
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 55 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 old_dialogs_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def old_dialogs_list
    assert_privileges('old_dialogs_accord') # feature like miq_ae_customization_old_dialogs_list is missing
    @lastaction = "old_dialogs_list"
    @force_no_grid_xml   = true
    @dialog = nil
Severity: Minor
Found in app/controllers/miq_ae_customization_controller/old_dialogs.rb - About 55 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 dialog_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def dialog_list
    assert_privileges('dialog_accord') # feature like miq_ae_customization_dialog_list is missing
    @lastaction = "dialog_list"
    @explorer = true

Severity: Minor
Found in app/controllers/miq_ae_customization_controller/dialogs.rb - About 55 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 old_dialogs_get_node_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def old_dialogs_get_node_info(treenodeid)
    if treenodeid == "root"
      old_dialogs_list
      @right_cell_text = _("All Dialogs")
      @right_cell_div  = "old_dialogs_list"
Severity: Minor
Found in app/controllers/miq_ae_customization_controller/old_dialogs.rb - About 55 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 svc_catalog_provision has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def svc_catalog_provision
    assert_privileges("svc_catalog_provision")
    checked = find_checked_items
    checked[0] = params[:id] if checked.blank? && params[:id]
    st = find_record_with_rbac(ServiceTemplate, checked[0])
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 55 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 event_logs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def event_logs
    @record = identify_record(params[:id])
    @view = session[:view] # Restore the view from the session to get column names for the display
    return if record_no_longer_exists?(@record)

Severity: Minor
Found in app/controllers/application_controller.rb - About 55 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 accordion_select has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def accordion_select
    @sb[:flash_msg] = []
    @schedules = nil
    @edit = nil
    if params[:id]
Severity: Minor
Found in app/controllers/report_controller.rb - About 55 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 get_node_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def get_node_info(_node = {}, _show_list = true)
    treenodeid = valid_active_node(x_node)
    if %i[db_tree reports_tree saved_tree savedreports_tree widgets_tree].include?(x_active_tree)
      @nodetype = case x_active_tree
                  when :savedreports_tree
Severity: Minor
Found in app/controllers/report_controller.rb - About 55 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 set_elements_and_redirect_unauthorized_user has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def set_elements_and_redirect_unauthorized_user
    @nodetype, _id = parse_nodetype_and_id(params[:id])
    prefix = prefix_by_nodetype(@nodetype)

    # Position in tree that matches selected record
Severity: Minor
Found in app/controllers/vm_infra_controller.rb - About 55 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 upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def upload
    assert_privileges("miq_report_export")

    @sb[:flash_msg] = []
    if params.fetch_path(:upload, :file) && File.size(params[:upload][:file].tempfile).zero?
Severity: Minor
Found in app/controllers/report_controller.rb - About 55 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 process_params_options has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def process_params_options(params)
    restore_quadicon_options(params[:additional_options] || {})
    options = from_additional_options(params[:additional_options] || {})
    if params[:explorer]
      params[:action] = "explorer"
Severity: Minor
Found in app/controllers/application_controller.rb - About 55 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 gfv_performance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def gfv_performance
    if params[:chosen_interval]
      @edit[:new][:perf_interval] = params[:chosen_interval]
      @edit[:new][:perf_start] = nil # Clear start/end offsets
      @edit[:new][:perf_end] = nil
Severity: Minor
Found in app/controllers/report_controller/reports/editor.rb - About 55 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 import_widgets has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def import_widgets
    assert_privileges("miq_report_export")

    if params[:commit] == _('Commit')
      import_file_upload = ImportFileUpload.where(:id => params[:import_file_upload_id]).first
Severity: Minor
Found in app/controllers/report_controller.rb - About 55 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 report_data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def report_data
    super
    if params[:model_name] == "MiqRequest"
      @request_filters = {}
      params[:additional_options][:named_scope].each do |option|
Severity: Minor
Found in app/controllers/miq_request_controller.rb - About 55 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 button has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def button
    @edit = session[:edit] # Restore @edit for adv search box
    params[:page] = @current_page if @current_page.nil? # Save current page for list refresh

    params[:page] = @current_page if @current_page.nil? # Save current page for list refresh
Severity: Minor
Found in app/controllers/configuration_job_controller.rb - About 55 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 schedule_get_all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def schedule_get_all
    @schedules = true
    @force_no_grid_xml = true
    if params[:ppsetting]                                               # User selected new per page value
      @items_per_page = params[:ppsetting].to_i                         # Set the new per page value
Severity: Minor
Found in app/controllers/report_controller/schedules.rb - About 55 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