Showing 2,015 of 18,390 total issues
Method find_includes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def find_includes(col, includes)
tables = col.split(".")[0..-2]
field = col.split(".").last
table = tables.first
- 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 explorer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def explorer
@explorer = true
@lastaction = "explorer"
@ght_type = nil
@report = 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 replace_gtl_main_div
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def replace_gtl_main_div(_options = {})
return if params[:action] == "button" && @lastaction == "show"
if @grid_hash
# need to call this outside render :update
- 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_available_widgets_options
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def db_available_widgets_options
# Build the available widgets for the pulldown
col_widgets = @edit[:new][:col1] +
@edit[:new][:col2]
if @sb[:nodes].length == 2 && @sb[:nodes][1] != "g"
- 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 service_delete
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def service_delete
assert_privileges("service_delete")
elements = []
if params[:id] # delete service from its details page
elements.push(params[: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 widget_form_field_changed
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def widget_form_field_changed
assert_privileges(feature_for_widget_action)
return unless load_edit("widget_edit__#{params[:id]}", "replace_cell__explorer")
widget_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"
Further reading
Method determine_api_endpoints
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def determine_api_endpoints(obj, display_options = {})
base_name = obj.class.base_model.name
case base_name
when /EmsCluster/
api_collection_name = "clusters"
- 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 miq_tabs_init
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.miq_tabs_init = function(id, url, parms) {
$(`${id} > ul.nav-tabs a[data-toggle="tab"]`).on('show.bs.tab', (e) => {
if ($(e.target).parent().hasClass('disabled')) {
e.preventDefault();
return false;
- Create a ticketCreate a ticket
Function prepareRequestObject
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const prepareRequestObject = (values, formId) => {
const requestObject = { ...values };
// if price property is not there add price property if its present convert the value into string
if (!Object.prototype.hasOwnProperty.call(requestObject, 'price')) {
- Create a ticketCreate a ticket
Function createBackupSchema
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createBackupSchema() {
const fields = [{
component: componentTypes.SUB_FORM,
title: __('Basic Information'),
id: 'basic-information',
- Create a ticketCreate a ticket
Function link
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, _elem, attrs, ctrl) {
ctrl.$parsers.push(function(value) {
if (attrs.timeType === 'day' && value) {
setAllDaysChecked(attrs.allTimeCheck, value);
} else if (attrs.timeType === 'hour' && value) {
- Create a ticketCreate a ticket
Method miq_summary_policy_events
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_summary_policy_events(policy_events, record)
data = {:title => _("Events"), :mode => "miq_policy_events"}
data[:headers] = [_('Description'), _('Actions')]
rows = []
if policy_events.empty?
- Create a ticketCreate a ticket
Method javascript_for_timer_type
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def javascript_for_timer_type(timer_type)
case timer_type
when "Monthly"
[
javascript_hide("weekly_span"),
- Create a ticketCreate a ticket
Method exp_token_pressed
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exp_token_pressed
@edit = session[:edit]
token = params[:token].to_i
if token == @edit[@expkey][:exp_token] || # User selected same token as already selected
(@edit[@expkey][:exp_token] && @edit[:edit_exp].key?("???")) # or new token in process
- Create a ticketCreate a ticket
Method miq_policy_edit_conditions
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def miq_policy_edit_conditions
assert_privileges('miq_policy_conditions_assignment')
case params[:button]
when "cancel"
@sb[:action] = @edit = nil
- Create a ticketCreate a ticket
Method fields_form_field_changed
has 39 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
Method rbac_get_info
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rbac_get_info
node, id = x_node.split("-")
case node
when "xx"
case id
- Create a ticketCreate a ticket
Method gfv_trend
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gfv_trend
if params[:chosen_trend_col]
@edit[:new][:perf_interval] ||= "daily" # Default to Daily
@edit[:new][:perf_target_pct1] ||= 100 # Default to 100%
if params[:chosen_trend_col] == "<Choose>"
- Create a ticketCreate a ticket
Method alert_build_pulldowns
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def alert_build_pulldowns
@sb[:alert] ||= {}
# :event_types
unless @sb[:alert][:events] # Only create this once
- Create a ticketCreate a ticket
Method attributes_data
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attributes_data
attributes = %i[physical_chassis
physical_racks
physical_servers
physical_storages
- Create a ticketCreate a ticket