Showing 2,015 of 18,390 total issues
Method ap_ce_select
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def ap_ce_select
assert_privileges(session&.fetch_path(:edit, :current, :scan_mode) == "Vm" ? "ap_vm_edit" : "ap_host_edit")
return unless load_edit("ap_edit__#{params[:id]}", "replace_cell__explorer")
- Read upRead up
- Create a ticketCreate a ticket
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 label_tag_mapping_edit
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def label_tag_mapping_edit
assert_privileges("region_edit")
case params[:button]
when "cancel"
- Read upRead up
- Create a ticketCreate a ticket
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 set_record_vars
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def set_record_vars
@edit[:set_assignments] = []
if @edit[:new][:cbshow_typ].ends_with?("-tags")
assigned_rates_from_all_categories = @edit[:cb_assign][:tags].values.reduce({}, :merge)
assigned_rates_from_all_categories.each_key do |id|
- Read upRead up
- Create a ticketCreate a ticket
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_update_create
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def old_dialogs_update_create
old_dialogs_get_form_vars
case params[:button]
when "cancel"
@edit = session[:edit] = nil # clean out the saved info
- Read upRead up
- Create a ticketCreate a ticket
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 form_method_field_changed
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
def form_method_field_changed
assert_privileges(feature_by_action)
return unless load_edit("aemethod_edit__#{params[:id]}", "replace_cell__explorer")
get_method_form_vars
- Create a ticketCreate a ticket
Method ab_get_node_info
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ab_get_node_info(node)
@nodetype = node.split("_")
nodeid = node.split("-")
# initializing variables to hold data for selected node
- Create a ticketCreate a ticket
Method widget_set_form_vars
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
def widget_set_form_vars
@timezone_abbr = get_timezone_abbr
@edit = {}
@edit[:widget_id] = @widget.id
@edit[:read_only] = !!@widget.read_only
- Create a ticketCreate a ticket
Class MiqAeToolsController
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqAeToolsController < ApplicationController
include Mixins::BreadcrumbsMixin
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
- Create a ticketCreate a ticket
Method atomic_req_submit
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def atomic_req_submit
id = session[:edit][:req_id] || "new"
return unless load_edit("prov_edit__#{id}", "show_list")
if @edit[:new][:name].blank?
- Create a ticketCreate a ticket
Method menu_field_changed
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
def menu_field_changed
assert_privileges("miq_report_menu_editor")
return unless load_edit("menu_edit__#{session[:role_choice] ? session[:role_choice] : "new"}", "replace_cell__explorer")
menu_get_form_vars
- Create a ticketCreate a ticket
File catalog_item_form_controller.js
has 488 lines of code (exceeds 400 allowed). Consider refactoring. Open
ManageIQ.angular.app.controller('catalogItemFormController', ['$scope', '$timeout', 'catalogItemFormId', 'currentRegion', 'miqService', 'postService', 'catalogItemDataFactory', 'playbookReusableCodeMixin', 'allCatalogsNames', 'additionalTenantIds', function($scope, $timeout, catalogItemFormId, currentRegion, miqService, postService, catalogItemDataFactory, playbookReusableCodeMixin, allCatalogsNames, additionalTenantIds) {
var vm = this;
var init = function() {
vm.catalogItemModel = {
name: '',
- Create a ticketCreate a ticket
File dashboards.rb
has 487 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ReportController::Dashboards
extend ActiveSupport::Concern
include DashboardHelper
def db_seq_edit
- Create a ticketCreate a ticket
Method prov_redirect
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def prov_redirect(typ = nil)
assert_privileges(params[:pressed])
# we need to do this check before doing anything to prevent
# history being updated
task_supported(typ) if typ
- Read upRead up
- Create a ticketCreate a ticket
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 widget_set_record_vars
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def widget_set_record_vars(widget)
widget.title = @edit[:new][:title]
widget.description = @edit[:new][:description]
widget.enabled = @edit[:new][:enabled]
widget.options ||= {}
- Read upRead up
- Create a ticketCreate a ticket
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
Function TreeView
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TreeView = (props) => {
const {
tree_name,
bs_tree,
check_url,
- Create a ticketCreate a ticket
Method diagnostics_set_form_vars
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
def diagnostics_set_form_vars
active_node = x_node
if active_node && active_node.split('-').first == "z"
@record = @selected_server = Zone.find_by(:id => active_node.split('-').last)
@sb[:selected_server_id] = @selected_server.id
- Create a ticketCreate a ticket
Function createRows
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createRows = (initialValues, enforced, setEnforced, values, setValues, setDisabled, setChanged, invalid, setInvalid) => {
/* Determines whether the save button should be disabled
based on whether the form has changed or if an inputted value is invalid */
const isDisabled = () => {
let fresh = true;
- Create a ticketCreate a ticket
Method get_view
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_view(db, options = {}, fetch_data = false)
if !fetch_data && @report_data_additional_options.nil?
process_show_list_options(options, db)
end
if @in_a_form && @edit.present?
- Create a ticketCreate a ticket
Function menuItemOnClick
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
const menuItemOnClick = (menuItems, widgetId, dataMethod, href, buttonTitle, widgetType, widgetTitle, setState, widgetModel, lastRun, nextRun) => {
let index = 0;
// Handles Minimize button and changes it to Maximize after click
if (buttonTitle === __('Minimize')) {
document.getElementById(`dd_w${widgetId}_box`).style.display = 'none';
- Create a ticketCreate a ticket
Method alert_build_edit_screen
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def alert_build_edit_screen
@edit = {}
@edit[:new] = {}
@edit[:current] = {}
- Create a ticketCreate a ticket