Showing 2,015 of 18,390 total issues
Avoid too many return
statements within this method. Open
return if %w[orchestration_stack_retire orchestration_stack_tag].include?(params[:pressed]) &&
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return if ["#{table_name}_tag", "#{display_s}_tag", "#{table_name}_protect", "#{display_s}_protect", "#{table_name}_timeline"].include?(params[:pressed]) &&
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return record.title if record.respond_to?("title")
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return validate_user_handle_not_ready(db_user) unless server_ready?
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return ValidateResult.new(:fail, _("The user's role is not authorized for any access, please contact the administrator!"))
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return validate_user_handle_no_records if db_user.super_admin_user? && no_records?
- Create a ticketCreate a ticket
Function miqSetButtons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.miqSetButtons = function(count, button_div) {
if (button_div.match('_tb$') && count === 0) {
// FIXME: this should be happening regardless of `count === 0`
// ..but that needs more refactoring around miqUpdateAllCheckboxes, miqUpdateButtons, etc.
miqSetToolbarCount(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
Function updateElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ManageIQ.explorer.updateElement = function(element, options) {
if (_.isString(options.legend)) {
$('#' + element).html(options.legend);
} else if (_.isString(options.title)) {
$('#' + element).attr( {'title': options.title});
- 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 asyncValidator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const asyncValidator = (value = '', ancestry, itemId) =>
API.get(`/api/tenants?filter[]=name=${value}&expand=resources`)
.then((json) => {
if (json.resources.find(({ id, name }) => name === value && id !== itemId)) {
throw __('Name has already been taken');
- 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 getFirewallRules
has a Cognitive Complexity of 6 (exceeds 5 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) {
- 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"