ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Function KebabListItem has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const KebabListItem = (item, props) => {
  if (item.type === 'separator') {
    return <SideNavDivider key={item.id} />;
  }

Severity: Minor
Found in app/javascript/components/toolbar/ToolbarKebab.jsx - About 1 hr to fix

Function onSubmit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onSubmit = (values) => {
    miqSparkleOn();
    if (appliesToId) {
      values.owner_id = appliesToId;
    }
Severity: Minor
Found in app/javascript/components/button-group/index.jsx - About 1 hr to fix

Method li_link has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def li_link(args)
      args[:if] = (args[:count] != 0) if args[:count]
      args[:if] = true unless args.key?(:if)

      link_text, title = build_link_text(args)
Severity: Minor
Found in app/helpers/application_helper/listnav.rb - About 1 hr to fix

Method shared_button_basic_info has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def shared_button_basic_info(record, sb_items, custom_button)
    style = record&.options&.[](:button_color)&.to_s
    display_for = record&.options&.[](:display_for)
    display_how_map = {'single' => _('Single entity'), 'list' => _('List'), 'both' => _('Single and list')}
    display_for_value = display_how_map[display_for] if display_for.present?
Severity: Minor
Found in app/helpers/shared_helper/ab_show_helper.rb - About 1 hr to fix

Method center_toolbar_filename_services has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def center_toolbar_filename_services
    if x_active_tree == :sandt_tree
      if TreeBuilder.get_model_for_prefix(@nodetype) == "ServiceTemplate"
        "servicetemplate_center_tb"
      elsif @sb[:buttons_node]
Severity: Minor
Found in app/helpers/application_helper/toolbar_chooser.rb - About 1 hr to fix

Method edit_record has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def edit_record
    assert_privileges(params[:pressed])
    obj = find_checked_items
    db = params[:db] if params[:db]

Severity: Minor
Found in app/controllers/application_controller/ci_processing.rb - About 1 hr to fix

Method build_automate_tree has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_automate_tree(type)
    tree_name = "#{type}_tree".to_sym

    # build the ae tree to show the tree select box for entry point
    if x_active_tree == tree_name && @edit && @edit[:new][:fqname]
Severity: Minor
Found in app/helpers/automate_tree_helper.rb - About 1 hr to fix

Method group_reorder_set_form_vars has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def group_reorder_set_form_vars
    @edit = {}
    @edit[:new] = {}
    @edit[:current] = {}
    @edit[:key] = "group_reorder"
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method show_details has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def show_details(db, options = {})
    association = options[:association]
    conditions  = options[:conditions]
    clickable   = options[:clickable].nil?
    @showtype = "details"
Severity: Minor
Found in app/controllers/infra_networking_controller.rb - About 1 hr to fix

Method create_action_url has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_action_url(node)
    if @sb[:action] == "miq_ae_domain_priority_edit"
      'domains_priority_edit'
    elsif @sb[:action] == 'miq_ae_field_seq'
      'fields_seq_edit'
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method copy_save has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def copy_save
    assert_privileges(feature_by_action)
    return unless load_edit("copy_objects__#{params[:id]}", "replace_cell__explorer")

    begin
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method fields_set_form_vars has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def fields_set_form_vars
    @in_a_form_fields = true
    session[:field_data] = {}
    @edit = {
      :ae_class_id      => @ae_class.id,
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method replace_right_cell has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def replace_right_cell(_nodetype)
    # Get the tags for this node for the Classification pulldown
    @sb[:tags] = nil unless params[:miq_date_1] || params[:miq_date_2] # Clear tags unless just changing date
    unless @nodetype == "h" || @nodetype == "s" || params[:miq_date_1] || params[:miq_date_2] # Get the tags for the pulldown, unless host, storage, or just changing the date
      if @sb[:options][:chart_date]
Severity: Minor
Found in app/controllers/utilization_controller.rb - About 1 hr to fix

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

    def button
      @edit = session[:edit] # Restore @edit for adv search box
      params[:display] = @display if ["#{params[:controller]}s"].include?(@display) # displaying container_*
      params[:page] = @current_page if @current_page.nil? # Save current page for list refresh

Severity: Minor
Found in app/controllers/mixins/containers_common_mixin.rb - About 1 hr to fix

Method update has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def update
    assert_privileges("cloud_volume_edit")
    @volume = find_record_with_rbac(CloudVolume, params[:id])

    case params[:button]
Severity: Minor
Found in app/controllers/cloud_volume_controller.rb - About 1 hr to fix

Method replace_list_grid has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def replace_list_grid
    view = @view
    button_div = 'center_tb'
    action_url = if @lastaction == "scan_history"
                   "scan_history"
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Method gfv_model has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def gfv_model
    if params[:chosen_model] && # Check for db table changed
       params[:chosen_model] != @edit[:new][:model]
      @edit[:new][:model] = params[:chosen_model]
      @edit[:new][:perf_interval] = nil                         # Clear performance interval setting
Severity: Minor
Found in app/controllers/report_controller/reports/editor.rb - About 1 hr to fix

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

  def get_node_info(treenodeid, _show_list = true)
    @explorer ||= true
    @nodetype, id = parse_nodetype_and_id(valid_active_node(treenodeid))
    # saving this so it can be used while adding buttons/groups in buttons editor
    @sb[:applies_to_id] = id
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method db_available_widgets_options has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def db_available_widgets_options
    # Build the available widgets for the pulldown
    col_widgets = @edit[:new][:col1] +
                  @edit[:new][:col2]
    if @sb[:nodes].length == 2 && @sb[:nodes][1] != "g"
Severity: Minor
Found in app/controllers/report_controller/dashboards.rb - About 1 hr to fix

Method get_all_reps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_all_reps(nodeid = nil)
    # set nodeid from @sb, incase sort was pressed
    nodeid = x_active_tree == :reports_tree ? x_node.split('-').last : x_node.split('-').last.split('_')[0] if nodeid.nil?
    @sb[:miq_report_id] = nodeid
    @record = @miq_report = MiqReport.for_user(current_user).find(@sb[:miq_report_id])
Severity: Minor
Found in app/controllers/report_controller/reports.rb - About 1 hr to fix
Severity
Category
Status
Source
Language