Showing 94 of 116 total issues
Function extend
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.extend = jQuery.fn.extend = function() {
// copy reference to target object
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
// Handle a deep copy situation
Function clone
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function( events ) {
// Do the clone
var ret = this.map(function(){
if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
// IE copies events bound via attachEvent when
Method initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(app)
if panel_app
#XXX use mappings
@app = Rack::Cascade.new([panel_app, app])
else
- 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 ip_authorized?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ip_authorized?
return true unless options["rack-insight.ip_masks"]
logger.info{ "Checking #{@original_request.ip} against ip_masks" } if verbose(:high)
ip = IPAddr.new(@original_request.ip)
- 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 after
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def after(env,status,headers,body)
sections = {}
sections["GET"] = sort(@request.GET) if @request.GET.any?
sections["POST"] = sort(@request.POST) if @request.POST.any?
# TODO: Better Fix for Rails 4 (as part of splitting panels into separate gems)
- 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 decode_message
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def decode_message(m)
@m = m.clone
params = ActiveSupport::OrderedHash.new
# Mode, Limits
- 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 run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(object, context="::", kind=:instance, called_at = caller[0], method = "<unknown>", args=[], &blk)
Avoid deeply nested control flow statements. Open
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
Avoid deeply nested control flow statements. Open
if ( !anyFound ) {
return [];
}
Avoid deeply nested control flow statements. Open
if ( display === "none" )
display = "block";
Method probe_run
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def probe_run(object, context = "::", kind=:instance, args=[], called_at=caller[1], method_name = nil)
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 ( results[i] === results[i-1] ) {
results.splice(i--, 1);
}
Avoid deeply nested control flow statements. Open
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
Function CLASS
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CLASS: function(match, curLoop, inplace, result, not, isXML){
Function dirNodeCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Avoid deeply nested control flow statements. Open
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
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 ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
if (elem.removeEventListener)
elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
else if (elem.detachEvent)
elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
Avoid deeply nested control flow statements. Open
if ( option.selected ) {
// Get the specifc value for the option
value = jQuery(option).val();
// We don't need an array for one selects