ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Function setNetworkFormSubmit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const setNetworkFormSubmit = (data, setData, formData, roles, renderData) => {
  if (data.form.action === 'add') {
    // code for add function
    const id = `network${data.dataTable.networkAdapters.length}`;
    const networkData = {
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/network.js - About 2 hrs to fix

Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    // eslint-disable-next-line consistent-return
    const renderSpinner = (spinnerOn) => {
      if (spinnerOn) {
        return (
Severity: Minor
Found in app/javascript/components/remove-generic-item-modal.jsx - About 2 hrs to fix

Function onClick has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const onClick = (button) => {
  let buttonUrl;

  if (button.confirm && !window.confirm(button.confirm)) {
    // No handling unless confirmed.
Severity: Minor
Found in app/javascript/components/miq-toolbar.jsx - About 2 hrs to fix

Method layout_uses_listnav? has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def layout_uses_listnav?
    return false if action_name == "show"
    return false if show_list_with_no_provider?

    return false if show_list_ansible?
Severity: Minor
Found in app/helpers/application_helper/page_layouts.rb - About 2 hrs to fix

Method catalog_basic_information has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def catalog_basic_information(record, sb_params, tenants_tree)
    prov_types = catalog_provision_types
    prov_data = [prov_types[:template], prov_types[:ovf]].include?(record.prov_type) && (catalog_provision?(record, :playbook) || catalog_provision?(record, :terraform_template)) ? provisioning : nil
    data = {:title => _('Basic Information'), :mode => "miq_catalog_basic_information"}
    rows = []
Severity: Minor
Found in app/helpers/catalog_helper.rb - About 2 hrs to fix

Method launch_external_logging has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def launch_external_logging
      assert_privileges('ems_container_launch_external_logging')
      record = self.class.model.find(params[:id])
      ems = record.ext_management_system
      route_name = ems.external_logging_route_name
Severity: Minor
Found in app/controllers/mixins/containers_external_logging_support_mixin.rb - About 2 hrs to fix

Method view_to_hash has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def view_to_hash(view, fetch_data = false)
    root = {:head => [], :rows => []}

    has_checkbox = !@embedded && !@no_checkboxes

Severity: Minor
Found in app/controllers/application_controller.rb - About 2 hrs to fix

Method db_get_node_info has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def db_get_node_info
    model, rec_id, _ = TreeBuilder.extract_node_model_and_id(x_node)
    @sb[:nodes] = x_node.split('-')
    if @sb[:nodes].length == 1
      @default_ws = MiqWidgetSet.where_unique_on("default").where(:read_only => true).first
Severity: Minor
Found in app/controllers/report_controller/dashboards.rb - About 2 hrs to fix

Function KeyValueListComponent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const KeyValueListComponent = (props) => {
  const {
    input, label, keyLabel, valueLabel,
  } = useFieldApi(props);
  const formOptions = useFormApi();

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

const createSchema = (edit, ems, initialValues, state, setState) => {
  let emsId = state.ems_id;
  if (initialValues && initialValues.ems_id) {
    emsId = initialValues.ems_id;
  }

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

  componentDidMount() {
    const {
      recordId, gridChecks, modalData, dispatch,
    } = this.props;
    const itemsIds = gridChecks && Array.isArray(gridChecks) && gridChecks.length > 0 ? _.uniq(gridChecks) : [recordId];
Severity: Minor
Found in app/javascript/components/remove-generic-item-modal.jsx - About 1 hr to fix

Function dataHelper has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const dataHelper = (values, timeProfileId, action, userid) => {
  let data = {};
  let APIaction = 'edit';
  let metrics = values.rollup_daily_metrics;
  let profileType = values.profile_type;
Severity: Minor
Found in app/javascript/components/settings-time-profile-form/helper.js - About 1 hr to fix

Function KeyValueListComponent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const KeyValueListComponent = (props) => {
  const {
    input, label, keyLabel, valueLabel,
  } = useFieldApi(props);
  const formOptions = useFormApi();
Severity: Minor
Found in app/javascript/components/terraform-template-catalog-form/helper.js - About 1 hr to fix

Method included has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.included(included_class)
    included_class.button_group('service_vmdb', [
                                  included_class.select(
                                    :service_vmdb_choice,
                                    nil,
Severity: Minor
Found in app/helpers/application_helper/toolbar/service/vmdb_mixin.rb - About 1 hr to fix

Method build_grid has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_grid
    case @edit[:wf]
    when MiqProvisionConfiguredSystemWorkflow
      build_dialog_page_miq_provision_configured_system_workflow
    when MiqProvisionVirtWorkflow
Severity: Minor
Found in app/controllers/application_controller/miq_request_methods.rb - About 1 hr to fix

Method prov_edit has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prov_edit
    assert_privileges("miq_request_edit")
    if params[:button] == "cancel"
      req = MiqRequest.find(session[:edit][:req_id]) if session[:edit] && session[:edit][:req_id]
      flash_to_session(
Severity: Minor
Found in app/controllers/application_controller/miq_request_methods.rb - About 1 hr to fix

Method schedule_form_fields has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def schedule_form_fields
    assert_privileges("schedule_edit")

    schedule = MiqSchedule.find(params[:id])

Severity: Minor
Found in app/controllers/ops_controller/settings/schedules.rb - About 1 hr to fix

Method prov_set_show_vars has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prov_set_show_vars
    @showtype = "main"
    @options = @miq_request.get_options # Get the provision options from the request record
    @options[:org_controller] = "vm"
    if @options[:schedule_time]
Severity: Minor
Found in app/controllers/application_controller/miq_request_methods.rb - About 1 hr to fix

Method action_type has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def action_type(type, amount)
    case type
    when "advanced_settings"
      n_("Advanced Setting", "Advanced Settings", amount)
    when "disks"
Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

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

  def replace_right_cell(options = {})
    action, presenter = options.values_at(:action, :presenter)
    @explorer = true
    @sb[:action] = action unless action.nil?
    if @sb[:action] || params[:display]
Severity: Minor
Found in app/controllers/infra_networking_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language