ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

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

  render() {
    const validation = (values) => {
      const errors = {};
      if (values.ems_id === '-1') {
        errors.ems_id = __('Required');
Severity: Minor
Found in app/javascript/components/cloud-network-form/cloud-network-form.jsx - About 1 hr to fix

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

  const onSubmit = (values) => {
    const submitValues = prepareSubmitData(values, recId, appliesToClass, appliesToId, initialValues, buttonIcon);
    let saveMessage = sprintf(__(`Custom Button %s has been successfully saved.`), submitValues.name);
    if (recId) {
      API.put(`/api/custom_buttons/${recId}`, submitValues, { skipErrors: [400] })

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

export const buildDataTableObject = (pointChoice) => {
  const tableData = [];
  pointChoice.eventsObj.forEach((event) => {
    // TODO: Different timeline show different data, ensure all necessary data is included
    const emsUrl = event.ext_management_system.type.includes('StorageManager') ? 'ems_storage' : 'ems_infra/show';
Severity: Minor
Found in app/javascript/components/timeline-options/timeline-helper.js - About 1 hr to fix

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

function modal(title, Inner, closed, removeId) {
  const overrides = {
    addClicked: (orig) => Promise.resolve(orig()).then(closed),
    saveClicked: (orig) => Promise.resolve(orig()).then(closed),
    cancelClicked: (orig) => Promise.resolve(orig()).then(closed),
Severity: Minor
Found in app/javascript/provider-dialogs/modal.js - About 1 hr to fix

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

export const getPodsTrendChart = (isLoading, dashboardData) => {
  if (isLoading !== true) {
    if (dashboardData.data.pod_metrics.dataAvailable) {
      const tooltipType = dashboardData.data.pod_metrics.interval_name;
      let config = 'hourlyPodUsageConfig';
Severity: Minor
Found in app/javascript/components/container-projects/helper.jsx - About 1 hr to fix

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

export const removeCatalogItems = (catalogItems) => {
  const apiPromises = [];

  miqSparkleOn();
  catalogItems.forEach((item) => {
Severity: Minor
Found in app/javascript/components/remove-catalog-item-modal.jsx - About 1 hr to fix

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

const GetCompliantResources = ({ ...props }) => {
  const buttonLabel = __('Check Compliant Resources');
  const progressMsg = __('Checking');
  const defaultText = __(' ');
  const helperText = 'Check which currently attached resources comply with the selected capabilities:';

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

  componentDidMount() {
    miqSparkleOn();
    const { catalogId } = this.props;
    if (catalogId) {
      Promise.all([
Severity: Minor
Found in app/javascript/components/catalog-form/catalog-form.jsx - About 1 hr to fix

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

const toolbarReducer = (state, action) => {
  switch (action.type) {
    case 'INCREMENT':
      return {
        ...state,
Severity: Minor
Found in app/javascript/components/miq-toolbar.jsx - About 1 hr to fix

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

export const getOverflowButtons = (widgetButtons, widgetId, widgetType, widgetTitle, setState, widgetModel, lastRun, nextRun) => {
  const menuItems = [];
  const parsedButtons = JSON.parse(widgetButtons);
  parsedButtons.forEach((button) => {
    menuItems.push(<OverflowMenuItem

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

  def get_custom_buttons(model, record, toolbar_result)
    cbses = CustomButtonSet.find_all_by_class_name(button_class_name(model), service_template_id(record))
    cbses = CustomButtonSet.filter_with_visibility_expression(cbses, record)

    cbses.sort_by { |cbs| cbs.set_data[:group_index] }.collect do |cbs|
Severity: Minor
Found in app/helpers/application_helper/toolbar_builder.rb - About 1 hr to fix

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

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

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

  def miq_summary_alert_set_assigned(assigned, alert_profile_tag)
    rows = []
    data = {:title => _('Assigned To'), :mode => "miq_alert_set_assigned"}
    if !assigned[:objects].empty?
      if assigned[:objects].first.kind_of?(MiqEnterprise)
Severity: Minor
Found in app/helpers/miq_alert_set_helper.rb - About 1 hr to fix

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

  def chart_selected(chart_click_data, data_row, ts)
    @record = find_record_with_rbac(data_row["resource_type"].constantize, data_row["resource_id"])
    return [true, nil] unless @record

    # Set the perf options in the selected controller's sandbox
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix

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

  def check_git_task
    assert_privileges('miq_ae_class_import_export')
    task = MiqTask.find(params[:task_id])
    json = if task.state != MiqTask::STATE_FINISHED
             {:state => task.state}
Severity: Minor
Found in app/controllers/miq_ae_tools_controller.rb - About 1 hr to fix

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

  def get_node_info(treenodeid, show_list = true)
    # resetting action that was stored during edit to determine what is being edited
    @sb[:action] = nil

    @nodetype, node_id =
Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

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

  def policies
    @vm = @record = identify_record(params[:id], VmOrTemplate)
    @lastaction = "rsop"
    @showtype = "policies"
    drop_breadcrumb(:name => _("Policy Simulation Details for %{name}") % {:name => @record.name},
Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

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

  def create
    assert_privileges("miq_ae_class_new")
    return unless load_edit("aeclass_edit__new", "replace_cell__explorer")

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

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

    def build_snmp_options(subkey, process_variables)
      refresh = false
      @edit[:new][subkey][:host] = params[:host] if params[:host]         # Actions support a single host in this key
      @edit[:new][subkey][:host][0] = params[:host_1] if params[:host_1]  # Alerts support an array of hosts
      @edit[:new][subkey][:host][1] = params[:host_2] if params[:host_2]
Severity: Minor
Found in app/controllers/mixins/policy_mixin.rb - About 1 hr to fix

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

  def explorer
    @explorer = true
    @lastaction = "explorer"
    @report_deleted = params[:report_deleted] == 'true' if params[:report_deleted]
    @sb[:action] = nil
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language