ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method st_upload_image has 35 lines of code (exceeds 25 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 1 hr to fix

Method log_depot_validate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def log_depot_validate
    @schedule = nil # setting to nil, since we are using same view for both db_back and log_depot edit
    # if zone is selected in tree replace tab#3
    pfx = if x_active_tree == :diagnostics_tree
            if @sb[:active_tab] == "diagnostics_database"
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Method stamp has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def stamp
    assert_privileges(rbac_feature_id("miq_request_approval"))
    if params[:button] == "cancel"
      if (session[:edit] && session[:edit][:stamp_typ]) == "a"
        flash_to_session(_("Request approval was cancelled by the user"))
Severity: Minor
Found in app/controllers/miq_request_controller.rb - About 1 hr to fix

Method validate_user has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def validate_user(user, task_id = nil, request = nil, authenticate_options = {})
    if task_id.present?
      validate_user_collect_task(user, task_id)
    else # First time thru, kick off authenticate task
      validation = validate_user_kick_off_task(user, request, authenticate_options)
Severity: Minor
Found in app/services/user_validation_service.rb - About 1 hr to fix

Method textual_collection_link has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def textual_collection_link(collection, as: nil, controller_collection: nil, explorer: false, feature: nil, label: nil, link: nil)
    if collection.kind_of?(Array)
      unless as && link
        raise ArgumentError, ":as and :link are both required when linking to an array",
              caller.reject { |x| x =~ /^#{__FILE__}:/ }
Severity: Minor
Found in app/helpers/textual_summary_helper.rb - About 1 hr to fix

Method group_information_summary has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def group_information_summary(group)
    rows = [
      row_data(_('ID'), group.id),
      row_data(_('Description'), group.description),
      row_data(_('Detailed Description'), group.detailed_description),
Severity: Minor
Found in app/helpers/ops_helper/group_rbac_details_helper.rb - About 1 hr to fix

Method save_default_search has 34 lines of code (exceeds 25 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 1 hr to fix

Method compare_miq has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def compare_miq(_db = nil)
    @compressed = session[:miq_compressed]
    @exists_mode = session[:miq_exists_mode]
    if @compare.nil? # == nil
      compare_init("compare") # Init compare screen variables
Severity: Minor
Found in app/controllers/application_controller/compare.rb - About 1 hr to fix

Method index has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def index
    case params[:model]
    when 'ExtManagementSystem'
      record = ExtManagementSystem.find_by(:id => params[:id])
      if record
Severity: Minor
Found in app/controllers/restful_redirect_controller.rb - About 1 hr to fix

Method import_automate_datastore has 34 lines of code (exceeds 25 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

Method button has 34 lines of code (exceeds 25 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/ems_configuration_controller.rb - About 1 hr to fix

Method create_method has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_method
    assert_privileges("miq_ae_method_new")
    @in_a_form = true
    case params[:button]
    when "cancel"
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method build_details_grid has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_details_grid(view, mode = true)
    xml = REXML::Document.load("")
    xml << REXML::XMLDecl.new(1.0, "UTF-8")

    # Create root element
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method set_right_cell_text has 34 lines of code (exceeds 25 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

Method schedule_set_record_vars has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def schedule_set_record_vars(schedule)
    schedule.resource_type = schedule_resource_type_from_params_action
    schedule.sched_action = {:method => schedule_method_from_params_action}

    if params[:action_typ] == "automation_request"
Severity: Minor
Found in app/controllers/ops_controller/settings/schedules.rb - About 1 hr to fix

Method rbac_field_changed has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_field_changed(rec_type)
    id = params[:id].split('__').first || 'new' # Get the record id
    id = id unless %w[new seq].include?(id)
    return unless load_edit("rbac_#{rec_type}_edit__#{id}", "replace_cell__explorer")

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

Method refresh_screen has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def refresh_screen
    @explorer = true
    if params[:pressed] == "delete_server" || params[:pressed] == "zone_delete_server"
      @sb[:diag_selected_id] = nil
      build_replaced_trees(%i[settings diagnostics], %i[settings diagnostics])
Severity: Minor
Found in app/controllers/ops_controller/diagnostics.rb - About 1 hr to fix

Method live_migrate_vm has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def live_migrate_vm
          assert_privileges("instance_live_migrate")
          case params[:button]
          when "cancel"
            add_flash(_("Live migration of Instances was cancelled by the user"))
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/live_migrate.rb - About 1 hr to fix

Method get_view_process_search_text has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_view_process_search_text(view)
    # Check for new search by name text entered
    if params[:search]
      @search_text = params[:search][:text].blank? ? nil : params[:search][:text].strip
    elsif params[:search_text] && @explorer
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Method fetch_playbook_details has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def fetch_playbook_details
    playbook_details = {}
    provision = @record.config_info[:provision]
    provisioning_details = {}
    provisioning_details[:repository] = fetch_name_from_object(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScriptSource, provision[:repository_id])
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language