ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Function getSubmitData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getSubmitData = (values) => {
  let customIdentifier = '';
  let description = '';
  let parentResource = null;
  const childResources = [];
Severity: Minor
Found in app/javascript/components/vm-edit-form/helper.js - About 1 hr to fix

Method comparemiq has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def comparemiq
    assert_privileges(params[:pressed])
    items = if !session[:checked_items].nil? && @lastaction == "set_checked_items"
              session[:checked_items]
            else
Severity: Minor
Found in app/controllers/application_controller/compare.rb - About 1 hr to fix

Method group_set_form_vars has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def group_set_form_vars
    @sb[:buttons_node] = true
    if session[:resolve]
      @resolve = session[:resolve]
    else
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method create_instance has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_instance
    assert_privileges("miq_ae_instance_new")
    case params[:button]
    when "cancel"
      @sb[:action] = session[:edit] = nil # clean out the saved info
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

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

  def update
    assert_privileges("security_group_edit")
    @security_group = find_record_with_rbac(SecurityGroup, params[:id])

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

Method sync_users has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def sync_users
    assert_privileges('ems_cloud_user_sync')
    ems = find_record_with_rbac(model, params[:id])
    @in_a_form = true
    drop_breadcrumb(:name => _("Sync Users"), :url => "/ems_cloud/sync_users")
Severity: Minor
Found in app/controllers/ems_cloud_controller.rb - About 1 hr to fix

Method set_ownership has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def set_ownership
          assert_privileges(params[:pressed])
          # check to see if coming from show_list or drilled into vms from another CI
          controller = if request.parameters[:controller] == "vm" || %w[all_vms vms instances].include?(params[:display])
                         "vm"
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/ownership.rb - About 1 hr to fix

Method old_dialogs_button_operation has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def old_dialogs_button_operation(method, display_name)
    dialogs = []

    # Either a list or coming from a different controller (eg from host screen, go to its vms)
    if !params[:id]
Severity: Minor
Found in app/controllers/miq_ae_customization_controller/old_dialogs.rb - About 1 hr to fix

Method x_get_tree_roots has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def x_get_tree_roots
    nodes = [
      {:id   => 'otcfn',
       :tree => "otcfn_tree",
       :text => _("CloudFormation Templates"),
Severity: Minor
Found in app/presenters/tree_builder_orchestration_templates.rb - About 1 hr to fix

Function levelFour has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const levelFour = (nodes, reportMenu, reportDetails) => {
  const headers = [...defaultHeaders, ...additionalHeaders];
  const rows = [];
  const nodeOne = parseInt(nodes[1]);
  const nodeTwo = parseInt(nodes[2]);
Severity: Minor
Found in app/javascript/components/data-tables/report-list/helper.js - About 1 hr to fix

Function getWorkflow has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const getWorkflow = async() => {
    reloadCount.current += 1;
    const url = `/api/configuration_scripts/${recordId}`;
    API.get(url, { skipErrors: [404, 400, 500] })
      .then((response) => {

Method settings_users_basic_info has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def settings_users_basic_info(record)
    rows = [
      row_data(_('ID'), record.id),
      row_data(_('Full Name'), record.name),
      row_data(_('Username'), record.userid),
Severity: Minor
Found in app/helpers/settings_users_helper.rb - About 1 hr to fix

Method perf_gen_tag_data_before_wait has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perf_gen_tag_data_before_wait
    case @perf_options[:typ]
    when "Hourly"
      from_dt = create_time_in_utc(@perf_options[:hourly_date] + " 00:00:00", @perf_options[:tz]) # Get tz 12am in UTC
      to_dt = create_time_in_utc(@perf_options[:hourly_date] + " 23:59:59", @perf_options[:tz])   # Get tz 11:59pm in UTC
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix

Method perf_gen_top_data_after_wait has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perf_gen_top_data_after_wait
    miq_task = MiqTask.find(params[:task_id]) # Not first time, read the task record
    if miq_task.task_results.kind_of?(Array)
      rpts = miq_task.task_results.reverse # Grab the array of report objects (reversed so reports can be popped off)
    else
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix

Method exp_remove has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exp_remove(exp, token)
    return true if exp[:token] && exp[:token] == token # If the token matches

    # Tell caller to remove me
    keepkey, keepval, deletekey = nil                  # Holders for key, value pair to keep and key to delete
Severity: Minor
Found in app/controllers/application_controller/filter.rb - About 1 hr to fix

Method dialog_get_form_vars has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def dialog_get_form_vars
    @record = Dialog.find(@edit[:rec_id])

    params.each do |parameter_key, parameter_value|
      parameter_key = parameter_key.split("__protected").first if parameter_key.ends_with?("__protected")
Severity: Minor
Found in app/controllers/application_controller/dialog_runner.rb - About 1 hr to fix

Method create has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create
    assert_privileges("cloud_volume_new")
    case params[:button]
    when "cancel"
      flash_and_redirect(_("Add of new Cloud Volume was cancelled by the user"))
Severity: Minor
Found in app/controllers/cloud_volume_controller.rb - About 1 hr to fix

Method pxe_image_edit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def pxe_image_edit
    assert_privileges("pxe_image_edit")
    case params[:button]
    when "cancel"
      add_flash(_("Edit of PXE Image \"%{name}\" was cancelled by the user") % {:name => session[:edit][:img].name})
Severity: Minor
Found in app/controllers/pxe_controller/pxe_servers.rb - About 1 hr to fix

Method alert_build_exp_options_info has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def alert_build_exp_options_info
    MiqAlert.expression_options(@edit[:new][:expression][:eval_method]).each do |eo|
      case eo[:name]

      when :ems_id
Severity: Minor
Found in app/controllers/miq_alert_controller.rb - About 1 hr to fix

Function onSubmitData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const onSubmitData = (values, miqRequestInitialOptions) => {
  // Request Date (created_recently)
  if (values.selectedPeriod) { // user selected
    daysAgo = values.selectedPeriod;
  } else if (miqRequestInitialOptions.timePeriods[1] && miqRequestInitialOptions.timePeriods[1].value) {
Severity: Minor
Found in app/javascript/components/service-request-default/index.jsx - About 1 hr to fix
Severity
Category
Status
Source
Language