ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Consider simplifying this complex logical expression.
Open

    if (typeof $scope.pglogicalReplicationModel.dbname   !== 'undefined' && $scope.pglogicalReplicationModel.dbname   !== '' &&
        typeof $scope.pglogicalReplicationModel.host     !== 'undefined' && $scope.pglogicalReplicationModel.host     !== '' &&
        typeof $scope.pglogicalReplicationModel.user     !== 'undefined' && $scope.pglogicalReplicationModel.user     !== '' &&
        typeof $scope.pglogicalReplicationModel.password !== 'undefined' && $scope.pglogicalReplicationModel.password !== ''
    ) {

Consider simplifying this complex logical expression.
Open

        if @tagitems || @politems || @ownershipitems || @retireitems
          breadcrumbs.push(special_page_breadcrumb(@tagitems || @politems || @ownershipitems || @retireitems, true, options[:x_node]))
          breadcrumbs.push(:title => right_cell_text)
        else
          # Ancestry parents breadcrumbs (only in services)
Severity: Critical
Found in app/controllers/mixins/breadcrumbs_mixin.rb - About 1 hr to fix

Function render has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      options, selectedTagCategory, onTagCategoryChange, assignedTags,
    } = this.props;
    const isDisabled = options && options.isDisabled;
Severity: Minor
Found in app/javascript/tagging/components/Tagging/Tagging.js - About 1 hr to fix

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

    link: function(scope, _elem, attr, ctrl) {
      var model = function() {
        return scope.$eval(ctrl.model || scope.model);
      };

Severity: Minor
Found in app/javascript/oldjs/directives/form_changed.js - About 1 hr to fix

Function submitButtonClicked has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function submitButtonClicked() {
    vm.dialogData.action = apiAction;
    miqService.sparkleOn();

    var apiData = DialogData.outputConversion(vm.dialogData);

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

    link: function(scope, elem, attr, ctrl) {
      ctrl.$formatters.push(function(value) {
        if (value) {
          return moment(value).utc().format('MM/DD/YYYY');
        }
Severity: Minor
Found in app/javascript/oldjs/directives/miq_datepicker.js - About 1 hr to fix

Function disconnectDrives has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function getAggStatusInfo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getAggStatusInfo = (data, providerId) => {
  const attributes = ['nodes', 'containers', 'registries', 'projects', 'pods', 'services', 'images', 'routes'];
  const attrHsh = {
    nodes: __('Nodes'),
    containers: __('Containers'),
Severity: Minor
Found in app/javascript/components/ems_container_dashboard/helper.js - About 1 hr to fix

Method process_elements has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def process_elements(elements, klass, task, display_name = nil, order_field = nil)
    order_field ||= %w[name description title].find { |field| klass.column_names.include?(field) }

    order_by = order_field == "ems_id" ? order_field : klass.arel_table[order_field].lower

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

Method _toolbar_builder has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def _toolbar_builder
    ToolbarBuilder.new(
      self,
      binding,
      :active           => @active,
Severity: Minor
Found in app/helpers/application_helper.rb - About 1 hr to fix

Method exp_add_joiner has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exp_add_joiner(exp, token, joiner)
    if exp[:token] && exp[:token] == token                # If the token matches
      exp.keys.each do |key|                              # Find the key
        if key == :token
          exp.delete(key)                                 # Remove the :token key
Severity: Minor
Found in app/controllers/application_controller/filter.rb - About 1 hr to fix

Method exp_build_string has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exp_build_string(exp)
    main_font = calculate_font_color(exp['result'])

    if exp['and']
      exp_string = join_binary(exp, 'and', main_font)
Severity: Minor
Found in app/controllers/application_controller/expression_html.rb - About 1 hr to fix

Method button_set_record_vars has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def button_set_record_vars(button)
    button.name = @edit[:new][:name]
    button.description = @edit[:new][:description]
    button.applies_to_class = x_active_tree == :ab_tree ? @resolve[:target_class] : "ServiceTemplate"
    button.applies_to_id = x_active_tree == :ab_tree ? nil : @sb[:applies_to_id]
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 1 hr to fix

Method adv_search_clear has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def adv_search_clear
    respond_to do |format|
      format.js do
        @explorer = true
        if x_active_tree.to_s =~ /_filter_tree$/ &&
Severity: Minor
Found in app/controllers/application_controller/advanced_search.rb - About 1 hr to fix

Method fetch_saved_report has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def fetch_saved_report(id)
    rr = MiqReportResult.for_user(current_user).find_by(:id => id)
    if rr.nil? # Saved report no longer exists
      @report = nil
      add_flash(_("Error: Report no longer exists in the database"), :error)
Severity: Minor
Found in app/controllers/chargeback_report_controller.rb - About 1 hr to fix

Method timeprofile_set_days_hours has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def timeprofile_set_days_hours(_timeprofile = @timeprofile)
    @timeprofile_details = {}
    @timeprofiles.each do |timeprofile|
      @timeprofile_details[timeprofile.description] = {}
      profile_key = timeprofile.profile[:days].nil? ? "days" : :days
Severity: Minor
Found in app/controllers/configuration_controller.rb - About 1 hr to fix

Method forest_accept has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def forest_accept
    assert_privileges("ops_settings")

    forest_get_form_vars
    no_changes = true
Severity: Minor
Found in app/controllers/ops_controller/settings.rb - About 1 hr to fix

Method ap_get_form_vars has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def ap_get_form_vars
    @scan = @edit[:scan_id] ? ScanItemSet.find(@edit[:scan_id]) : ScanItemSet.new
    @edit[:new][:name]        = params[:name]        if params[:name]
    @edit[:new][:description] = params[:description] if params[:description]

Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 1 hr to fix

Method action_handle_selection_buttons has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def action_handle_selection_buttons(members,
                                      members_chosen = :members_chosen,
                                      choices = :choices,
                                      choices_chosen = :choices_chosen)
    if params[:button].ends_with?("_left")
Severity: Minor
Found in app/controllers/miq_action_controller.rb - About 1 hr to fix

Method miq_alert_set_assign has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def miq_alert_set_assign
    assert_privileges("miq_alert_set_assign")
    @assign = @sb[:assign]
    @alert_profile = @assign[:alert_profile] if @assign
    case params[:button]
Severity: Minor
Found in app/controllers/miq_alert_set_controller.rb - About 1 hr to fix
Severity
Category
Status
Source
Language