Showing 350 of 350 total issues
Avoid deeply nested control flow statements. Open
if ( pos == null ) {
eventType.splice( j--, 1 );
}
Avoid deeply nested control flow statements. Open
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
} else {
jQuery.removeEvent( elem, type, data.handle );
Method visible_field_descriptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def visible_field_descriptions(type = nil, limit = nil)
type ||= :listing
where = "is_visible_in_#{type.to_s}".to_sym
@field_descriptions_cache = {} unless @field_descriptions_cache
if @field_descriptions_cache[type]
- Read upRead up
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
Avoid deeply nested control flow statements. Open
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[c] + " ", " ");
}
Avoid deeply nested control flow statements. Open
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
logout_keeping_session!
user = User.authenticate(params[:login], params[:password])
if user
# Protects against session fixation attacks, causes request forgery
- Read upRead up
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 log_changes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def log_changes
change_details = []
changed_attributes.each do |attribute, old_value|
next if attribute == "updated_at"
next if old_value == self[attribute]
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery(option).val();
Function access
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
access: function( elems, key, value, exec, fn, pass ) {
Avoid deeply nested control flow statements. Open
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Function CLASS
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
Function ATTR
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
Avoid deeply nested control flow statements. Open
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
Avoid deeply nested control flow statements. Open
if ( !inplace ) {
curLoop = result;
}
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
# Special case when we wanna automagically create description for some field
@field_description = @dataset_description.field_descriptions.build(params[:field_description])
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if ( !anyFound ) {
return [];
}
Avoid deeply nested control flow statements. Open
if type_element.inner_text.match(/Tovary/) && category_element.inner_text.match(/Tovary/)
category_element = next_element(category_element)
place_is_next = true
end
Avoid deeply nested control flow statements. Open
if project_type_matches
project_type = project_type_matches[2]
end
Avoid deeply nested control flow statements. Open
supplier[:supplier_ico] = ico if code.next.xpath(".//table[1]//tr[2]").inner_text.match(/I(Č|C)O/)
Avoid deeply nested control flow statements. Open
if category_element.inner_text.match(/Kategórie služieb sú uvedené v prílohe C1/)
content = category_element.xpath(".//span[2]").inner_text.strip
elsif category_element.inner_text.match(/Kategória služby číslo/)
category_element = next_element(category_element)
content = category_element.xpath(".//span[2]").inner_text.strip