ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method st_set_record_vars has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def st_set_record_vars(st)
    common_st_record_vars(st)
    st.remove_all_resources
    @add_rsc = true
    unless @edit[:new][:selected_resources].empty?
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method upload has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def upload
    assert_privileges("miq_report_export")

    @sb[:flash_msg] = []
    if params.fetch_path(:upload, :file) && File.size(params[:upload][:file].tempfile).zero?
Severity: Minor
Found in app/controllers/report_controller.rb - About 1 hr to fix

Method render_exception has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def render_exception(msg, error)
    respond_to do |format|
      format.js do
        render :update do |page|
          page << javascript_prologue
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Function miqOnLoad has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.miqOnLoad = function() {
  // controller to be used in url in miqDropComplete method
  ManageIQ.widget.dashboardUrl = 'dashboard/widget_dd_done';

  // Initialize the dashboard column sortables
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr to fix

Function miqInitCodemirror has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.miqInitCodemirror = function(options) {
  if (!miqDomElementExists(options.text_area_id)) {
    return;
  }

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

Function saveDialogDetails has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function saveDialogDetails() {
    var action;
    var dialogData;
    var dialogId;

Function createSchema has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createSchema(ems, recordId, loadSchema, emptySchema, providerFields = []) {
  const providers = ems.filter((tenant) => tenant.type !== 'ManageIQ::Providers::Nuage::NetworkManager');
  const providerOptions = providers.map(({ id, name }) => ({ label: name, value: id }));
  providerOptions.unshift({ label: `<${__('Choose')}>`, value: '-1' });

Function Quaditem has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Quaditem = (props) => {
  const {
    text, fonticon, color, fileicon, piechart, className, tooltip, background,
  } = props;
  const shortText = abbrNumber(text);
Severity: Minor
Found in app/javascript/components/quadicon/Quaditem.jsx - About 1 hr to fix

Function GenericTableRow has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function GenericTableRow(props) {
  const { item, onClick } = props;
  const value = renderValue(item.value, onClick);

  return (
Severity: Minor
Found in app/javascript/components/textual_summary/generic_table_row.jsx - About 1 hr to fix

Method report_schedule has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def report_schedule(schedules)
    data = {:title => _('Schedules'), :mode => "miq_report_schedules bordered-list simple_table", :rows => []}
    if schedules.blank?
      data[:message] = _("Report is not Scheduled.")
    else
Severity: Minor
Found in app/helpers/report_helper/report_information_helper.rb - About 1 hr to fix

Function componentDidMount has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  componentDidMount() {
    const apiPromises = [];
    const { recordId, gridChecks, dispatch } = this.props;
    const catalogItemsIds = recordId ? [recordId] : _.uniq(gridChecks);

Severity: Minor
Found in app/javascript/components/remove-catalog-item-modal.jsx - About 1 hr to fix

Method list_view has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def list_view(display, record)
    data = {:mode => "miq_host_#{display}"}
    rows = []
    case display
    when "devices"
Severity: Minor
Found in app/helpers/host_helper.rb - About 1 hr to fix

Method set_active_tab has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_active_tab(nodetype)
    node = nodetype.downcase.split("-")
    case x_active_tree
    when :settings_tree
      case node[0]
Severity: Minor
Found in app/controllers/ops_controller.rb - About 1 hr to fix

Method prefill_val_types has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def prefill_val_types
      self.val1 ||= {}
      self.val2 ||= {}
      val1[:type] = case exp_typ
                    when 'field'
Severity: Minor
Found in app/controllers/application_controller/filter/expression.rb - About 1 hr to fix

Method chart_chooser has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def chart_chooser
    assert_privileges('utilization')
    unless params[:task_id] # Only do this first time thru
      @sb[:options][:chart_date] = params[:miq_date_1] if params[:miq_date_1]
      @sb[:options][:chart_date] = params[:miq_date_2] if params[:miq_date_2]
Severity: Minor
Found in app/controllers/utilization_controller.rb - About 1 hr to fix

Method add_update_method_add has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def add_update_method_add
    method = params[:id] != "new" ? find_record_with_rbac(MiqAeMethod, params[:id]) : MiqAeMethod.new
    old_method_attributes = method.attributes.clone

    method.name = params["name"]
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method miq_policy_edit_events has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_policy_edit_events
    assert_privileges('miq_policy_events_assignment')
    case params[:button]
    when "cancel"
      @sb[:action] = @edit = nil
Severity: Minor
Found in app/controllers/miq_policy_controller/policies.rb - About 1 hr to fix

Method rbac_replace_right_cell has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_replace_right_cell(nodetype, presenter)
    if %w[accordion_select change_tab tree_select].include?(params[:action])
      presenter.replace(:ops_tabs, r[:partial => "all_tabs"])
    elsif nodetype == "group_seq"
      presenter.update(:rbac_details, r[:partial => "ldap_seq_form"])
Severity: Minor
Found in app/controllers/ops_controller.rb - About 1 hr to fix

Method set_instances_form_vars has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_instances_form_vars
    session[:inst_data] = {}
    @edit = {
      :ae_inst_id  => @ae_inst.id,
      :ae_class_id => @ae_class.id,
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method rsop_option_changed has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rsop_option_changed
    assert_privileges('policy_simulation')
    if params[:event_typ]
      @sb[:rsop][:event] = params[:event_typ].presence
      @sb[:rsop][:event_value] = nil
Severity: Minor
Found in app/controllers/miq_policy_rsop_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language