ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Method get_node_info_handle_leaf_node has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_node_info_handle_leaf_node(id)
    show_record(id)
    if @record.atomic? && need_prov_dialogs?(@record.prov_type)
      @miq_request = MiqRequest.find_by(:id => @record.service_resources[0].resource_id) if @record.service_resources[0]&.resource_id
      if @miq_request
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

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

export const createSchema = (data) => {
  const fields = [
    {
      component: componentTypes.SUB_FORM,
      name: 'MigrateInstance',

Function deleteDisk has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const deleteDisk = (row, data, setData) => {
  let dataTableData = data.dataTable.disks;
  let addDisks = data.submitParams.disks.add || [];
  const deleteDisks = data.submitParams.disks.delete || [];
  let addDiskIds = data.submitParams.diskIds.add || [];
Severity: Minor
Found in app/javascript/components/reconfigure-vm-form/helpers/disk.js - About 1 hr to fix

Method set_method_form_vars has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_method_form_vars
    session[:field_data] = {}
    @ae_class = ae_class_for_instance_or_method(@ae_method)
    @edit = {}
    session[:edit] = {}
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method rbac_edit_reset has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rbac_edit_reset(operation, what, klass)
    key = what.to_sym
    if operation != "new"
      record = find_record_with_rbac(klass, checked_or_params)
      if %i[group role].include?(key) && record && record.read_only && operation != 'copy'
Severity: Minor
Found in app/controllers/ops_controller/ops_rbac.rb - About 1 hr to fix

Method label_tag_mapping_edit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def label_tag_mapping_edit
    assert_privileges("region_edit")

    case params[:button]
    when "cancel"
Severity: Minor
Found in app/controllers/ops_controller/settings/label_tag_mapping.rb - About 1 hr to fix

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      text: '1990',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 156..174
app/javascript/spec/quadicon/data/quadicons.js on lines 263..281
app/javascript/spec/quadicon/data/quadicons.js on lines 282..300
app/javascript/spec/quadicon/data/quadicons.js on lines 301..319
app/javascript/spec/quadicon/data/quadicons.js on lines 389..407
app/javascript/spec/quadicon/data/quadicons.js on lines 408..426

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      text: '?',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 156..174
app/javascript/spec/quadicon/data/quadicons.js on lines 197..215
app/javascript/spec/quadicon/data/quadicons.js on lines 282..300
app/javascript/spec/quadicon/data/quadicons.js on lines 301..319
app/javascript/spec/quadicon/data/quadicons.js on lines 389..407
app/javascript/spec/quadicon/data/quadicons.js on lines 408..426

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      text: '17',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 197..215
app/javascript/spec/quadicon/data/quadicons.js on lines 263..281
app/javascript/spec/quadicon/data/quadicons.js on lines 282..300
app/javascript/spec/quadicon/data/quadicons.js on lines 301..319
app/javascript/spec/quadicon/data/quadicons.js on lines 389..407
app/javascript/spec/quadicon/data/quadicons.js on lines 408..426

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      text: '9999',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 156..174
app/javascript/spec/quadicon/data/quadicons.js on lines 197..215
app/javascript/spec/quadicon/data/quadicons.js on lines 263..281
app/javascript/spec/quadicon/data/quadicons.js on lines 282..300
app/javascript/spec/quadicon/data/quadicons.js on lines 301..319
app/javascript/spec/quadicon/data/quadicons.js on lines 408..426

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

export const networkHeaders = [
  { key: 'name', header: 'Name' },
  { key: 'mac', header: 'MAC address' },
  { key: 'vlan', header: 'vLan' },
  { key: 'edit', header: 'Edit' },
Severity: Major
Found in app/javascript/spec/reconfigure-vm-form/datatable-data.js and 3 other locations - About 1 hr to fix
app/javascript/spec/evacuate-form/data.js on lines 1..7
app/javascript/spec/live-migrate-form/data.js on lines 1..7
app/javascript/spec/schedule-form/data.js on lines 70..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      fileicon: '/assets/vendor-ubuntu.svg',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 156..174
app/javascript/spec/quadicon/data/quadicons.js on lines 197..215
app/javascript/spec/quadicon/data/quadicons.js on lines 263..281
app/javascript/spec/quadicon/data/quadicons.js on lines 282..300
app/javascript/spec/quadicon/data/quadicons.js on lines 389..407
app/javascript/spec/quadicon/data/quadicons.js on lines 408..426

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      text: '99999',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 156..174
app/javascript/spec/quadicon/data/quadicons.js on lines 197..215
app/javascript/spec/quadicon/data/quadicons.js on lines 263..281
app/javascript/spec/quadicon/data/quadicons.js on lines 282..300
app/javascript/spec/quadicon/data/quadicons.js on lines 301..319
app/javascript/spec/quadicon/data/quadicons.js on lines 389..407

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

export const hosts = [
  { name: 'hostone', id: 'hostone' },
  { name: 'hosttwo', id: 'hosttwo' },
  { name: 'hostthree', id: 'hostthree' },
  { name: 'hostfour', id: 'hostfour' },
Severity: Major
Found in app/javascript/spec/live-migrate-form/data.js and 3 other locations - About 1 hr to fix
app/javascript/spec/evacuate-form/data.js on lines 1..7
app/javascript/spec/reconfigure-vm-form/datatable-data.js on lines 31..37
app/javascript/spec/schedule-form/data.js on lines 70..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

export const timezones = [
  { name: 'International Date Line West', description: '(GMT-12:00) International Date Line West' },
  { name: 'American Samoa', description: '(GMT-11:00) American Samoa' },
  { name: 'Midway Island', description: '(GMT-11:00) Midway Island' },
  { name: 'Hawaii', description: '(GMT-10:00) Hawaii' },
Severity: Major
Found in app/javascript/spec/schedule-form/data.js and 3 other locations - About 1 hr to fix
app/javascript/spec/evacuate-form/data.js on lines 1..7
app/javascript/spec/live-migrate-form/data.js on lines 1..7
app/javascript/spec/reconfigure-vm-form/datatable-data.js on lines 31..37

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  if (durationString.indexOf('S') >= 0) {
    resultString += `${durationString.slice(startIndex, durationString.indexOf('S'))}s`;
    startIndex = durationString.indexOf('S') + 1;
  }
Severity: Major
Found in app/javascript/components/request-workflow-status/data.js and 2 other locations - About 1 hr to fix
app/javascript/components/request-workflow-status/data.js on lines 52..55
app/javascript/components/request-workflow-status/data.js on lines 56..59

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  return {
    is_button: true,
    title: __('Delete'),
    text: __('Delete'),
    alt: __('Delete'),
app/javascript/components/reconfigure-vm-form/helpers/drive.js on lines 128..136
app/javascript/components/reconfigure-vm-form/helpers/drive.js on lines 138..146

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  return {
    is_button: true,
    title: __('Disconnect'),
    text: __('Disconnect'),
    alt: __('Disconnect'),
app/javascript/components/reconfigure-vm-form/helpers/drive.js on lines 128..136
app/javascript/components/reconfigure-vm-form/helpers/network.js on lines 173..181

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

  if (durationString.indexOf('H') >= 0) {
    resultString += `${durationString.slice(startIndex, durationString.indexOf('H'))}h `;
    startIndex = durationString.indexOf('H') + 1;
  }
Severity: Major
Found in app/javascript/components/request-workflow-status/data.js and 2 other locations - About 1 hr to fix
app/javascript/components/request-workflow-status/data.js on lines 56..59
app/javascript/components/request-workflow-status/data.js on lines 60..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

  {
    topLeft: {
      fileicon: '/assets/vendor-centos.svg',
      tooltip: 'Hello, I am a very useful tooltip in the first quadrant!',
    },
Severity: Major
Found in app/javascript/spec/quadicon/data/quadicons.js and 6 other locations - About 1 hr to fix
app/javascript/spec/quadicon/data/quadicons.js on lines 156..174
app/javascript/spec/quadicon/data/quadicons.js on lines 197..215
app/javascript/spec/quadicon/data/quadicons.js on lines 263..281
app/javascript/spec/quadicon/data/quadicons.js on lines 301..319
app/javascript/spec/quadicon/data/quadicons.js on lines 389..407
app/javascript/spec/quadicon/data/quadicons.js on lines 408..426

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language