Showing 2,015 of 18,390 total issues
Method exp_remove
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def exp_remove(exp, token)
return true if exp[:token] && exp[:token] == token # If the token matches
# Tell caller to remove me
keepkey, keepval, deletekey = nil # Holders for key, value pair to keep and key to delete
- 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 ab_button_add
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def ab_button_add
assert_privileges("ab_button_new")
@sb[:active_tab] = "ab_options_tab"
@resolve = session[:resolve]
name = @edit[:new][:instance_name].presence || @edit[:new][:other_name]
- 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 dialog_get_form_vars
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def dialog_get_form_vars
@record = Dialog.find(@edit[:rec_id])
params.each do |parameter_key, parameter_value|
parameter_key = parameter_key.split("__protected").first if parameter_key.ends_with?("__protected")
- 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_update_save
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def settings_update_save
settings_get_form_vars
return unless @edit
case @sb[:active_tab]
- 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 build_snmp_options
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def build_snmp_options(subkey, process_variables)
refresh = false
@edit[:new][subkey][:host] = params[:host] if params[:host] # Actions support a single host in this key
@edit[:new][subkey][:host][0] = params[:host_1] if params[:host_1] # Alerts support an array of hosts
@edit[:new][subkey][:host][1] = params[:host_2] if params[:host_2]
- 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_get_node_info
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def widget_get_node_info
@sb[:nodes] = x_node.split('-')
if @sb[:nodes].length == 1
get_all_widgets
@right_cell_text = _("All Widgets")
- 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
Class OpsController
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class OpsController < ApplicationController
# Methods for accordions
include Diagnostics
include OpsRbac
include Settings
- Create a ticketCreate a ticket
Class DashboardController
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class DashboardController < ApplicationController
include Mixins::BreadcrumbsMixin
include DashboardHelper
include Mixins::StartUrl
- Create a ticketCreate a ticket
Function createSchema
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (credentials, credentialReferences, payloadCredentials, workflowAuthentications, setState) => {
// Saves a new credential mapping to 'credentials'
const mapCredentials = () => setState((state) => {
if (state.workflowCredentials && state.credentialField) {
return ({
- Create a ticketCreate a ticket
Function createSchema
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (credentials, credentialReferences, payloadCredentials, workflowAuthentications, setState) => {
// Saves a new credential mapping to 'credentials'
const mapCredentials = () => setState((state) => {
if (state.workflowCredentials && state.credentialField) {
return ({
- Create a ticketCreate a ticket
File widgets.rb
has 551 lines of code (exceeds 400 allowed). Consider refactoring. Open
module ReportController::Widgets
extend ActiveSupport::Concern
RIGHT_CELL_TEXTS = {
"r" => [N_('Report Widgets'), N_('Report Widget "%{name}"')],
- Create a ticketCreate a ticket
Function provisionTabSchema
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
const provisionTabSchema = (
repositories,
setData,
provisionRepositoryId,
currentRegion,
- Create a ticketCreate a ticket
Method update_from_params
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def update_from_params(params)
self.typ = params[:perf_typ] if params[:perf_typ]
self.days = params[:perf_days] if params[:perf_days]
self.rt_minutes = params[:perf_minutes].to_i if params[:perf_minutes]
self.hourly_date = params[:miq_date_1] if params[:miq_date_1] && typ == 'Hourly'
- 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_field_changed
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def rbac_field_changed(rec_type)
id = params[:id].split('__').first || 'new' # Get the record id
id = id unless %w[new seq].include?(id)
return unless load_edit("rbac_#{rec_type}_edit__#{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 gfv_key_style
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def gfv_key_style(key, value)
parm, f_idx, s_idx = key.split("_") # Get the parm type, field index, and style index
f_idx = f_idx.to_i
s_idx = s_idx.to_i
f = @edit[:new][:field_order][f_idx] # Get the field element
- 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 createSchema
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (fields, edit, ems, loadSchema, emptySchema) => {
const idx = fields.findIndex((field) => field.name === 'volume_type');
const supports = edit ? 'supports_cloud_volume' : 'supports_cloud_volume_create';
let providerCapabilities;
- Create a ticketCreate a ticket
Class MiqRequestController
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class MiqRequestController < ApplicationController
include Mixins::GenericSessionMixin
include Mixins::BreadcrumbsMixin
before_action :check_privileges, :except => :post_install_callback
- Create a ticketCreate a ticket
Function createSchema
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSchema = (state, setState, ems, initialValues, storageId, setStorageId, volumeId, setVolumeId) => {
let emsId = state.ems_id;
if (initialValues && initialValues.ems_id) {
emsId = initialValues.ems_id;
}
- Create a ticketCreate a ticket
Function MiqDataTable
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
const MiqDataTable = ({
headers,
rows,
onCellClick,
mode,
- 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_replace_right_cell
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def settings_replace_right_cell(nodetype, presenter)
case nodetype
when "ze" # zone edit
# when editing zone in settings tree
if @zone.id.blank?
- 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"