ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

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

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

  def add_interface
    assert_privileges("network_router_add_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

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

  def widget_validate_entries
    if %w[r c].include?(@sb[:wtype]) && (!@edit[:new][:repfilter] || @edit[:new][:repfilter] == "")
      add_flash(_("A Report must be selected"), :error)
    end
    if %w[role group].include?(@edit[:new][:visibility_typ])
Severity: Minor
Found in app/controllers/report_controller/widgets.rb - About 1 hr to fix

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

  def heatmaps
    # Get latest hourly rollup for each node.
    cluster_ids = @ems.ems_clusters if @ems.present?
    metrics = MetricRollup.latest_rollups(EmsCluster.name, cluster_ids)
    metrics = metrics.where('timestamp > ?', 30.days.ago.utc).includes(:resource)
Severity: Minor
Found in app/services/ems_infra_dashboard_service.rb - About 1 hr to fix

Function renderGitImport has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderGitImport: function(branches, tags, gitRepoId, messages) {
    clearMessages();

    var message = messages.message;
    var messageLevel = messages.level;
Severity: Minor
Found in app/javascript/oldjs/automate_import_export.js - About 1 hr to fix

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

    link: function(scope, elem, attr, ctrl) {
      scope['form_' + ctrl.$name] = elem[0];
      scope['form_' + ctrl.$name + '_timerHide'] = attr.timerHide;

      scope.$watch(attr.ngModel, function() {
Severity: Minor
Found in app/javascript/oldjs/directives/scheduler/updateDropdownForTimer.js - About 1 hr to fix
Severity
Category
Status
Source
Language