ManageIQ/manageiq-ui-classic

View on GitHub

Showing 2,015 of 18,390 total issues

Class MiqAlertController has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

class MiqAlertController < ApplicationController
  before_action :check_privileges
  before_action :get_session_data
  after_action :cleanup_action
  after_action :set_session_data
Severity: Minor
Found in app/controllers/miq_alert_controller.rb - About 2 hrs to fix

Function TreeViewController has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var TreeViewController = function($http, $scope) {
    var vm = this;
    vm.$http = $http;
    vm.$scope = $scope;
    vm.selectedNodes = {};
Severity: Major
Found in app/javascript/oldjs/controllers/tree_view_controller.js - About 2 hrs to fix

Function createSchema has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createSchema(repositoryId) {
  const fields = [
    {
      component: componentTypes.TEXT_FIELD,
      label: __('Name'),

Function createSchema has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createSchema(repositoryId) {
  const fields = [
    {
      component: componentTypes.TEXT_FIELD,
      label: __('Name'),

Function createSchema has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createSchema(repositoryId) {
  const fields = [
    {
      component: componentTypes.TEXT_FIELD,
      label: __('Name'),

Method widget_buttons has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def widget_buttons
    buttons = []
    if role_allows?(:feature => "dashboard_add")
      unless @sb[:dashboards][@sb[:active_db]][:locked]
        buttons.push(:id         => "w_#{@widget.id}_close",
Severity: Major
Found in app/presenters/widget_presenter.rb - About 2 hrs to fix

Function setUpAutomateImportClickHandlers has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setUpAutomateImportClickHandlers: function() {
    var tearDownGitImportOptions = function() {
      $('select.git-branches').find('option').remove().end();
      $('select.git-tags').find('option').remove().end();
      $('select.git-branches').selectpicker('refresh');
Severity: Major
Found in app/javascript/oldjs/automate_import_export.js - About 2 hrs to fix

Method display_adv_search? has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def display_adv_search?
    %w[auth_key_pair_cloud
       storage_service
       storage_resource
       host_initiator
Severity: Major
Found in app/helpers/application_helper.rb - About 2 hrs to fix

Function ErrorModalController has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function ErrorModalController($timeout) {
  var $ctrl = this;
  $ctrl.data = null;
  $ctrl.error = null;
  $ctrl.isHtml = false;
Severity: Minor
Found in app/javascript/oldjs/controllers/error_modal_controller.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method build_select_button has a Cognitive Complexity of 20 (exceeds 5 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 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method center_toolbar_filename_automate_customization has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def center_toolbar_filename_automate_customization
    if x_active_tree == :old_dialogs_tree
      return @dialog ? "miq_dialog_center_tb" : "miq_dialogs_center_tb"
    elsif x_active_tree == :dialogs_tree
      if x_node == "root"
Severity: Minor
Found in app/helpers/application_helper/toolbar_chooser.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method exp_add_not has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def exp_add_not(exp, token)
    if exp[:token] && exp[:token] == token            # If the token matches
      exp.keys.each do |key|                          # Find the key
        next if key == :token                         # Skip the :token key
        next if exp[key].nil?                         # Check for the key already gone
Severity: Minor
Found in app/controllers/application_controller/filter.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method group_reorder_set_form_vars has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def group_reorder_set_form_vars
    @edit = {}
    @edit[:new] = {}
    @edit[:current] = {}
    @edit[:key] = "group_reorder"
Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method group_reorder_field_changed has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def group_reorder_field_changed
    assert_privileges("ab_group_reorder")
    if params['selected_fields']
      return unless load_edit("group_reorder", "replace_cell__explorer")

Severity: Minor
Found in app/controllers/application_controller/buttons.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method fields_form_field_changed has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def fields_form_field_changed
    assert_privileges('miq_ae_field_edit')
    return unless load_edit("aefields_edit__#{params[:id]}", "replace_cell__explorer")

    fields_get_form_vars
Severity: Minor
Found in app/controllers/miq_ae_class_controller.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method ap_show has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def ap_show
    # identify_scanitemset
    if @selected_scan.nil?
      flash_to_session(_("Error: Record no longer exists in the database"), :error)
      redirect_to(:action => 'show_list_set')
Severity: Minor
Found in app/controllers/ops_controller/settings/analysis_profiles.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method show has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def show
      return if perfmenu_click?
      return unless init_show

      @center_toolbar = self.class.toolbar_singular if self.class.toolbar_singular
Severity: Minor
Found in app/controllers/mixins/generic_show_mixin.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method old_dialogs_button_operation has a Cognitive Complexity of 20 (exceeds 5 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 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method fetch_playbook_details has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def fetch_playbook_details
    playbook_details = {}
    provision = @record.config_info[:provision]
    provisioning_details = {}
    provisioning_details[:repository] = fetch_name_from_object(ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScriptSource, provision[:repository_id])
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method open_parent_nodes has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def open_parent_nodes(record)
    existing_node = nil # Init var

    if record.kind_of?(OrchestrationTemplate)
      parents = [:id => template_to_node_name(record)]
Severity: Minor
Found in app/controllers/catalog_controller.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language