ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Function link has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    link: function(scope, elem, attr, ctrl) {
      elem.datetimepicker({showClear: true, showClose: true});

      // datetime picker uses its own event for change
      elem.on('dp.change', function(event) {
Severity: Minor
Found in app/javascript/oldjs/directives/datetimepicker.js - About 1 hr to fix

Function miqCheckForChanges has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.miqCheckForChanges = function() {
  let type = 'old'; // 'old' | 'angular' | 'tagging' | 'react'
  let dirty = false;
  const ignore = miqDomElementExists('ignore_form_changes');

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

Method center_toolbar_filename_report has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def center_toolbar_filename_report
    if x_active_tree == :db_tree
      node = x_node
      if %w[root xx-g].include?(node)
        return nil
Severity: Minor
Found in app/helpers/application_helper/toolbar_chooser.rb - About 1 hr to fix

Method miq_catalog_resource has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_catalog_resource(resources)
    headers = ["", _("Name"), _("Description"), _("Action Order"), _("Provision Order"), _("Action Start"), _("Action Stop"), _("Delay (mins) Start"), _("Delay (mins) Stop")]
    data = {:rows => [], :headers => headers}
    prev_group = 0
    resources.sort_by { |rsc| [rsc.group_idx, rsc.resource_name.downcase] }.each_with_index do |r, i|
Severity: Minor
Found in app/helpers/catalog_helper.rb - About 1 hr to fix

Method remove_host has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def remove_host
    assert_privileges("host_aggregate_remove_host")
    @host_aggregate = find_record_with_rbac(HostAggregate, params[:id])

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

Method add_host has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def add_host
    assert_privileges("host_aggregate_add_host")
    @host_aggregate = find_record_with_rbac(HostAggregate, params[:id])

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

Method comp_add_header_compressed has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def comp_add_header_compressed(view, h, i)
    txt = h[:name].truncate(16)
    html_text = ""
    if %w[Vm VmOrTemplate].include?(@sb[:compare_db])
      img = ActionController::Base.helpers.image_path(h.decorate.fileicon)
Severity: Minor
Found in app/controllers/application_controller/compare.rb - About 1 hr to fix

Method adv_search_button has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def adv_search_button
    @edit = session[:edit]
    @view = session[:view]

    # setting default to false
Severity: Minor
Found in app/controllers/application_controller/advanced_search.rb - About 1 hr to fix

Method handle_bottom_cell has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def handle_bottom_cell(presenter)
    if allowed(@sb[:action]) && (@pages || @in_a_form)
      if @pages
        presenter.hide(:form_buttons_div)
      elsif @in_a_form && @sb[:action]
Severity: Minor
Found in app/controllers/miq_ae_customization_controller.rb - About 1 hr to fix

Method tree_select has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def tree_select
    assert_accordion_and_tree_privileges(x_active_tree)
    params[:miq_grid_checks] = []
    @explorer = true
    @lastaction = "explorer"
Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

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

  def button
    case params[:pressed]
    when 'embedded_configuration_script_source_refresh' # refresh repositories
      repository_refresh
    when "embedded_configuration_script_source_edit" # edit repository
Severity: Minor
Found in app/controllers/workflow_repository_controller.rb - About 1 hr to fix

Method folder_get_info has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def folder_get_info(folder_node)
      nodetype, nodeid = folder_node.split("_")
      @sb[:mode] = nil
      @sb[:nodeid] = nil
      @sb[:folder] = nodeid.nil? ? nodetype.split("-").last : nodeid
Severity: Minor
Found in app/controllers/mixins/policy_mixin.rb - About 1 hr to fix

Method retirevms has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Method stacks_ot_copy_submit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def stacks_ot_copy_submit
    assert_privileges('orchestration_template_copy')
    original_template = find_record_with_rbac(OrchestrationTemplate, params[:templateId])
    if params[:templateContent] == original_template.content
      add_flash(_("Unable to create a new template copy \"%{name}\": old and new template content have to differ.") %
Severity: Minor
Found in app/controllers/orchestration_stack_controller.rb - About 1 hr to fix

Method vm_reconfigure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def vm_reconfigure
          assert_privileges('vm_reconfigure_all', :any => true)

          # if coming in to edit from miq_request list view
          recs = checked_or_params
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/reconfigure.rb - About 1 hr to fix

Method alert_profile_build_assign_screen has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def alert_profile_build_assign_screen
    @assign = {}
    @assign[:new] = {}
    @assign[:current] = {}
    @sb[:action] = "miq_alert_set_assign"
Severity: Minor
Found in app/controllers/miq_alert_set_controller.rb - About 1 hr to fix

Method process_saved_reports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def process_saved_reports(saved_reports, task)
    success_count = 0
    failure_count = 0
    params[:miq_grid_checks] = params[:miq_grid_checks]&.split(",")
    MiqReportResult.for_user(current_user).where(:id => saved_reports).order(MiqReportResult.arel_table[:name].lower).each do |rep|
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Method open_parent_nodes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def open_parent_nodes(record)
    existing_node = nil # Init var

    if record.kind_of?(OrchestrationTemplate)
      parents = [:id => template_to_node_name(record)]
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method show_preview has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def show_preview
    assert_privileges(session.fetch_path(:edit, :rpt_id) ? "miq_report_edit" : "miq_report_new")

    unless params[:task_id]                       # First time thru, kick off the report generate task
      @rpt = create_report_object                 # Build a report object from the latest edit fields
Severity: Minor
Found in app/controllers/report_controller/reports.rb - About 1 hr to fix

Method remove_interface has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def remove_interface
    assert_privileges("network_router_remove_interface")
    @router = find_record_with_rbac(NetworkRouter, params[:id])

    case params[:button]
Severity: Minor
Found in app/controllers/network_router_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language