ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method st_edit has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def st_edit
    assert_privileges(params[:id] ? 'catalogitem_edit' : 'catalogitem_new')

    # reset the active tree back to :sandt_tree, it was changed temporairly to display automate entry point tree in a popup div
    self.x_active_tree = 'sandt_tree'
Severity: Major
Found in app/controllers/catalog_controller.rb - About 2 hrs to fix

Method determine_api_endpoints has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def determine_api_endpoints(obj, display_options = {})
    base_name = obj.class.base_model.name
    case base_name
    when /EmsCluster/
      api_collection_name = "clusters"
Severity: Major
Found in app/services/dialog_local_service.rb - About 2 hrs to fix

Function setDiskFormSubmit has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const setDiskFormSubmit = (data, setData, formData, roles, renderData) => {
  const dataTableData = data.dataTable.disks || [];
  if (data.form.action === 'add') {
    // code for add
    const id = `disk${dataTableData.length}`;
Severity: Major
Found in app/javascript/components/reconfigure-vm-form/helpers/disk.js - About 2 hrs to fix

Function CloudObjectStoreContainerForm has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CloudObjectStoreContainerForm = () => {
  const [{
    initialValues, fields, isLoading,
  }, setState] = useState({});

Severity: Major
Found in app/javascript/components/cloud-object-store-container-form/index.jsx - About 2 hrs to fix

Method button has 63 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].include?(@display) # Were we displaying vms or hosts

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

Method widget_get_form_vars has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def widget_get_form_vars
    @widget = @edit[:widget_id] ? MiqWidget.find(@edit[:widget_id]) : MiqWidget.new

    copy_params_if_set(@edit[:new], params, %i[title description])
    @edit[:new][:filter]  = params[:filter_typ]       if params[:filter_typ]
Severity: Major
Found in app/controllers/report_controller/widgets.rb - About 2 hrs to fix

Class SecurityGroupController has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

class SecurityGroupController < ApplicationController
  before_action :check_privileges
  before_action :get_session_data
  after_action :cleanup_action
  after_action :set_session_data
Severity: Minor
Found in app/controllers/security_group_controller.rb - About 2 hrs to fix

Class ContainerDashboardService has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

class ContainerDashboardService < DashboardService
  include ContainerServiceMixin
  include Mixins::CheckedIdMixin
  include TextualMixins::TextualRefreshStatus

Severity: Minor
Found in app/services/container_dashboard_service.rb - About 2 hrs to fix

Function notificationReducer has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const notificationReducer = (state = notificationInitialState, action) => {
  switch (action.type) {
    case INIT_NOTIFICATIONS:
      return {
        ...state,
Severity: Major
Found in app/javascript/miq-redux/notification-reducer.js - About 2 hrs to fix

Method ab_button_add has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ab_button_add
    assert_privileges("ab_button_new")
    @sb[:active_tab] = "ab_options_tab"
    @resolve = session[:resolve]
    name = @edit[:new][:instance_name].presence || @edit[:new][:other_name]
Severity: Major
Found in app/controllers/application_controller/buttons.rb - About 2 hrs to fix

Method menu_update has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def menu_update
    assert_privileges("miq_report_menu_editor")

    menu_get_form_vars
    # @changed = (@edit[:new] != @edit[:current])
Severity: Major
Found in app/controllers/report_controller/menus.rb - About 2 hrs to fix

File quadicons.js has 419 lines of code (exceeds 400 allowed). Consider refactoring.
Open

export const quads = [
  {
    topLeft: {
      fonticon: 'fa fa-cog',
      color: '#0099cc',
Severity: Minor
Found in app/javascript/spec/quadicon/data/quadicons.js - About 2 hrs to fix

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

  const onSubmit = (values, formApi) => {
    promise.then(async({ data: { allowed_association_types } }) => {
      // check to determine whether to delete or replace existing custom image
      if (values.file_upload) {
        const fileList = get(values, formApi.fileInputs[0]).inputFiles;
Severity: Major
Found in app/javascript/components/generic-objects-form/index.jsx - About 2 hrs to fix

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

  render() {
    const usedServicesMessage = (data) => {
      let warningItems = [];
      if (data.length === 1) { // We're deleting just one catalog item
        const services = {};
Severity: Major
Found in app/javascript/components/remove-catalog-item-modal.jsx - About 2 hrs to fix

Method pre_prov has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def pre_prov
    assert_privileges("miq_request_edit")
    if params[:button] == "cancel"
      flash_to_session(_("Add of new %{type} Request was cancelled by the user") % {:type => session[:edit][:prov_type]})
      @explorer = session[:edit][:explorer] || false
Severity: Major
Found in app/controllers/application_controller/miq_request_methods.rb - About 2 hrs to fix

Method miq_event_edit has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_event_edit
    assert_privileges("miq_policy_event_edit")
    case params[:button]
    when "cancel"
      @edit = nil
Severity: Major
Found in app/controllers/miq_policy_controller/events.rb - About 2 hrs to fix

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

  def button
    @edit = session[:edit] # Restore @edit for adv search box

    params[:display] = @display if ["instances"].include?(@display) # Were we displaying vms/hosts/storages
    params[:page] = @current_page if @current_page.nil? # Save current page for list refresh
Severity: Major
Found in app/controllers/orchestration_stack_controller.rb - About 2 hrs to fix

Method old_dialogs_update_create has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def old_dialogs_update_create
    old_dialogs_get_form_vars
    case params[:button]
    when "cancel"
      @edit = session[:edit] = nil # clean out the saved info
Severity: Major
Found in app/controllers/miq_ae_customization_controller/old_dialogs.rb - About 2 hrs to fix

Method add_field_to_col_order has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def add_field_to_col_order(rpt, field)
    # Get the sort columns, removing the suffix if it exists
    sortby1 = if MiqReport.is_break_suffix?(@edit[:new][:sortby1].split("__")[1])
                @edit[:new][:sortby1].split("__").first
              else
Severity: Major
Found in app/controllers/report_controller/reports/editor.rb - About 2 hrs to fix

Method check_tabs has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def check_tabs
    @sb[:miq_tab] = params[:tab]
    active_tab = 'edit_1'
    case @sb[:miq_tab].split('_')[1]
    when '8'
Severity: Major
Found in app/controllers/report_controller/reports/editor.rb - About 2 hrs to fix
Severity
Category
Status
Source
Language