Showing 2,015 of 18,390 total issues
Method index
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def index
assert_privileges('my_settings_view')
@breadcrumbs = []
active_tab = nil
if role_allows?(:feature => "my_settings_visuals")
- 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 iso_datastore_list
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def iso_datastore_list
assert_privileges('iso_datastore_view')
@lastaction = "iso_datastore_list"
@force_no_grid_xml = true
if params[:ppsetting] # User selected new per page value
- 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 specific_buttons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def specific_buttons(pressed)
return false unless BUTTON_TO_ACTION_MAPPING.include?(pressed)
if pressed == "cloud_volume_refresh"
queue_refresh(controller_to_model)
- 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_alert_set_assign
has a Cognitive Complexity of 11 (exceeds 5 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]
- 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 alert_profile_assign_changed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def alert_profile_assign_changed
@assign = @sb[:assign]
@alert_profile = @assign[:alert_profile]
if params.key?(:chosen_assign_to)
- 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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
assert_privileges("cloud_volume_new")
case params[:button]
when "cancel"
flash_and_redirect(_("Add of new Cloud Volume was cancelled by the user"))
- 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 common_st_record_vars
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def common_st_record_vars(st)
st.name = @edit[:new][:name]
st.description = @edit[:new][:description]
st.long_description = @edit[:new][:display] ? @edit[:new][:long_description] : nil
st.provision_cost = @edit[:new][:provision_cost]
- 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 authenticate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def authenticate
@layout = "dashboard"
unless params[:task_id] # First time thru, check for buttons pressed
# Handle More and Back buttons (for changing password)
- 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 menu_editor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def menu_editor
assert_privileges("miq_report_menu_editor")
menu_set_form_vars if %w[explorer tree_select x_history].include?(params[:action])
@in_a_form = 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 set_elements_and_redirect_unauthorized_user
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_elements_and_redirect_unauthorized_user
@nodetype, _id = parse_nodetype_and_id(params[:id])
prefix = prefix_by_nodetype(@nodetype)
# Position in tree that matches selected 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 delete_cloud_tenants
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def delete_cloud_tenants
assert_privileges("cloud_tenant_delete")
tenants = find_records_with_rbac(CloudTenant, checked_or_params)
tenants_to_delete = []
tenants.each do |tenant|
- 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_move_cols_down
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def db_move_cols_down
return unless load_edit("db_edit__seq", "replace_cell__explorer")
if params[:seq_fields].blank? || params[:seq_fields][0] == ""
add_flash(_("No fields were selected to move down"), :error)
@refresh_div = "column_lists"
- 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 x_get_tree_aset_kids
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def x_get_tree_aset_kids(object, count_only)
if object.id.nil?
get_tree_aset_kids_for_nil_id(object, count_only)
elsif count_only
object.members.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 show_schedule
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def show_schedule
if @schedule.nil?
flash_to_session
redirect_to(:action => 'schedules')
return
- 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 miqGrid
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.miqGrid = function() {
var table = $(this);
var checkall = table.find('thead > tr > th > input.checkall');
var checkboxes = table.find("tbody > tr > td > input[type='checkbox']");
- Create a ticketCreate a ticket
Function link
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, elem, attr, ctrl) {
elem.datetimepicker({showClear: true, showClose: true});
// datetime picker uses its own event for change
elem.on('dp.change', function(event) {
- Create a ticketCreate a ticket
Function miqCheckForChanges
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.miqCheckForChanges = function() {
let type = 'old'; // 'old' | 'angular' | 'tagging' | 'react'
let dirty = false;
const ignore = miqDomElementExists('ignore_form_changes');
- Create a ticketCreate a ticket
Method center_toolbar_filename_report
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def center_toolbar_filename_report
if x_active_tree == :db_tree
node = x_node
if %w[root xx-g].include?(node)
return nil
- Create a ticketCreate a ticket
Method miq_catalog_resource
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_catalog_resource(resources)
headers = ["", _("Name"), _("Description"), _("Action Order"), _("Provision Order"), _("Action Start"), _("Action Stop"), _("Delay (mins) Start"), _("Delay (mins) Stop")]
data = {:rows => [], :headers => headers}
prev_group = 0
resources.sort_by { |rsc| [rsc.group_idx, rsc.resource_name.downcase] }.each_with_index do |r, i|
- Create a ticketCreate a ticket
Method remove_host
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_host
assert_privileges("host_aggregate_remove_host")
@host_aggregate = find_record_with_rbac(HostAggregate, params[:id])
case params[:button]
- Create a ticketCreate a ticket