ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Consider simplifying this complex logical expression.
Open

    if @edit && @edit[:expression] &&
       ((default_search?(search.name) || no_default_search?(search.id)) && expression_selected_nil_or_id(search.id) ||
        (@edit[:expression][:selected] && @edit[:expression][:selected][:id].zero? && search.id.to_i.zero? ||
         expression_selected_id_or_name(:name, search.name)))
      'active'
Severity: Critical
Found in app/helpers/application_helper.rb - About 1 hr to fix

Function getInitialValues has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getInitialValues = (emsId, recordId, isTemplate, setState) => {
  const parentOptions = [];
  // Get VM Parent Options and filter out current VM
  API.get(`/api/vms/?filter[]=ems_id=${emsId}&expand=resources`)
    .then(({ resources }) => resources.filter((vm) => vm.id !== `${recordId}`))
Severity: Minor
Found in app/javascript/components/vm-edit-form/helper.js - About 1 hr to fix

Function FontIconPickerDdf has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FontIconPickerDdf = (props) => {
  const {
    labelText,
    FormGroupProps,
    iconTypes, selected, iconChange,
Severity: Minor
Found in app/javascript/components/fonticon-picker/font-icon-picker-ddf.jsx - About 1 hr to fix

Function setDriveFormSubmit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const setDriveFormSubmit = (data, setData, formData, renderData) => {
  const { id } = data.editingRow;
  const index = id.substring(5);
  const datatableData = data.dataTable.drives;
  const submitDrives = data.submitParams.drives.connect || [];
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/drive.js - About 1 hr to fix

Method timeline_selected has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def timeline_selected(chart_click_data, data_row, ts)
    @record = find_record_with_rbac(data_row["resource_type"].constantize, data_row["resource_id"])
    return [true, nil] unless @record

    controller = data_row["resource_type"].underscore
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix

Method settings_set_form_vars has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def settings_set_form_vars
    @right_cell_text = if x_node.split("-").first == "z"
                         if my_zone_name == @selected_zone.name
                           _("Settings %{model} \"%{name}\" (current)") % {:name  => @selected_zone.description,
                                                                           :model => ui_lookup(:model => @selected_zone.class.to_s)}
Severity: Minor
Found in app/controllers/ops_controller/settings/common.rb - About 1 hr to fix

Method rbac_group_seq_edit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_group_seq_edit
    assert_privileges("rbac_group_seq_edit")
    case params[:button]
    when "cancel"
      @edit = nil
Severity: Minor
Found in app/controllers/ops_controller/ops_rbac.rb - About 1 hr to fix

Method action_valid_record? has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def action_valid_record?(rec)
    edit = @edit[:new]
    options = edit[:options]
    add_flash(_("Description is required"), :error) if edit[:description].blank?
    add_flash(_("Action Type must be selected"), :error) if edit[:action_type].blank?
Severity: Minor
Found in app/controllers/miq_action_controller.rb - About 1 hr to fix

Method register_nodes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def register_nodes
    assert_privileges("host_register_nodes")
    redirect_to(ems_infra_path(params[:id], :display => "hosts")) if params[:cancel]

    # Hiding the toolbars
Severity: Minor
Found in app/controllers/ems_infra_controller.rb - About 1 hr to fix

Method prov_redirect has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prov_redirect(typ = nil)
    assert_privileges(params[:pressed])
    # we need to do this check before doing anything to prevent
    # history being updated
    task_supported(typ) if typ
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Method export has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def export
    assert_privileges('policy_import_export')
    @breadcrumbs = []
    @layout = "miq_policy_export"
    drop_breadcrumb(:name => _("Import / Export"), :url => "miq_policy_export")
Severity: Minor
Found in app/controllers/miq_policy_export_controller.rb - About 1 hr to fix

Method widget_get_node_info has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def widget_get_node_info
    @sb[:nodes] = x_node.split('-')
    if @sb[:nodes].length == 1
      get_all_widgets
      @right_cell_text = _("All Widgets")
Severity: Minor
Found in app/controllers/report_controller/widgets.rb - About 1 hr to fix

Function chartData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.chartData = function(type, data, data2) {
  if (type === undefined) {
    return emptyChart();
  }

Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr to fix

Function getPodsTable has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getPodsTable = (isLoading, dashboardData) => {
  if (isLoading !== true) {
    if (dashboardData.data.pods.length > 0) {
      const rows = dashboardData.data.pods.map((row) => ({
        ...row,
Severity: Minor
Found in app/javascript/components/container-projects/helper.jsx - About 1 hr to fix

Function FirmwareRegistryForm has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FirmwareRegistryForm = () => {
  const TYPES = {
    rest_api_depot: { value: 'FirmwareRegistry::RestApiDepot', label: __('Rest API Depot') },
  };

Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { isLoaded } = this.props;

    if (!isLoaded) {
      return (
Severity: Minor
Found in app/javascript/components/taggingWrapper.jsx - About 1 hr to fix

Method process_vm_buttons has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def process_vm_buttons(pfx)
    case params[:pressed]
    when "#{pfx}_policy_sim"                then polsimvms
    when "#{pfx}_compare"                   then comparemiq
    when "#{pfx}_scan"                      then scanvms
Severity: Minor
Found in app/controllers/application_controller/ci_processing.rb - About 1 hr to fix

Method textual_generate_openstack_status has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def textual_generate_openstack_status
    @record.service_group_names.collect do |x|
      running_count = @record.host_ids_with_running_service_group(x.name).count
      failed_count  = @record.host_ids_with_failed_service_group(x.name).count
      all_count     = @record.host_ids_with_service_group(x.name).count
Severity: Minor
Found in app/helpers/ems_cluster_helper/textual_summary.rb - About 1 hr to fix

Method disks_attributes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def disks_attributes
      disks = []
      return disks if @record.hardware.disks.empty?

      # HDDs
Severity: Minor
Found in app/helpers/textual_mixins/textual_devices.rb - About 1 hr to fix

Method ab_group_reorder has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ab_group_reorder
    assert_privileges("ab_group_reorder")
    case params[:button]
    when "cancel"
      add_flash(_("Button Group Reorder cancelled"))
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix
Severity
Category
Status
Source
Language