Showing 157 of 179 total issues
Function addClass
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addClass: function( value ) {
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this);
self.addClass( value.call(this, i, self.attr("class") || "") );
Function custom
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx,
raf;
Function html
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
html: function( value ) {
if ( value === undefined ) {
return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
Function find
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Sizzle.find = function( expr, context, isXML ) {
var set;
if ( !expr ) {
return [];
Function >
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
Function handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
handle: function( event ) {
event = jQuery.event.fix( event || window.event );
// Snapshot the handlers list since a called handler may add/remove events.
var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
run_all = !event.exclusive && !event.namespace,
Function cloneFixAttributes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cloneFixAttributes( src, dest ) {
var nodeName;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
Function toggleClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
Method build
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build( domain_name = nil )
# get the class of the record_type
record_class = self.record_type.constantize
# duplicate our own attributes, strip out the ones the destination doesn't
- 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 can_change?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def can_change?( record, type = '*' )
name, type = get_name_and_type_from_param( record, type )
# NS records?
return false if type == 'NS' || type == 'SOA'
- 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 i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
Avoid deeply nested control flow statements. Open
if ( !anyFound ) {
return [];
}
Avoid deeply nested control flow statements. Open
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
Avoid deeply nested control flow statements. Open
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
Avoid deeply nested control flow statements. Open
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Avoid deeply nested control flow statements. Open
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id === match[3] ) {
return makeArray( [ elem ], extra );
Avoid deeply nested control flow statements. Open
for ( j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
}
Avoid deeply nested control flow statements. Open
if ( display === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.display = "inline";
Method update_serial
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_serial
unless Record.batch_soa_updates.nil?
if Record.batch_soa_updates.include?( self.id )
return
end
- 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 ( !inplace ) {
curLoop = result;
}