Showing 2,015 of 18,390 total issues
Method setnode_for_customreport
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def setnode_for_customreport
@sb[:rpt_menu].each_with_index do |level1_nodes, i|
next unless level1_nodes[0] == reports_group_title
level1_nodes[1].each_with_index do |level2_nodes, k|
# Check for the existence of the Custom folder in the Reports tree and
- 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 replace_list_grid
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def replace_list_grid
view = @view
button_div = 'center_tb'
action_url = if @lastaction == "scan_history"
"scan_history"
- 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_graph_menus
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def widget_graph_menus
@menu.each do |r|
r[1].each do |subfolder, reps|
subfolder.each_line do |s|
@reps ||= []
- 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 get_all_widgets
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_all_widgets(nodeid = nil, rep_id = nil)
@force_no_grid_xml = true
@no_checkboxes = @showlinks = true if x_active_tree != "report"
# @embedded = 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 alert_edit_save_add
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def alert_edit_save_add
id = params[:id] && params[:button] != "add" ? params[:id] : "new"
return unless load_edit("miq_alert_edit__#{id}")
alert = @alert = @edit[:alert_id] ? MiqAlert.find(@edit[:alert_id]) : MiqAlert.new
- 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 post_check
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def post_check(tree)
stack = tree.map(&:itself)
nodes = []
parents = []
- 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 onSubmit
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (values) => {
const data = values;
if (data.description === undefined) {
data.description = '';
}
- Create a ticketCreate a ticket
Function onSubmit
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (values) => {
const data = values;
if (data.description === undefined) {
data.description = '';
}
- Create a ticketCreate a ticket
Function onSubmit
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (values) => {
const data = values;
if (data.description === undefined) {
data.description = '';
}
- Create a ticketCreate a ticket
Method center_toolbar_filename_ops
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def center_toolbar_filename_ops
if x_active_tree == :settings_tree
if x_node.split('-').last == "msc"
return "miq_schedules_center_tb"
elsif x_node.split('-').first == "msc"
- Create a ticketCreate a ticket
Method ap_get_form_vars_event_log
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ap_get_form_vars_event_log
session[:nteventlog_data] = {}
if params[:entry]["name"] == ""
session[:nteventlog_data][:name] = params[:entry]["name"]
session[:nteventlog_data][:message] = params[:entry]["message"]
- Create a ticketCreate a ticket
Method get_reconfig_info
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_reconfig_info(reconfigure_ids)
@reconfigureitems = Vm.find(reconfigure_ids).sort_by(&:name)
# set memory to nil if multiple items were selected with different mem_cpu values
memory = @reconfigureitems.first.mem_cpu
memory = nil unless @reconfigureitems.all? { |vm| vm.mem_cpu == memory }
- Create a ticketCreate a ticket
Method rate_save_add
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rate_save_add
# TODO: rename chargeback_rates_edit and chargeback_rates_new to chargeback_rate_edit and chargeback_rate_new
assert_privileges(params[:id] ? 'chargeback_rates_edit' : 'chargeback_rates_new')
id = params[:button] == "save" ? params[:id] : "new"
return unless load_edit("cbrate_edit__#{id}")
- Create a ticketCreate a ticket
Method st_set_form_vars
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def st_set_form_vars
@edit = {}
@edit[:rec_id] = @record.id
@edit[:key] = "st_edit__#{@record.id || "new"}"
@edit[:url] = "servicetemplate_edit"
- Create a ticketCreate a ticket
Function apply
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver.getHook(this.source).tapAsync("RailsEnginesPlugin", (request, resolveContext, callback) => {
const engine = this.pathToEngine(request.path);
- Create a ticketCreate a ticket
Function onItemClick
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onItemClick = (item, event) => {
// If custom_action is specified, send and RxJS message with actionType set
// to custom_action value.
if (additionalOptions && additionalOptions.custom_action) {
sendDataWithRx({
- Create a ticketCreate a ticket
Method tag_edit_build_screen
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tag_edit_build_screen
@showlinks = true
@edit[:object_ids] ||= @object_ids
cats = Classification.categories.select(&:show).sort_by { |t| t.description.try(:downcase) } # Get the categories, sort by description
- Create a ticketCreate a ticket
Method update_fields
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_fields
assert_privileges('miq_ae_field_edit')
return unless load_edit("aefields_edit__#{params[:id]}", "replace_cell__explorer")
fields_get_form_vars
- Create a ticketCreate a ticket
Method db_seq_edit
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def db_seq_edit
assert_privileges("db_seq_edit")
case params[:button]
when "cancel"
@edit = session[:edit] = nil # clean out the saved info
- Create a ticketCreate a ticket
Method attributes_data
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attributes_data
attributes = if @ems.supports?(:block_storage)
%i[physical_storages storage_resources cloud_volumes cloud_volume_snapshots volume_mappings host_initiators host_initiator_groups storage_services]
else
%i[cloud_object_store_containers cloud_object_store_objects]
- Create a ticketCreate a ticket