ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method deleteemss has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def deleteemss
      assert_privileges(params[:pressed])
      emss = []
      if @lastaction == "show_list" # showing a list, scan all selected emss
        emss = find_checked_items
Severity: Minor
Found in app/controllers/mixins/ems_common.rb - About 1 hr to fix

Method show_details has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def show_details(db, options = {})
      association = options[:association]
      scopes = options[:scopes]
      @showtype = "details"
      @display = "main"
Severity: Minor
Found in app/controllers/mixins/explorer_show.rb - About 1 hr to fix

Method scaling has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def scaling
    assert_privileges("ems_infra_scale")

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

Method reports_get_node_info has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def reports_get_node_info
    nodes = x_node.split('-')

    if nodes.length == 2
      @right_cell_text ||= _("%{typ} Reports") % {:typ => @sb[:rpt_menu][nodes[1].to_i][0]}
Severity: Minor
Found in app/controllers/report_controller.rb - About 1 hr to fix

Method explorer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def explorer
    @explorer = true
    @lastaction      = "explorer"
    @ght_type        = nil
    @report          = nil
Severity: Minor
Found in app/controllers/report_controller.rb - About 1 hr to fix

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

    def update(params)
      if params[:chosen_pivot1] && params[:chosen_pivot1] != by1
        self.by1 = params[:chosen_pivot1]
        if params[:chosen_pivot1] == NOTHING_STRING
          self.by2 = NOTHING_STRING
Severity: Minor
Found in app/controllers/report_controller/pivot_options.rb - About 1 hr to fix

Function restructureCatalogData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const restructureCatalogData = function(catalogData, provisionCloudType, retirementCloudType) {
  let restructuredCatalogData = { ...catalogData };

  // adding specify_host_type field for both provision and retirement data
  if (Object.prototype.hasOwnProperty.call(restructuredCatalogData.config_info.provision, 'hosts')) {

Function levelFour has 32 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/reports/helper.js - About 1 hr to fix

Function actionChange has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const actionChange = (value, filterOptions, setData, data) => {
  data.initialValues.action_typ = value;
  if (isAutomation(value)) {
    Promise.all([
      http.post('/ops/automate_schedules_set_vars/new'),
Severity: Minor
Found in app/javascript/components/schedule-form/helper.js - About 1 hr to fix

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

  const onSubmit = (values) => {
    if (values.profile.tz === 'null') {
      values.profile.tz = null;
    }

Severity: Minor
Found in app/javascript/components/settings-time-profile-form/index.jsx - About 1 hr to fix

Method miq_summary_rbac_details has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_summary_rbac_details(users, groups, roles, tenants)
    data = {:title => _("Access control"), :mode => "miq_access_control"}
    rows = []
    if role_allows?(:feature => "rbac_user_view", :any => true)
      rows.push({
Severity: Minor
Found in app/helpers/ops_helper.rb - About 1 hr to fix

Method center_toolbar_filename_pxe has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def center_toolbar_filename_pxe
    if x_active_tree == :pxe_servers_tree
      if x_node == "root"
        return "pxe_servers_center_tb"
      elsif x_node.split('-').first == "pi"
Severity: Minor
Found in app/helpers/application_helper/toolbar_chooser.rb - About 1 hr to fix

Method explorer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def explorer
    @explorer = true
    @trees = []
    return if perfmenu_click?

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

Method git_refresh has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def git_refresh
    @in_a_form = true
    @explorer = true

    session[:changed] = true
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method policy_edit_save has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def policy_edit_save
    assert_privileges("miq_policy_#{@policy.id ? "edit" : "new"}")
    policy = @policy.id.blank? ? MiqPolicy.new : MiqPolicy.find(@policy.id) # Get new or existing record
    policy.mode = @edit[:new][:mode]
    policy.updated_by = session[:userid]
Severity: Minor
Found in app/controllers/miq_policy_controller/policies.rb - About 1 hr to fix

Method ap_show has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ap_show
    # identify_scanitemset
    if @selected_scan.nil?
      flash_to_session(_("Error: Record no longer exists in the database"), :error)
      redirect_to(:action => 'show_list_set')
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 1 hr to fix

Method resizevms has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def resizevms
          case params[:pressed]
          when "instance_resize"
            assert_privileges("instance_resize")
          when "miq_request_edit"
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/resize.rb - About 1 hr to fix

Method set_form_vars has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_form_vars
    case @tabform
    when 'ui_1'
      @edit = {
        :current => {},
Severity: Minor
Found in app/controllers/configuration_controller.rb - About 1 hr to fix

Method get_form_vars has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_form_vars
    copy_params_if_present(@edit[:new], params, %i[st_prov_type name description provision_cost catalog_id dialog_id generic_subtype long_description zone_id price retire_fqname reconfigure_fqname fqname])

    @edit[:new][:display] = params[:display] == "1" if params[:display] # @edit[:new][:display] should't be changed if params[:display] is not set
    # saving it in @edit as well, to use it later because prov_set_form_vars resets @edit[:new]
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method import has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def import
    assert_privileges('policy_import_export')
    @breadcrumbs = []
    @layout = "miq_policy_export"
    @import_file_upload_id = params[:import_file_upload_id]
Severity: Minor
Found in app/controllers/miq_policy_export_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language