ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method update_method has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def update_method
    assert_privileges("miq_ae_method_edit")
    return unless load_edit("aemethod_edit__#{params[:id]}", "replace_cell__explorer")

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

Method atomic_st_edit has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def atomic_st_edit
    assert_privileges(params[:id] ? 'atomic_catalogitem_edit' : 'atomic_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: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method calculate_rp_config has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def calculate_rp_config(db_record)
    rp_config = []
    unless db_record.memory_reserve.nil?
      rp_config.push(:field       => _("Memory Reserve"),
                     :description => db_record.memory_reserve)
Severity: Minor
Found in app/helpers/resource_pool_helper.rb - About 1 hr to fix

Method prov_req_submit has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prov_req_submit
    id = session[:edit][:req_id] || "new"
    return unless load_edit("prov_edit__#{id}", "show_list")

    @edit[:new][:schedule_time] = @edit[:new][:schedule_time].in_time_zone("Etc/UTC") if @edit[:new][:schedule_time]
Severity: Minor
Found in app/controllers/application_controller/miq_request_methods.rb - About 1 hr to fix

Method automate_button_field_changed has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def automate_button_field_changed
    assert_privileges(feature_by_action)

    unless params[:target_class]
      @edit = session[:edit]
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method custom_buttons has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def custom_buttons(ids = nil, display_options = {})
    button = CustomButton.find(params[:button_id])
    cls = custom_button_class_model(button.applies_to_class)
    @explorer = true if BASE_MODEL_EXPLORER_CLASSES.include?(cls)
    ids ||= params[:id] unless relationship_table_screen? && @record.nil?
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

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

  def button
    @edit = session[:edit]                                  # Restore @edit for adv search box
    params[:page] = @current_page unless @current_page.nil? # Save current page for list refresh
    @refresh_div = "main_div"                               # Default div for button.rjs to refresh

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

Method method_form_fields has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def method_form_fields
    assert_privileges("miq_ae_method_edit")

    if params[:id] == 'new'
      method = MiqAeMethod.new
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method ap_get_form_vars_registry has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ap_get_form_vars_registry
    unless params[:entry]['kname'].present? && params[:entry]['value'].present?
      session[:reg_data] = {
        :key   => params[:entry]['kname'],
        :value => params[:entry]['value'],
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 1 hr to fix

Method get_node_info_handle_leaf_node has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_node_info_handle_leaf_node(id)
    show_record(id)
    if @record.atomic? && need_prov_dialogs?(@record.prov_type)
      @miq_request = MiqRequest.find_by(:id => @record.service_resources[0].resource_id) if @record.service_resources[0]&.resource_id
      if @miq_request
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Function createSchema has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const createSchema = (data) => {
  const fields = [
    {
      component: componentTypes.SUB_FORM,
      name: 'MigrateInstance',

Function deleteDisk has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const deleteDisk = (row, data, setData) => {
  let dataTableData = data.dataTable.disks;
  let addDisks = data.submitParams.disks.add || [];
  const deleteDisks = data.submitParams.disks.delete || [];
  let addDiskIds = data.submitParams.diskIds.add || [];
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/disk.js - About 1 hr to fix

Method set_method_form_vars has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_method_form_vars
    session[:field_data] = {}
    @ae_class = ae_class_for_instance_or_method(@ae_method)
    @edit = {}
    session[:edit] = {}
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method rbac_edit_reset has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_edit_reset(operation, what, klass)
    key = what.to_sym
    if operation != "new"
      record = find_record_with_rbac(klass, checked_or_params)
      if %i[group role].include?(key) && record && record.read_only && operation != 'copy'
Severity: Minor
Found in app/controllers/ops_controller/ops_rbac.rb - About 1 hr to fix

Method label_tag_mapping_edit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def label_tag_mapping_edit
    assert_privileges("region_edit")

    case params[:button]
    when "cancel"
Severity: Minor
Found in app/controllers/ops_controller/settings/label_tag_mapping.rb - About 1 hr to fix

Function miqJqueryRequest has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.miqJqueryRequest = function(url, options) {
  if ((ManageIQ.observe.processing || ManageIQ.observe.queue.length) && (!options || !options.observe)) {
    console.debug('Postponing miqJqueryRequest - waiting for the observe queue to empty first');

    return new Promise((resolve, reject) => {
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr to fix

Function renderComponent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const renderComponent = (props) => {
  const { group, onClick } = props;
  switch (props.group.component) {
    case 'GenericGroup':
      return (
Severity: Minor
Found in app/javascript/components/textual_summary/textual_group.jsx - About 1 hr to fix

Function MiqButton has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function MiqButton(props) {
  let { title } = props;
  if (props.enabled && props.enabledTitle) {
    title = props.enabledTitle;
  }
Severity: Minor
Found in app/javascript/forms/miq-button.jsx - About 1 hr to fix

Function model has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const model = (isLoading, widgetId, widgetModel, widgetType) => {
  let widget;
  if (isLoading) {
    widget = (
      <div className="loadingSpinner">

Method perf_top_chart has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perf_top_chart
    return if perfmenu_click?

    @record = identify_tl_or_perf_record
    @perf_record = @record.kind_of?(MiqServer) ? @record.vm : @record # Use related server vm record
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix
Severity
Category
Status
Source
Language