ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

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

Function createSchema has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

function createSchema(recordId, promise, inheritTags, evaluateAlert, tags, ansibleInventory, snapshotAge, parentType, inventoryType) {
Severity: Major
Found in app/javascript/components/action-form/action-form.schema.js - About 1 hr to fix

Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(an_id, a_name, features, rbac_feature, href, type = :default, parent_id = nil, defaults = nil, icon = nil)
Severity: Major
Found in app/presenters/menu/item.rb - About 1 hr to fix

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

    link: function(scope, _elem, attrs, ctrl) {
      scope.$watch(attrs.ngModel, function() {
        if ((ctrl.$modelValue != undefined)) {
          setValidityForModelValue(scope, ctrl, ctrl.$modelValue, attrs.requiredIfExists);
        }
Severity: Minor
Found in app/javascript/oldjs/directives/required_depends_on.js - About 1 hr to fix

Function elapsed_time_human has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    elapsed_time_human: function(val, _options) {
      val = ~~val;

      var names = [__('Day'), __('Hour'), __('Minute'), __('Second')];

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

Function miqBuildChartMenuEx has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.miqBuildChartMenuEx = function(col, row, _value, category, series, chart_set, chart_index) {
  const chart_data = ManageIQ.charts.chartData[chart_set];
  const chart_el = $(`#miq_chart_parent_${chart_set}_${chart_index}`);
  const chartmenu_el = $(`#miq_chartmenu_${chart_set}_${chart_index}`);
  chartmenu_el.empty();
Severity: Minor
Found in app/javascript/oldjs/miq_application.js - About 1 hr to fix

Function simpleData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const simpleData = () => {
  const miqHeaders = [
    {
      key: 'name',
      header: 'Name',
Severity: Minor
Found in app/javascript/spec/miq-data-table/data.js - About 1 hr to fix

Function settingsLabelTagMappingData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const settingsLabelTagMappingData = () => {
  const headers = [
    { header: __('Resource Entity'), key: 'resource_entity' },
    { header: __('Resource Label'), key: 'resource_label' },
    { header: __('Tag Category'), key: 'tag_category' },
Severity: Minor
Found in app/javascript/spec/settings-label-tag-mapping/data.js - About 1 hr to fix

Function timeProfileReportsData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const timeProfileReportsData = () => {
  const miqHeaders = [
    {
      key: 'name',
      header: 'Name',
Severity: Minor
Found in app/javascript/spec/miq-data-table/data.js - About 1 hr to fix

Function TableListView has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function TableListView(props) {
  const { headers, values, title } = props;

  /** Function to generate heders/rows for the default structured list. */
  const miqListDefaultTable = () => {
Severity: Minor
Found in app/javascript/components/textual_summary/table_list_view.jsx - About 1 hr to fix

Method request_details_summary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def request_details_summary(miq_request, user)
    rows = [
      row_data(_('Request ID'), miq_request.id),
      row_data(_('Status'), _(miq_request.status)),
      row_data(_('Request State'), _(miq_request.state.titleize))
Severity: Minor
Found in app/helpers/request_details_helper.rb - About 1 hr to fix

Method build_select_button has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def build_select_button(bgi, index)
    bs_children = false
    props = toolbar_button(bgi, :id => bgi[:id], :type => :buttonSelect)
    return nil if props.nil?

Severity: Minor
Found in app/helpers/application_helper/toolbar_builder.rb - About 1 hr to fix
Severity
Category
Status
Source
Language