ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Method chart_current_hourly has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def chart_current_hourly(ts)
    @record = identify_tl_or_perf_record
    @perf_record = @record.kind_of?(MiqServer) ? @record.vm : @record # Use related server vm record
    @perf_options[:typ] = "Hourly"
    @perf_options[:hourly_date] = [ts.month, ts.day, ts.year].join("/")
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix

Method rbac_and_user_make_subarrays has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_and_user_make_subarrays
    if @set_filter_values.present?
      temp1arr = []
      @set_filter_values = @set_filter_values.flatten
      temp_categories = @set_filter_values.dup
Severity: Minor
Found in app/controllers/ops_controller.rb - About 1 hr to fix

Method adv_search_button_delete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def adv_search_button_delete
    s = MiqSearch.find(@edit[@expkey][:selected][:id])
    id = s.id
    sname = s.description
    begin
Severity: Minor
Found in app/controllers/application_controller/advanced_search.rb - About 1 hr to fix

Method get_event_actions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_event_actions
    @event ||= MiqEventDefinition.find_by(:id => @edit[:new][:event_id])
    @edit[:new][:actions_true] = []
    @policy ||= MiqPolicy.find_by(:id => @edit[:new][:policy_id]) # Get the policy above this event

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

Method label_tag_mapping_update has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def label_tag_mapping_update(id, cat_description)
    assert_privileges("region_edit")
    mapping = ProviderTagMapping.find(id)
    begin
      if mapping.labeled_resource_type == ALL_ENTITIES
Severity: Minor
Found in app/controllers/ops_controller/settings/label_tag_mapping.rb - About 1 hr to fix

Method label_tag_mapping_delete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def label_tag_mapping_delete
    assert_privileges("region_edit")
    mapping = ProviderTagMapping.find(params[:id])
    category = mapping.tag.classification
    label_name = mapping.label_name
Severity: Minor
Found in app/controllers/ops_controller/settings/label_tag_mapping.rb - About 1 hr to fix

Method replace_right_cell has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def replace_right_cell(options = {})
    # FIXME: nodetype passed here, but not used
    _nodetype, replace_trees = options.values_at(:nodetype, :replace_trees)
    replace_trees = @replace_trees if @replace_trees # get_node_info might set this
    # FIXME
Severity: Minor
Found in app/controllers/storage_controller.rb - About 1 hr to fix

Method delete_networks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def delete_networks
    assert_privileges("cloud_network_delete")
    networks = find_records_with_rbac(CloudNetwork, checked_or_params)
    networks_to_delete = []
    networks.each do |network|
Severity: Minor
Found in app/controllers/cloud_network_controller.rb - About 1 hr to fix

Method iso_datastore_button_operation has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def iso_datastore_button_operation(method, display_name)
    isds = []

    # Either a list or coming from a different controller (eg from host screen, go to its vms)
    if !params[:id]
Severity: Minor
Found in app/controllers/pxe_controller/iso_datastores.rb - About 1 hr to fix

Method timeprofile_delete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def timeprofile_delete
    assert_privileges("my_settings_time_profiles")
    timeprofiles = []
    unless params[:id] # showing a list, scan all selected timeprofiles
      timeprofiles = find_checked_items
Severity: Minor
Found in app/controllers/configuration_controller.rb - About 1 hr to fix

Method show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def show
      return if perfmenu_click?
      return unless init_show

      @center_toolbar = self.class.toolbar_singular if self.class.toolbar_singular
Severity: Minor
Found in app/controllers/mixins/generic_show_mixin.rb - About 1 hr to fix

Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create
    assert_privileges("cloud_network_new")
    case params[:button]
    when "cancel"
      javascript_redirect(:action    => 'show_list',
Severity: Minor
Found in app/controllers/cloud_network_controller.rb - About 1 hr to fix

Method show_association has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def show_association(action, display_name, method, klass, association = nil, scopes = nil)
      params[:display] = klass.name
      # Ajax request means in explorer, or if current explorer is one of the explorer controllers
      @explorer = true if request.xml_http_request? && explorer_controller?
      if @explorer # Save vars for tree history array
Severity: Minor
Found in app/controllers/mixins/explorer_show.rb - About 1 hr to fix

Method edit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def edit
      assert_privileges("#{permission_prefix}_edit")
      begin
        @ems = find_record_with_rbac(model, params[:id]) ## TODO is params[:id] supposed to be checked_item_id? This assumes only one id is passed in
      rescue => err
Severity: Minor
Found in app/controllers/mixins/ems_common.rb - About 1 hr to fix

Method get_cis_all has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_cis_all
    @edit[:cb_assign][:cis] = {}
    klass = @edit[:new][:cbshow_typ]
    return if klass == NOTHING_FORM_VALUE || klass.nil? # no rate was selected
    unless WHITELIST_INSTANCE_TYPE.include?(klass)
Severity: Minor
Found in app/controllers/chargeback_assignment_controller.rb - About 1 hr to fix

Method features has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def features
    [
      {
        :role     => "pxe_server_accord",
        :role_any => true,
Severity: Minor
Found in app/controllers/pxe_controller.rb - About 1 hr to fix

Method features has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def features
    [
      {
        :role     => "svc_catalog_accord",
        :role_any => true,
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method svc_catalog_provision has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def svc_catalog_provision
    assert_privileges("svc_catalog_provision")
    checked = find_checked_items
    checked[0] = params[:id] if checked.blank? && params[:id]
    st = find_record_with_rbac(ServiceTemplate, checked[0])
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method menu_folders has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def menu_folders(view)
    view.compact.map do |row|
      row_id = nil

      if @edit[:user_typ]
Severity: Minor
Found in app/controllers/report_controller/menus.rb - About 1 hr to fix

Method prov_copy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prov_copy
    assert_privileges("miq_request_copy")
    org_req = MiqRequest.where(:id => params[:req_id].to_i).first
    req = MiqRequest.new(
      :approval_state => 'pending_approval',
Severity: Minor
Found in app/controllers/miq_request_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language