ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method ae_field_fonticon has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ae_field_fonticon(field)
    case field
    when 'string'
      'ff ff-string'
    when 'symbol'
Severity: Major
Found in app/helpers/miq_ae_class_helper.rb - About 2 hrs to fix

Method perf_gen_data_before_wait has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perf_gen_data_before_wait
    interval_type = @perf_options[:typ].downcase
    case interval_type
    when "hourly", "daily"

Severity: Major
Found in app/controllers/application_controller/performance.rb - About 2 hrs to fix

Method list_child_vms has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def list_child_vms(model, node_id, title, show_list)
    options = {
      :model       => model,
      :named_scope => scopes_for_role,
    }
Severity: Major
Found in app/controllers/vm_common.rb - About 2 hrs to fix

Method get_node_info has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_node_info(treenodeid, refresh = nil)
    treenodeid = valid_active_node(treenodeid)
    get_nodetype_and_record(treenodeid)
    @right_cell_text = if @record.kind_of?(MiqEnterprise)
                         _('Enterprise')
Severity: Major
Found in app/controllers/utilization_controller.rb - About 2 hrs to fix

Method rbac_group_get_form_vars has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_group_get_form_vars
    if %w[up down].include?(params[:button])
      move_cols_up   if params[:button] == "up"
      move_cols_down if params[:button] == "down"
    else
Severity: Major
Found in app/controllers/ops_controller/ops_rbac.rb - About 2 hrs to fix

Method ap_ce_select has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ap_ce_select
    assert_privileges(session&.fetch_path(:edit, :current, :scan_mode) == "Vm" ? "ap_vm_edit" : "ap_host_edit")

    return unless load_edit("ap_edit__#{params[:id]}", "replace_cell__explorer")

Severity: Major
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 2 hrs to fix

Method rbac_group_set_form_vars has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_group_set_form_vars
    @assigned_filters = []
    @group = @record
    @edit = {
      :new                 => {
Severity: Major
Found in app/controllers/ops_controller/ops_rbac.rb - About 2 hrs to fix

Method form_available_vars_ovf_template has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def form_available_vars_ovf_template
    @edit[:available_ovf_templates] = ManageIQ::Providers::Vmware::InfraManager::OrchestrationTemplate.all
                                                                                                      .collect { |m| [m.name, m.id] }
                                                                                                      .sort
    @edit[:disk_formats] = {
Severity: Major
Found in app/controllers/catalog_controller.rb - About 2 hrs to fix

Method show_saved_report has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def show_saved_report(id)
    rr = MiqReportResult.for_user(current_user).find(id)
    if rr.nil? # Saved report no longer exists
      @report = nil
      return
Severity: Major
Found in app/controllers/report_controller/saved_reports.rb - About 2 hrs to fix

Method button has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def button
    @edit = session[:edit] # Restore @edit for adv search box
    params[:display] = @display if %w[all_vms vms hosts resource_pools].include?(@display) # Were we displaying sub-items

    if params[:pressed].starts_with?("vm_", # Handle buttons from sub-items screen
Severity: Major
Found in app/controllers/ems_cluster_controller.rb - About 2 hrs to fix

File miq_ae_tools_controller.rb has 411 lines of code (exceeds 400 allowed). Consider refactoring.
Open

class MiqAeToolsController < ApplicationController
  include Mixins::BreadcrumbsMixin
  before_action :check_privileges
  before_action :get_session_data
  after_action :cleanup_action
Severity: Minor
Found in app/controllers/miq_ae_tools_controller.rb - About 2 hrs to fix

Function RequestsTable has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const RequestsTable = ({
  initialData,
}) => {
  const [tableHeaders, setTableHeaders] = useState([
    { key: 'time', header: __('Time'), sortData: { isFilteredBy: false } },
Severity: Minor
Found in app/javascript/components/data-tables/requests-table/index.jsx - About 2 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 HeatMapChartGraph has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const HeatMapChartGraph = ({
  data, dataPoint1, dataPoint2, dataPointAvailable, title,
}) => {
  const heatmapCpuData = getHeatMapData(data[dataPoint1]);
  const heatmapMemoryData = getHeatMapData(data[dataPoint2]);

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 item_active? has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def item_active?(item)
      if item.leaf?
        # FIXME: remove @layout condition when every controller sets menu_section properly
        active = controller.menu_section_id(controller.params) || @layout.to_sym
        item.id.to_sym == active || item.id.to_sym == @layout.to_sym
Severity: Minor
Found in app/helpers/application_helper/navbar.rb - About 2 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 process_show_list has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  def process_show_list(options = {})
    session["#{self.class.session_key_prefix}_display".to_sym] = nil
    @display = nil
    @lastaction = "show_list"
    @gtl_url = "/show_list"
Severity: Minor
Found in app/controllers/application_controller/ci_processing.rb - About 2 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 miq_summary_alert_parameters has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  def miq_summary_alert_parameters(alert, expression_options, sb_data, perf_column_unit, ems)
    rows = []
    title = [_(MiqAlert.expression_types(alert.db)[alert.expression[:eval_method]]), _('Parameters')].join(' ')
    data = {:title => title, :mode => "miq_alert_parameters", :rows => []}
    ae_options = alert.expression[:options]
Severity: Minor
Found in app/helpers/miq_alert_helper.rb - About 2 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 tl_chooser has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  def tl_chooser
    @record = identify_tl_or_perf_record
    @tl_record = @record # Use related server vm record
    tl_build_timeline
    @tl_options.date.update_from_params(params)
Severity: Minor
Found in app/controllers/application_controller/timelines.rb - About 2 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_default_search has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  def save_default_search
    @edit = session[:edit]
    @view = session[:view]
    cols_key = @view.scoped_association.nil? ? @view.db.to_sym : (@view.db + "-" + @view.scoped_association).to_sym
    if params[:id]
Severity: Minor
Found in app/controllers/application_controller/filter.rb - About 2 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 tree_select has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  def tree_select
    assert_accordion_and_tree_privileges(x_active_tree)
    params[:miq_grid_checks] = []
    @explorer = true
    @lastaction = "explorer"
Severity: Minor
Found in app/controllers/vm_common.rb - About 2 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 validate_method_data has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  def validate_method_data
    assert_privileges("miq_ae_method_edit")
    return unless load_edit("aemethod_edit__#{params[:id]}", "replace_cell__explorer")

    @edit[:new][:data] = params[:cls_method_data] if params[:cls_method_data]
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 2 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

Severity
Category
Status
Source
Language