ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

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

          Object.entries(initialValues.properties.attributes).forEach((attr) => {
            initialValues.attributes.push({ attributes_name: attr[0], type: attr[1] });
          });
Severity: Major
Found in app/javascript/components/generic-objects-form/index.jsx and 1 other location - About 1 hr to fix
app/javascript/components/generic-objects-form/index.jsx on lines 43..45

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 66.

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

Function getSubmitData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getSubmitData = (values) => {
  let customIdentifier = '';
  let description = '';
  let parentResource = null;
  const childResources = [];
Severity: Minor
Found in app/javascript/components/vm-edit-form/helper.js - About 1 hr to fix

Method comparemiq has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def comparemiq
    assert_privileges(params[:pressed])
    items = if !session[:checked_items].nil? && @lastaction == "set_checked_items"
              session[:checked_items]
            else
Severity: Minor
Found in app/controllers/application_controller/compare.rb - About 1 hr to fix

Method group_set_form_vars has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def group_set_form_vars
    @sb[:buttons_node] = true
    if session[:resolve]
      @resolve = session[:resolve]
    else
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method create_instance has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_instance
    assert_privileges("miq_ae_instance_new")
    case params[:button]
    when "cancel"
      @sb[:action] = session[:edit] = nil # clean out the saved info
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method update has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def update
    assert_privileges("security_group_edit")
    @security_group = find_record_with_rbac(SecurityGroup, params[:id])

    case params[:button]
Severity: Minor
Found in app/controllers/security_group_controller.rb - About 1 hr to fix

Method sync_users has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def sync_users
    assert_privileges('ems_cloud_user_sync')
    ems = find_record_with_rbac(model, params[:id])
    @in_a_form = true
    drop_breadcrumb(:name => _("Sync Users"), :url => "/ems_cloud/sync_users")
Severity: Minor
Found in app/controllers/ems_cloud_controller.rb - About 1 hr to fix

Method set_ownership has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def set_ownership
          assert_privileges(params[:pressed])
          # check to see if coming from show_list or drilled into vms from another CI
          controller = if request.parameters[:controller] == "vm" || %w[all_vms vms instances].include?(params[:display])
                         "vm"
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/ownership.rb - About 1 hr to fix

Method old_dialogs_button_operation has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def old_dialogs_button_operation(method, display_name)
    dialogs = []

    # Either a list or coming from a different controller (eg from host screen, go to its vms)
    if !params[:id]
Severity: Minor
Found in app/controllers/miq_ae_customization_controller/old_dialogs.rb - About 1 hr to fix

Method x_get_tree_roots has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def x_get_tree_roots
    nodes = [
      {:id   => 'otcfn',
       :tree => "otcfn_tree",
       :text => _("CloudFormation Templates"),
Severity: Minor
Found in app/presenters/tree_builder_orchestration_templates.rb - About 1 hr to fix

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

  button_group('container_group_policy', [
    select(
      :container_group_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/container_images_center.rb on lines 23..62
app/helpers/application_helper/toolbar/container_nodes_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_replicators_center.rb on lines 2..41
app/helpers/application_helper/toolbar/ems_containers_center.rb on lines 61..100

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 68.

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 5 locations. Consider refactoring.
Open

  button_group('ems_container_policy', [
    select(
      :ems_container_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/container_groups_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_images_center.rb on lines 23..62
app/helpers/application_helper/toolbar/container_nodes_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_replicators_center.rb on lines 2..41

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 68.

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

  button_group('ems_infra_policy', [
    select(
      :ems_infra_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/ems_clouds_center.rb on lines 49..88
app/helpers/application_helper/toolbar/ems_physical_infras_center.rb on lines 48..87

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 68.

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

  button_group('miq_template_policy', [
    select(
      :miq_template_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/miq_templates_center.rb on lines 62..111
app/helpers/application_helper/toolbar/template_clouds_center.rb on lines 92..141

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 68.

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 5 locations. Consider refactoring.
Open

  button_group('container_node_policy', [
    select(
      :container_node_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/container_groups_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_images_center.rb on lines 23..62
app/helpers/application_helper/toolbar/container_replicators_center.rb on lines 2..41
app/helpers/application_helper/toolbar/ems_containers_center.rb on lines 61..100

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 68.

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

  button_group('ems_physical_infra_policy', [
    select(
      :ems_physical_infra_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/ems_clouds_center.rb on lines 49..88
app/helpers/application_helper/toolbar/ems_infras_center.rb on lines 49..88

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 68.

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

  button_group('miq_template_policy', [
    select(
      :miq_template_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/template_clouds_center.rb on lines 92..141
app/helpers/application_helper/toolbar/template_infras_center.rb on lines 72..121

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 68.

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 5 locations. Consider refactoring.
Open

  button_group('container_image_policy', [
    select(
      :container_image_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/container_groups_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_nodes_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_replicators_center.rb on lines 2..41
app/helpers/application_helper/toolbar/ems_containers_center.rb on lines 61..100

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 68.

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 5 locations. Consider refactoring.
Open

  button_group('container_replicator_policy', [
    select(
      :container_replicator_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/container_groups_center.rb on lines 2..41
app/helpers/application_helper/toolbar/container_images_center.rb on lines 23..62
app/helpers/application_helper/toolbar/container_nodes_center.rb on lines 2..41
app/helpers/application_helper/toolbar/ems_containers_center.rb on lines 61..100

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 68.

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

  button_group('image_policy', [
    select(
      :image_policy_choice,
      nil,
      t = N_('Policy'),
app/helpers/application_helper/toolbar/miq_templates_center.rb on lines 62..111
app/helpers/application_helper/toolbar/template_infras_center.rb on lines 72..121

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 68.

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