ManageIQ/manageiq-ui-classic

View on GitHub

Showing 18,390 of 18,390 total issues

Method included has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.included(included_class)
    included_class.button_group('service_lifecycle', [
      included_class.select(
        :service_lifecycle_choice,
        nil,
Severity: Minor
Found in app/helpers/application_helper/toolbar/service/lifecycle_mixin.rb - About 1 hr to fix

Method miq_summary_alert_set_assigned has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_summary_alert_set_assigned(assigned, alert_profile_tag)
    rows = []
    data = {:title => _('Assigned To'), :mode => "miq_alert_set_assigned"}
    if !assigned[:objects].empty?
      if assigned[:objects].first.kind_of?(MiqEnterprise)
Severity: Minor
Found in app/helpers/miq_alert_set_helper.rb - About 1 hr to fix

Method chart_selected has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def chart_selected(chart_click_data, data_row, ts)
    @record = find_record_with_rbac(data_row["resource_type"].constantize, data_row["resource_id"])
    return [true, nil] unless @record

    # Set the perf options in the selected controller's sandbox
Severity: Minor
Found in app/controllers/application_controller/performance.rb - About 1 hr to fix

Method check_git_task has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def check_git_task
    assert_privileges('miq_ae_class_import_export')
    task = MiqTask.find(params[:task_id])
    json = if task.state != MiqTask::STATE_FINISHED
             {:state => task.state}
Severity: Minor
Found in app/controllers/miq_ae_tools_controller.rb - About 1 hr to fix

Method get_node_info has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_node_info(treenodeid, show_list = true)
    # resetting action that was stored during edit to determine what is being edited
    @sb[:action] = nil

    @nodetype, node_id =
Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

Method policies has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def policies
    @vm = @record = identify_record(params[:id], VmOrTemplate)
    @lastaction = "rsop"
    @showtype = "policies"
    drop_breadcrumb(:name => _("Policy Simulation Details for %{name}") % {:name => @record.name},
Severity: Minor
Found in app/controllers/vm_common.rb - About 1 hr to fix

Method create has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create
    assert_privileges("miq_ae_class_new")
    return unless load_edit("aeclass_edit__new", "replace_cell__explorer")

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

Method build_snmp_options has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def build_snmp_options(subkey, process_variables)
      refresh = false
      @edit[:new][subkey][:host] = params[:host] if params[:host]         # Actions support a single host in this key
      @edit[:new][subkey][:host][0] = params[:host_1] if params[:host_1]  # Alerts support an array of hosts
      @edit[:new][subkey][:host][1] = params[:host_2] if params[:host_2]
Severity: Minor
Found in app/controllers/mixins/policy_mixin.rb - About 1 hr to fix

Method explorer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def explorer
    @explorer = true
    @lastaction = "explorer"
    @report_deleted = params[:report_deleted] == 'true' if params[:report_deleted]
    @sb[:action] = nil
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method st_set_record_vars has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def st_set_record_vars(st)
    common_st_record_vars(st)
    st.remove_all_resources
    @add_rsc = true
    unless @edit[:new][:selected_resources].empty?
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 1 hr to fix

Method upload has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def upload
    assert_privileges("miq_report_export")

    @sb[:flash_msg] = []
    if params.fetch_path(:upload, :file) && File.size(params[:upload][:file].tempfile).zero?
Severity: Minor
Found in app/controllers/report_controller.rb - About 1 hr to fix

Method render_exception has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def render_exception(msg, error)
    respond_to do |format|
      format.js do
        render :update do |page|
          page << javascript_prologue
Severity: Minor
Found in app/controllers/application_controller.rb - About 1 hr to fix

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

const widgetUrl = (widgetId, widgetType) => {
  const widgetTypeUrl = {
    menu: '/dashboard/widget_menu_data/',
    report: '/dashboard/widget_report_data/',
    chart: '/dashboard/widget_chart_data/',
app/javascript/components/dashboard-widgets/widget-wrapper/index.jsx on lines 15..26

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

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

  Object.keys(data).forEach((key) => {
    if (data[key].id === value) {
      options = data[key].options;
    }
  });
app/javascript/components/ansible-playbook-edit-catalog-form/schemaHelper.js on lines 56..60

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

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 widgetUrl = () => {
    const widgetTypeUrl = {
      menu: '/dashboard/widget_menu_data/',
      report: '/dashboard/widget_report_data/',
      chart: '/dashboard/widget_chart_data/',
app/javascript/components/dashboard-widgets/widget-wrapper/helper.jsx on lines 14..25

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

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

  Object.keys(data).forEach((key) => {
    if (data[key].id === value) {
      options = data[key].options;
    }
  });
app/javascript/components/terraform-template-catalog-form/schemaHelper.js on lines 56..60

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

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

MiqCustomTab.propTypes = {
  containerId: PropTypes.string.isRequired,
  tabLabels: PropTypes.arrayOf(PropTypes.string).isRequired,
  type: PropTypes.string.isRequired,
};
Severity: Major
Found in app/javascript/components/miq-custom-tab/index.jsx and 2 other locations - About 1 hr to fix
app/javascript/components/textual_summary/generic_group.jsx on lines 17..21
app/javascript/components/textual_summary/multilink_table.jsx on lines 18..22

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

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

GenericGroup.propTypes = {
  title: PropTypes.string.isRequired,
  items: PropTypes.arrayOf(PropTypes.any).isRequired,
  onClick: PropTypes.func.isRequired,
};
app/javascript/components/miq-custom-tab/index.jsx on lines 103..107
app/javascript/components/textual_summary/multilink_table.jsx on lines 18..22

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

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

MultilinkTable.propTypes = {
  title: PropTypes.string.isRequired,
  items: PropTypes.arrayOf(PropTypes.any).isRequired,
  onClick: PropTypes.func.isRequired,
};
app/javascript/components/miq-custom-tab/index.jsx on lines 103..107
app/javascript/components/textual_summary/generic_group.jsx on lines 17..21

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

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

            useEffect(() => {
              // The list of registered fields shows up after this render, so the validation has to happen
              // with a delay and has to be pulled back via the state.
              setTimeout(() => setState((state) => ({ ...state, depsValid: dv })));
              formOptions.change(name, isValid);
app/javascript/components/async-action-button.jsx on lines 105..110

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

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