ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Function miqBuildChartMenuEx has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.miqBuildChartMenuEx = function(col, row, _value, category, series, chart_set, chart_index) {
  const chart_data = ManageIQ.charts.chartData[chart_set];
  const chart_el = $(`#miq_chart_parent_${chart_set}_${chart_index}`);
  const chartmenu_el = $(`#miq_chartmenu_${chart_set}_${chart_index}`);
  chartmenu_el.empty();
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr to fix

Function simpleData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const simpleData = () => {
  const miqHeaders = [
    {
      key: 'name',
      header: 'Name',
Severity: Minor
Found in app/javascript/spec/miq-data-table/data.js - About 1 hr to fix

Function settingsLabelTagMappingData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const settingsLabelTagMappingData = () => {
  const headers = [
    { header: __('Resource Entity'), key: 'resource_entity' },
    { header: __('Resource Label'), key: 'resource_label' },
    { header: __('Tag Category'), key: 'tag_category' },
Severity: Minor
Found in app/javascript/spec/settings-label-tag-mapping/data.js - About 1 hr to fix

Function timeProfileReportsData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const timeProfileReportsData = () => {
  const miqHeaders = [
    {
      key: 'name',
      header: 'Name',
Severity: Minor
Found in app/javascript/spec/miq-data-table/data.js - About 1 hr to fix

Function TableListView has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function TableListView(props) {
  const { headers, values, title } = props;

  /** Function to generate heders/rows for the default structured list. */
  const miqListDefaultTable = () => {
Severity: Minor
Found in app/javascript/components/textual_summary/table_list_view.jsx - About 1 hr to fix

Method request_details_summary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def request_details_summary(miq_request, user)
    rows = [
      row_data(_('Request ID'), miq_request.id),
      row_data(_('Status'), _(miq_request.status)),
      row_data(_('Request State'), _(miq_request.state.titleize))
Severity: Minor
Found in app/helpers/request_details_helper.rb - About 1 hr to fix

Method build_select_button has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_select_button(bgi, index)
    bs_children = false
    props = toolbar_button(bgi, :id => bgi[:id], :type => :buttonSelect)
    return nil if props.nil?

Severity: Minor
Found in app/helpers/application_helper/toolbar_builder.rb - About 1 hr to fix

Method reconfigure_form_data has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def reconfigure_form_data(vm = @reconfigitems.first)
    {
      :recordId  => @reconfigitems.collect(&:id),
      :requestId => @request_id || 'new',
      :roles     => {
Severity: Minor
Found in app/helpers/vm_infra_helper.rb - About 1 hr to fix

Method perf_gen_tag_data_after_wait has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perf_gen_tag_data_after_wait
    miq_task = MiqTask.find(params[:task_id])       # Not first time, read the task record
    rpt = miq_task.miq_report_result.report_results # Grab the report object from the blob
    miq_task.destroy                                # Get rid of the task and results

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

Method show_taskbar_in_header? has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def show_taskbar_in_header?
    return false if @explorer
    return false if controller.action_name.end_with?("tagging_edit")

    hide_actions = %w[
Severity: Minor
Found in app/helpers/application_helper.rb - About 1 hr to fix

Method rate_summary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rate_summary(data, optional)
    rows = []
    data.to_a.sort_by { |rd| [rd.chargeable_field[:group].downcase, rd.chargeable_field[:description].downcase, rd[:sub_metric].to_s.downcase] }.each_with_index do |detail, detail_index|
      cells = []
      tiers = detail.chargeback_tiers.order(:start)
Severity: Minor
Found in app/helpers/chargeback_rate_helper.rb - About 1 hr to fix

Method at_tree_select has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def at_tree_select(edit_key)
    id = parse_nodetype_and_id(params[:id]).last
    if params[:id].start_with?("aei-")
      record = MiqAeInstance.find_by(:id => id)
      @edit[:automate_tree_selected_path] = record.fqname
Severity: Minor
Found in app/helpers/automate_tree_helper.rb - About 1 hr to fix

Method build_tags_for_provisioning has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_tags_for_provisioning(wf, vm_tags, _edit_mode)
    # for some reason @tags is set in wf, and it is changed by map bellow which causes bugs
    wf.instance_variable_set(:@tags, nil)
    tags = wf.allowed_tags.map do |cat|
      {
Severity: Minor
Found in app/controllers/application_controller/miq_request_methods.rb - About 1 hr to fix

Method resolve_button_throw has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def resolve_button_throw
    if valid_resolve_object?
      add_flash(_("Automation Simulation has been run"))
      @sb[:name] = @resolve[:new][:instance_name].presence || @resolve[:new][:other_name]
      @sb[:attrs] = {}
Severity: Minor
Found in app/controllers/application_controller/automate.rb - About 1 hr to fix

Method build_download_rpt has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_download_rpt(cols, csv, typ)
    if typ.nil? || typ == "all"
      if csv # If generating CSV, remove * from data
        cols.each_with_index do |c, i|
          if c.to_s.starts_with?("* ")
Severity: Minor
Found in app/controllers/application_controller/compare.rb - About 1 hr to fix

Method adv_search_build has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def adv_search_build(model)
    # Restore @edit hash if it's saved in @settings
    @expkey = :expression # Reset to use default expression key
    if session.fetch_path(:adv_search, model.to_s) && %w[tag service_tag].exclude?(@sb[:action])
      adv_search_model = session[:adv_search][model.to_s]
Severity: Minor
Found in app/controllers/application_controller/advanced_search.rb - About 1 hr to fix

Method retrieve_git_datastore has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def retrieve_git_datastore
    assert_privileges('miq_ae_class_import_export')
    git_url = params[:git_url]

    if git_url.blank?
Severity: Minor
Found in app/controllers/miq_ae_tools_controller.rb - About 1 hr to fix

Method policy_field_changed has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def policy_field_changed
    return unless load_edit("miq_policy_edit__#{params[:id]}")

    case @edit[:typ]
    when "events"
Severity: Minor
Found in app/controllers/miq_policy_controller/policies.rb - About 1 hr to fix

Method ap_set_record_vars has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ap_set_record_vars(mems, scanitemset)
    unless mems.empty?
      mems_to_delete = []
      mems.each { |m| mems_to_delete.push(m) }
      ap_deletescanitems(mems_to_delete)
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 1 hr to fix

Method delete_subnets has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def delete_subnets
    assert_privileges("cloud_subnet_delete")
    subnets = find_records_with_rbac(CloudSubnet, checked_or_params)

    subnets_to_delete = []
Severity: Minor
Found in app/controllers/cloud_subnet_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language