ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Method set_instances_form_vars has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_instances_form_vars
    session[:inst_data] = {}
    @edit = {
      :ae_inst_id  => @ae_inst.id,
      :ae_class_id => @ae_class.id,
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 1 hr to fix

Method rsop_option_changed has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def rsop_option_changed
    assert_privileges('policy_simulation')
    if params[:event_typ]
      @sb[:rsop][:event] = params[:event_typ].presence
      @sb[:rsop][:event_value] = nil
Severity: Minor
Found in app/controllers/miq_policy_rsop_controller.rb - About 1 hr to fix

Method peca_get_all has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def peca_get_all(what, get_view)
      @no_checkboxes       = true
      @showlinks           = true
      @lastaction          = "#{what}_get_all"
      @force_no_grid_xml   = true
Severity: Minor
Found in app/controllers/mixins/policy_mixin.rb - About 1 hr to fix

Method validate_snmp_options has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def validate_snmp_options(options)
      if options[:host].nil? || options[:host] == ""
        add_flash(_("Host is required"), :error)
      end

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

Method reconfigure_handle_submit_button has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def reconfigure_handle_submit_button
          options = {:src_ids => params[:objectIds]}
          if params[:cb_memory] == 'true' && role_allows?(:feature => 'vm_reconfigure_memory')
            options[:vm_memory] = params[:memory_type] == "MB" ? params[:memory] : params[:memory].to_i * 1024
          end
Severity: Minor
Found in app/controllers/mixins/actions/vm_actions/reconfigure.rb - About 1 hr to fix

Method render_or_redirect_partial has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def render_or_redirect_partial(pfx)
    if @redirect_controller
      if ["#{pfx}_clone", "#{pfx}_migrate", "#{pfx}_publish"].include?(params[:pressed])
        if flash_errors?
          javascript_flash
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

Method set_right_cell_vars has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def set_right_cell_vars(action)
    case action
    when "dialog_provision"
      partial = "shared/dialogs/dialog_provision"
      header = @right_cell_text
Severity: Minor
Found in app/controllers/service_controller.rb - About 1 hr to fix

Method show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def show
    super
    @alert = @record
    @email_to = []
    if @alert.responds_to_events == "_hourly_timer_"
Severity: Minor
Found in app/controllers/miq_alert_controller.rb - About 1 hr to fix

Method build_expression_vars has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_expression_vars
    @edit[:new][:expression] = @condition.expression.kind_of?(MiqExpression) ? @condition.expression.exp : nil
    @edit[:new][:applies_to_exp] = @condition.applies_to_exp.kind_of?(MiqExpression) ? @condition.applies_to_exp.exp : nil

    # Populate exp editor fields for the expression column
Severity: Minor
Found in app/controllers/condition_controller.rb - About 1 hr to fix

Method button has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def button
    case params[:pressed]
    when 'embedded_configuration_script_source_refresh' # refresh repositories
      repository_refresh
    when "embedded_configuration_script_source_edit" # edit repository
Severity: Minor
Found in app/controllers/ansible_repository_controller.rb - About 1 hr to fix

Method status has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def status
    {
      :images     => {
        :count        => @project.container_images.count,
        :errorCount   => 0,
Severity: Minor
Found in app/services/container_project_dashboard_service.rb - About 1 hr to fix

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

      cy.get('[data-original-index="144"]').then((option) => {
        currency = option[0].innerText;
        cy.get(option).click();
      });
Severity: Major
Found in cypress/e2e/ui/Overview/Chargeback/rates.cy.js and 3 other locations - About 1 hr to fix
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 92..95
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 142..145
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 198..201

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

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

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

export const removeSelected = (array, item) => {
  const index = array.indexOf(item);
  if (index !== -1) {
    array.splice(index, 1);
  }
Severity: Major
Found in app/javascript/components/data-tables/datastore/helper.js and 1 other location - About 1 hr to fix
app/javascript/components/data-tables/time-profile-table/helper.js on lines 12..18

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

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

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

export const removeSelected = (array, item) => {
  const index = array.indexOf(item);
  if (index !== -1) {
    array.splice(index, 1);
  }
app/javascript/components/data-tables/datastore/helper.js on lines 101..107

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

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

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

const EmptyChart = () =>
  (
    <div className="empty-chart-content">
      <span className="pficon pficon-info" />
      <span>{__('No data available')}</span>
app/javascript/components/dashboard-widgets/dashboard-charts/emptyChart.js on lines 3..9

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

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

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

const EmptyChart = () =>
  (
    <div className="empty-chart-content">
      <span className="pficon pficon-info" />
      <span>{__('No data available')}</span>
app/javascript/components/provider-dashboard-charts/emptyChart.js on lines 3..9

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

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

    cy.get('[data-original-index="25"]').then((option) => {
      currency = option[0].innerText;
      cy.get(option).click();
    });
Severity: Major
Found in cypress/e2e/ui/Overview/Chargeback/rates.cy.js and 3 other locations - About 1 hr to fix
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 142..145
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 198..201
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 229..232

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

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

      cy.get('[data-original-index="144"]').then((option) => {
        currency = option[0].innerText;
        cy.get(option).click();
      });
Severity: Major
Found in cypress/e2e/ui/Overview/Chargeback/rates.cy.js and 3 other locations - About 1 hr to fix
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 92..95
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 198..201
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 229..232

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

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

    cy.get('[data-original-index="25"]').then((option) => {
      currency = option[0].innerText;
      cy.get(option).click();
    });
Severity: Major
Found in cypress/e2e/ui/Overview/Chargeback/rates.cy.js and 3 other locations - About 1 hr to fix
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 92..95
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 142..145
cypress/e2e/ui/Overview/Chargeback/rates.cy.js on lines 229..232

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

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

  it('renders icon with title and alt if icon and no image are passed in', () => {
    const image = mount(<IconOrImage icon="fa fa-foobar" title="foo bar title" />);
    expect(toJson(image)).toMatchSnapshot();
  });
app/javascript/spec/textual_summary/tests/icon_or_image.test.js on lines 7..10
app/javascript/spec/textual_summary/tests/icon_or_image.test.js on lines 17..20

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

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