Showing 1,006 of 6,062 total issues
Method queue_proposal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def queue_proposal(bc, inst, elements, element_order, deps, pre_cached_nodes)
logger.debug("queue proposal: enter for #{bc}:#{inst}")
delay = []
begin
lock = acquire_lock("queue")
- 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 convert_value
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convert_value(value, dup = false)
case value
when Hash
value = value.dup if value.is_a?(ExtendedHash) && dup
value.is_a?(ExtendedHash) ? value : value.to_extended
- 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 forwarders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def forwarders
f = File.open("/etc/bind/named.conf")
arr = []
write = false
f.each_line do |line|
- 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 find_scripts_for_bc
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.find_scripts_for_bc(bc_name)
all_scripts = []
migrate_dir = get_migrate_dir(bc_name)
return all_scripts unless File.directory?(migrate_dir)
- 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 run_script
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run_script(script, is_upgrade, template_attributes, template_deployment, attributes, deployment)
- Create a ticketCreate a ticket
Method provided_with_enabled
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def provided_with_enabled(feature,
platform = nil,
arch = nil,
check_enabled = true,
ignore_cloud = false,
- Create a ticketCreate a ticket
Method deep_update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def deep_update(other_hash)
other_hash = other_hash.to_hash if other_hash.is_a?(ExtendedHash)
other_hash = other_hash.stringify_keys
other_hash.each_pair do |k,v|
- 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 migrate_object
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.migrate_object(bc_name, template, all_scripts, attributes, deployment)
attributes ||= Mash.new
deployment ||= Mash.new
current_schema_revision = deployment["schema-revision"]
- 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 element_node
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def element_node(element)
usage(-1) if element.nil? or element == ""
struct = get_json("/elements/#{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
Method queue_proposal
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def queue_proposal(bc, inst, elements, element_order, deps, pre_cached_nodes)
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( !support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( support.matchesSelector && documentIsHTML &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
try {
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
return;
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( o.mode === "toggle" && mode === "show" ) {
el.from = o.to || zero;
el.to = o.from || original;
} else {
el.from = o.from || ( mode === "show" ? zero : original );
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( tab.hasClass( "ui-state-disabled" ) ||
// tab is already loading
tab.hasClass( "ui-tabs-loading" ) ||
// can't switch durning an animation
this.running ||
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if(
inst.options.greedy &&
!inst.options.disabled &&
inst.options.scope === draggable.options.scope &&
inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( ( this.options.values.length === 2 && this.options.range === true ) &&
( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
) {
newVal = otherVal;
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
curElem = hook === "backgroundColor" ? elem.parentNode : elem;
while (
(backgroundColor === "" || backgroundColor === "transparent") &&
curElem && curElem.style
- Create a ticketCreate a ticket