ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Function formOptions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var formOptions = function(vm) {
    miqService.sparkleOn();
    if (vm[vm.model].catalog_id !== undefined) {
      allApiPromises.push(API.get('/api/service_catalogs/?expand=resources&attributes=id,name' + sortOptions)
        .then(function(data) {
Severity: Major
Found in app/javascript/oldjs/controllers/playbook-reusable-code-mixin.js - About 2 hrs to fix

Function add_flash has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.add_flash = function(msg, level, options) {
  level = level || 'success';
  options = options || {};
  var cls = { alert: '', icon: '' };

Severity: Major
Found in app/javascript/oldjs/miq_flash.js - About 2 hrs to fix

Function deleteNetwork has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const deleteNetwork = (row, data, setData, roles) => {
  let dataTableData = data.dataTable.networkAdapters || [];
  let submitNetworks = data.submitParams.networks.add || [];
  let addNetworkIds = data.submitParams.networkIds.add || [];
  const deleteNetworksData = data.submitParams.networks.delete || [];
Severity: Major
Found in app/javascript/components/reconfigure-vm-form/helpers/network.js - About 2 hrs to fix

Method dialog_form_button_pressed has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def dialog_form_button_pressed
    case params[:button]
    when "cancel"
      return unless load_edit("dialog_edit__#{params[:id]}", "replace_cell__explorer")

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

Method x_button has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def x_button
    model, action = pressed2model_action(params[:pressed])
    allowed_models = %w[common image instance vm miq_template provider automation storage infra_networking]
    raise ActionController::RoutingError, 'Invalid button action' unless
      allowed_models.include?(model)
Severity: Major
Found in app/controllers/application_controller/explorer.rb - About 2 hrs to fix

Method exp_commit_find has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exp_commit_find(exp)
    if @edit[@expkey][:exp_field].nil?
      add_flash(_("A find field must be chosen to commit this expression element"), :error)
    elsif %w[checkall checkany].include?(@edit[@expkey][:exp_check]) &&
          @edit[@expkey][:exp_cfield].nil?
Severity: Major
Found in app/controllers/application_controller/filter.rb - About 2 hrs to fix

Method buttons_get_node_info has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def buttons_get_node_info(node)
    nodetype = node.split("_")
    # initializing variables to hold data for selected node
    @custom_button = nil
    @sb[:button_groups] = nil
Severity: Major
Found in app/controllers/application_controller/buttons.rb - About 2 hrs to fix

Method cu_build_edit_screen has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def cu_build_edit_screen
    @edit = {}
    @edit[:new] = {}
    @edit[:current] = {}
    @edit[:key] = "cu_edit__collection"
Severity: Major
Found in app/controllers/ops_controller/settings/cap_and_u.rb - About 2 hrs to fix

Method action_field_changed has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def action_field_changed
    return unless load_edit("miq_action_edit__#{params[:id]}")

    @action = @edit[:action_id] ? MiqAction.find(@edit[:action_id]) : MiqAction.new

Severity: Major
Found in app/controllers/miq_action_controller.rb - About 2 hrs to fix

Method provision_dialogs_update_create has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def provision_dialogs_update_create
    case params[:button]
    when "add", "save"
      dialog = params[:id].blank? ? MiqDialog.new : MiqDialog.find(params[:id]) # Get new or existing record
      if params[:name].blank?
Severity: Major
Found in app/controllers/miq_ae_customization_controller/old_dialogs.rb - About 2 hrs to fix

Method set_form_vars has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_form_vars
    @edit[:new][:name] = @record.name
    @edit[:new][:description] = @record.description
    @edit[:new][:long_description] = @record.long_description
    @edit[:new][:provision_cost] = @record.provision_cost
Severity: Major
Found in app/controllers/catalog_controller.rb - About 2 hrs to fix

Function ErrorModalController has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ErrorModalController($timeout) {
  var $ctrl = this;
  $ctrl.data = null;
  $ctrl.error = null;
  $ctrl.isHtml = false;
Severity: Major
Found in app/javascript/oldjs/controllers/error_modal_controller.js - About 2 hrs to fix

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

export const createSchema = (data) => {
  const fields = [
    {
      component: componentTypes.SUB_FORM,
      name: 'EvacuateInstance',
Severity: Major
Found in app/javascript/components/evacuate-form/evacuate-form.schema.js - About 2 hrs to fix

Function MultiSelectWithSelectAll has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MultiSelectWithSelectAll = (props) => {
  const {
    initialValues, options, id, titleText, label, placeholder,
    ...rest
  } = useFieldApi(prepareProps(props));
Severity: Major
Found in app/javascript/components/multiselect-with-selectall/index.js - About 2 hrs to fix

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

function createSchema(routerId, providerFields = [], subnets, loadSchema, emptySchema) {
  if (subnets) showSubnets = true;
  const fields = [{
    component: componentTypes.SUB_FORM,
    title: __('Network Management Provider'),
Severity: Major
Found in app/javascript/components/routers-form/RoutersForm.schema.js - About 2 hrs to fix

Function DiagnosticsCURepairForm has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DiagnosticsCURepairForm = () => {
  const [data, setData] = useState({
    isLoading: true,
    timezones: undefined,
    response: undefined,
Severity: Major
Found in app/javascript/components/c-and-u-collections-form/index.jsx - About 2 hrs to fix

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

  render() {
    const {
      selectedTagCategory, tags, assignedTags,
      onTagDeleteClick, onTagCategoryChange,
      onTagValueChange, onSingleTagValueChange, showReset,

Method edit_reports has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def edit_reports
    @edit[:selected_reports] = []
    current_group_id = current_user.current_group.try(:id).to_i
    id = session[:node_selected].split('__')
    @selected = id[1].split(':')
Severity: Major
Found in app/controllers/report_controller/menus.rb - About 2 hrs to fix

Method db_edit has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def db_edit
    assert_privileges("db_edit")

    case params[:button]
    when "cancel"
Severity: Major
Found in app/controllers/report_controller/dashboards.rb - About 2 hrs to fix

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

const getInitialValues = (recId, setState) => {
  if (recId) {
    API.get(`/api/custom_buttons/${recId}?attributes=resource_action,uri_attributes`)
      .then((initialValues) => {
        if (initialValues.options.button_type === 'ansible_playbook') {
Severity
Category
Status
Source
Language