Showing 2,015 of 18,390 total issues
Method upload_csv
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def upload_csv
assert_privileges("region_edit")
return unless load_edit("#{@sb[:active_tab]}_edit__#{@sb[:selected_server_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 update_method
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def update_method
assert_privileges("miq_ae_method_edit")
return unless load_edit("aemethod_edit__#{params[:id]}", "replace_cell__explorer")
get_method_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 miq_policy_edit_conditions
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def miq_policy_edit_conditions
assert_privileges('miq_policy_conditions_assignment')
case params[:button]
when "cancel"
@sb[:action] = @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 rbac_group_user_lookup
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def rbac_group_user_lookup
assert_privileges(params[:id] == "new" ? "rbac_group_add" : "rbac_group_edit")
rbac_group_user_lookup_field_changed
- 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 live_migrate_vm
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def live_migrate_vm
assert_privileges("instance_live_migrate")
case params[:button]
when "cancel"
add_flash(_("Live migration of Instances 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 set_rate_details
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def set_rate_details
@edit[:new][:details] = []
tiers = []
@rate ||= ChargebackRate.new
rate_details = @rate.chargeback_rate_details
- 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 validate_snmp_options
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def validate_snmp_options(options)
if options[:host].nil? || options[:host] == ""
add_flash(_("Host is required"), :error)
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 set_record_vars_ovf_template
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def set_record_vars_ovf_template
options = {}
options[:name] = @edit[:new][:name]
options[:description] = @edit[:new][:description]
options[:long_description] = @edit[:new][:display] ? @edit[:new][:long_description] : 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 set_form_vars
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def set_form_vars
@edit[:new][:name] = @record.name
@edit[:new][:description] = @record.description
@edit[:new][:long_description] = @record.long_description
@edit[:new][:provision_cost] = @record.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 gfv_charts
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def gfv_charts
if params[:chosen_graph] && params[:chosen_graph] != @edit[:new][:graph_type]
if params[:chosen_graph] == "<No chart>"
@edit[:new][:graph_type] = nil
# Reset other setting to initial settings if choosing <No chart>
- 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_repname_update
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def menu_repname_update(old_name, new_name)
# @param old_name [String] old name for the report
# @param new_name [String, Nil] new name for the report. nil if it was deleted
all_roles = MiqGroup.non_tenant_groups_in_my_region
- 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_folder
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def edit_folder
if params[:button] == "reset" || params[:button] == "default" # resetting node in case reset button is pressed
session[:node_selected] = "xx-b__Report Menus for #{session[:role_choice]}"
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 show
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def show
super
@alert = @record
@email_to = []
if @alert.responds_to_events == "_hourly_timer_"
- 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 miqExpressionPrefill
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.miqExpressionPrefill = function(expEditor, noPrefillCount) {
let title;
if ($('#chosen_value[type=text]').length) {
$('#chosen_value').prop('placeholder', expressions[expEditor.first.type]);
- Create a ticketCreate a ticket
Function newInstance
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function newInstance(name, initialProps = {}, mountTo = undefined) {
// clean all left over components
cleanVirtualDom();
// validate inputs
const definition = getDefinition(name);
- Create a ticketCreate a ticket
Function getFirewallRules
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getFirewallRules = (initialValues, values, securityGroupId) => {
const oldFirewallRuleIds = [];
const temp = { firewall_rules: [], firewall_rules_delete: false };
if (values.firewall_rules.length > 0 || initialValues.firewall_rules.length > 0) {
- Create a ticketCreate a ticket
Function catalogData
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const catalogData = () => {
const columns = [
{ is_narrow: true, header_text: '' },
{
text: 'Name', sort: 'str', col_idx: 0, align: 'left', header_text: 'Name',
- Create a ticketCreate a ticket
Function CodeEditor
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CodeEditor = (props) => {
const {
labelText,
input: { value, onChange, name },
FormGroupProps,
- Create a ticketCreate a ticket
Method perf_util_summary_section
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perf_util_summary_section(s)
ss = []
# Fill in the single day data from the timestamp report
ts_rpt = @sb[:ts_rpt]
- Create a ticketCreate a ticket
Method data_for_breadcrumbs
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def data_for_breadcrumbs(controller_options = {})
options = breadcrumbs_options || {}
options[:record_info] ||= (@record || {})
options[:record_title] ||= :name
options[:not_tree] ||= false
- Create a ticketCreate a ticket