Showing 18,390 of 18,390 total issues
Cyclomatic complexity for rbac_edit_reset is too high. [19/11] Open
def rbac_edit_reset(operation, what, klass)
key = what.to_sym
if operation != "new"
record = find_record_with_rbac(klass, checked_or_params)
if %i[group role].include?(key) && record && record.read_only && operation != 'copy'
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one. Blocks that are calls to builtin iteration methods (e.g. `ary.map{...}) also add one, others are ignored.
def each_child_node(*types) # count begins: 1
unless block_given? # unless: +1
return to_enum(__method__, *types)
children.each do |child| # each{}: +1
next unless child.is_a?(Node) # unless: +1
yield child if types.empty? || # if: +1, ||: +1
types.include?(child.type)
end
self
end # total: 6
Cyclomatic complexity for rbac_group_get_form_vars is too high. [19/11] Open
def rbac_group_get_form_vars
if %w[up down].include?(params[:button])
move_cols_up if params[:button] == "up"
move_cols_down if params[:button] == "down"
else
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one. Blocks that are calls to builtin iteration methods (e.g. `ary.map{...}) also add one, others are ignored.
def each_child_node(*types) # count begins: 1
unless block_given? # unless: +1
return to_enum(__method__, *types)
children.each do |child| # each{}: +1
next unless child.is_a?(Node) # unless: +1
yield child if types.empty? || # if: +1, ||: +1
types.include?(child.type)
end
self
end # total: 6
Cyclomatic complexity for gfv_chargeback is too high. [19/11] Open
def gfv_chargeback
# Chargeback options
if params.key?(:cb_show_typ)
@edit[:new][:cb_show_typ] = params[:cb_show_typ].presence
@refresh_div = "filter_div"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one. Blocks that are calls to builtin iteration methods (e.g. `ary.map{...}) also add one, others are ignored.
def each_child_node(*types) # count begins: 1
unless block_given? # unless: +1
return to_enum(__method__, *types)
children.each do |child| # each{}: +1
next unless child.is_a?(Node) # unless: +1
yield child if types.empty? || # if: +1, ||: +1
types.include?(child.type)
end
self
end # total: 6
Cyclomatic complexity for db_get_node_info is too high. [19/11] Open
def db_get_node_info
model, rec_id, _ = TreeBuilder.extract_node_model_and_id(x_node)
@sb[:nodes] = x_node.split('-')
if @sb[:nodes].length == 1
@default_ws = MiqWidgetSet.where_unique_on("default").where(:read_only => true).first
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one. Blocks that are calls to builtin iteration methods (e.g. `ary.map{...}) also add one, others are ignored.
def each_child_node(*types) # count begins: 1
unless block_given? # unless: +1
return to_enum(__method__, *types)
children.each do |child| # each{}: +1
next unless child.is_a?(Node) # unless: +1
yield child if types.empty? || # if: +1, ||: +1
types.include?(child.type)
end
self
end # total: 6
Function RetirementForm
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const RetirementForm = ({
retirementID, redirect, url, timezone,
}) => {
const retireItems = JSON.parse(retirementID);
const tz = timezone;
- 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 li_link
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def li_link(args)
args[:if] = (args[:count] != 0) if args[:count]
args[:if] = true unless args.key?(:if)
link_text, title = build_link_text(args)
- 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 SettingsTimeProfileForm
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const SettingsTimeProfileForm = ({
timeProfileId, timezones, action, userid,
}) => {
const [{
isLoading, initialValues, fields, tz,
- 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 textual_generate_openstack_status
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def textual_generate_openstack_status
@record.host_service_group_openstacks.collect do |x|
running_count = x.running_system_services.count
failed_count = x.failed_system_services.count
all_count = x.system_services.count
- 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 center_toolbar_filename_pxe
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def center_toolbar_filename_pxe
if x_active_tree == :pxe_servers_tree
if x_node == "root"
return "pxe_servers_center_tb"
elsif x_node.split('-').first == "pi"
- 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 perf_top_chart
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def perf_top_chart
return if perfmenu_click?
@record = identify_tl_or_perf_record
@perf_record = @record.kind_of?(MiqServer) ? @record.vm : @record # Use related server vm record
- 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 edit_record
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def edit_record
assert_privileges(params[:pressed])
obj = find_checked_items
db = params[:db] if params[:db]
- 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 exp_build_string
has a Cognitive Complexity of 19 (exceeds 5 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)
- 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 group_set_form_vars
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def group_set_form_vars
@sb[:buttons_node] = true
if session[:resolve]
@resolve = session[:resolve]
else
- 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_active_tab_and_node
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def set_active_tab_and_node
if x_active_tree == :settings_tree
@sb[:active_tab] ||= "settings_server"
end
- 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 miq_event_edit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def miq_event_edit
assert_privileges("miq_policy_event_edit")
case params[:button]
when "cancel"
@edit = nil
- 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 determine_filter_type_and_value
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def determine_filter_type_and_value(schedule)
if schedule.sched_action && schedule.sched_action[:method] && !schedule_automate(schedule)
if schedule.miq_search # See if a search filter is attached
filter_type = schedule.miq_search.search_type == "user" ? "my" : "global"
filter_value = schedule.miq_search.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 rbac_edit_reset
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def rbac_edit_reset(operation, what, klass)
key = what.to_sym
if operation != "new"
record = find_record_with_rbac(klass, checked_or_params)
if %i[group role].include?(key) && record && record.read_only && operation != 'copy'
- 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 load_or_clear_adv_search
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def load_or_clear_adv_search
adv_search_build("Storage")
session[:edit] = @edit
@explorer = true
- 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 settings_set_form_vars
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def settings_set_form_vars
@right_cell_text = if x_node.split("-").first == "z"
if my_zone_name == @selected_zone.name
_("Settings %{model} \"%{name}\" (current)") % {:name => @selected_zone.description,
:model => ui_lookup(:model => @selected_zone.class.to_s)}
- 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 db_form_field_changed
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def db_form_field_changed
assert_privileges(session.fetch_path(:edit, :db_id) ? "db_edit" : "db_new")
return unless load_edit("db_edit__#{params[:id]}", "replace_cell__explorer")
db_get_form_vars
- 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"