ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Method delete_cloud_tenants has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def delete_cloud_tenants
    assert_privileges("cloud_tenant_delete")
    tenants = find_records_with_rbac(CloudTenant, checked_or_params)
    tenants_to_delete = []
    tenants.each do |tenant|
Severity: Minor
Found in app/controllers/cloud_tenant_controller.rb - About 1 hr to fix

Method heatmaps_data has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def heatmaps_data(metrics)
    node_cpu_usage = []
    node_memory_usage = []

    metrics.each do |m|
Severity: Minor
Found in app/services/container_dashboard_service.rb - About 1 hr to fix

Method notification_data has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def notification_data(components, component_type)
    if components&.first.respond_to?(:health_state)
      count = 0
      health_states = components.each_with_object({}) do |component, health_state|
        health_state[component.health_state&.downcase] = (health_state[component.health_state&.downcase] || 0) + 1
Severity: Minor
Found in app/services/ems_physical_infra_dashboard_service.rb - About 1 hr to fix

Function selectListElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var selectListElement = function(scope, timeout, ctrl, refresh) {
  timeout(function() {
    if (refresh) {
      if (scope[scope['form_' + ctrl.$name + '_ngHide']] === true) {
        angular.element(scope['form_' + ctrl.$name]).selectpicker('hide');

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

function createSchema(ems, cloudNetworkId, loadSchema, emptySchema, providerFields = []) {
  const providers = ems.filter((tenant) => tenant.type !== 'ManageIQ::Providers::Nuage::NetworkManager');
  const fields = [{
    component: componentTypes.SUB_FORM,
    title: __('Network Provider'),

Function datetime_range has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    datetime_range: function(val, options) {
      options = options || {};
      if (!options.format) {
        return val;
      }
Severity: Minor
Found in app/javascript/oldjs/miq_formatters.js - About 1 hr to fix

Function link has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    link: function(_scope, _elm, attrs, ctrl) {
      function multipleValidator(modelValue) {
        var memtype = attrs.memtype;
        var multiple = attrs.validateMultiple;
        var minvalue = attrs.miqmin;
Severity: Minor
Found in app/javascript/oldjs/directives/reconfigure/validateMultiple.js - About 1 hr to fix

Function cancelDisconnectDrives has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const cancelDisconnectDrives = (row, data, setData) => {
  const { id } = row;
  const index = id.substring(5);
  const datatableData = data.dataTable.drives;
  datatableData[index].filename = datatableData[index].disconnect_filename;
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/drive.js - About 1 hr to fix

Function reducers has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const reducers = (oncheck, onclick) => (state = {}, action) => {
  const node = action.nodeId !== undefined ? Tree.nodeSelector(state, action.nodeId) : undefined;

  switch (action.type) {
    case ACTIONS.CHECKED_DIRECTLY:
Severity: Minor
Found in app/javascript/components/tree-view/reducers/index.js - About 1 hr to fix

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

export const createSchema = (recordId, data, setData, roles, options, memory, onCellClick, buttonClick) => {
  let formFields;

  switch (data.form.type) {
    case TYPES.DISK:

Function getPodsData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getPodsData = (data, createdlabel, deletedLabel) => {
  if (data && data.xData && data.yCreated && data.yDeleted) {
    const columnsData = data.xData;
    const createdData = data.yCreated;
    const deletedData = data.yDeleted;
Severity: Minor
Found in app/javascript/components/provider-dashboard-charts/helpers.js - About 1 hr to fix

Function cancelConnectDrives has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const cancelConnectDrives = (row, data, setData) => {
  const { id } = row;
  const index = id.substring(5);
  const datatableData = data.dataTable.drives;
  datatableData[index].filename = datatableData[index].old_filename;
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/drive.js - About 1 hr to fix

Function cancelEditNetwork has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const cancelEditNetwork = (row, data, setData, roles) => {
  const index = row.id.substring(7);
  const networkRows = data.dataTable.networkAdapters;

  if (!roles.isVmwareCloud) {
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/network.js - About 1 hr to fix

Function taggingMiddleware has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const taggingMiddleware = (store) => (next) => (action) => {
  let selected;

  const { type, meta, tag } = action;
  if (meta && meta.url) {
Severity: Minor
Found in app/javascript/miq-redux/middleware.js - About 1 hr to fix

Function packagesFromModules has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const packagesFromModules = (modules) => {
  // find the package.json file for each module
  modules = modules.filter(m => m.includes("node_modules"));
  var packagePaths = modules.map(m => {
    var match = m.match(/(.*node_modules\/)([^/]+)(\/[^/]+)?/);
Severity: Minor
Found in config/webpack/production.js - About 1 hr to fix

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

  const onSubmit = (values) => {
    miqSparkleOn();

    var vm_id, volume_id, redirectUrl;
    if (dropdownLabel == "Instance") {

Function setRenderForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const setRenderForm = (row, type, action) => {
    if (type === TYPES.DISK && action === 'edit') {
      return true;
    }
    if (type === TYPES.NETWORK || type === TYPES.EDITNETWORK) {
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/index.jsx - About 1 hr to fix

Function FormButtons has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function FormButtons(props) {
  const primaryTitle = props.customLabel || (props.newRecord ? __('Add') : __('Save'));
  const primaryHandler = (props.newRecord ? props.addClicked : props.saveClicked) || props.addClicked || props.saveClicked;

  // NOTE: These strings will be translated by <MiqButton />
Severity: Minor
Found in app/javascript/forms/form-buttons.jsx - About 1 hr to fix

Method apply_common_props has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def apply_common_props(button, input)
    button.update(
      :color        => input[:color],
      :data         => button.data(input[:data]),
      :hidden       => button[:hidden] || !!input[:hidden],
Severity: Minor
Found in app/helpers/application_helper/toolbar_builder.rb - About 1 hr to fix

Method calculate_disk_name has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def calculate_disk_name(disk)
    case disk.device_type
    when "cdrom-raw"
      "CD-ROM (IDE #{disk.location})"
    when "atapi-cdrom"
Severity: Minor
Found in app/helpers/vm_helper.rb - About 1 hr to fix
Severity
Category
Status
Source
Language