Showing 316 of 336 total issues
Function data
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: function( key, value ) {
var attrs, name,
elem = this[ 0 ],
i = 0,
data = null;
Method dispatch_in_thread
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dispatch_in_thread(channel, message)
callback_id, class_name, method_name, meta_data, *args = message
method_name = method_name.to_sym
# Get the class
Function remove
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, origCount, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Consider simplifying this complex logical expression. Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
Method add_binding
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_binding(content)
content = content.strip
index = content.index(/[ \(]/)
if index
first_symbol = content[0...index]
Function buildFragment
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildFragment: function( elems, context, scripts, selection ) {
var elem, tmp, tag, wrap, contains, j,
i = 0,
l = elems.length,
fragment = context.createDocumentFragment(),
Method setup
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setup
if `#{element}.is('select')`
@is_select = true
elsif `#{element}.is('[type=hidden]')`
@is_hidden = true
- 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 call_action
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def call_action(stage_prefix = nil, stage_suffix = nil)
return unless @action
has_stage = stage_prefix || stage_suffix
- 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 setup_action_helpers_in_class
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setup_action_helpers_in_class(*callback_names)
callback_names.each do |callback_name|
# Setup a class attribute to track the
callbacks_var_name = :"#{callback_name}_callbacks"
class_attribute(callbacks_var_name)
- 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
Function send
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function( headers, complete ) {
var i, id,
xhr = options.xhr();
xhr.open( options.type, options.url, options.async, options.username, options.password );
// Apply custom fields if provided
Function tokenize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
Function select
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
Function matcherFromTokens
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
Method server
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def server
move_to_root
if ENV['PROFILE_BOOT']
begin
require 'ruby-prof'
- 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 start_tag
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def start_tag(tag, tag_name, rest, unary)
section_tag = tag_name[0] == ':' && tag_name[1] =~ /[A-Z]/
if section_tag
tag_name = tag_name.underscore
- 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 create_new_model
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create_new_model(model, from_method)
if model.is_a?(Model)
if model.buffer?
fail "The #{from_method} does not take a buffer. Call .save! on buffer's to persist them."
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
Method repl
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def repl
loop do
case val = read
when :control_c
output.puts ''
- 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
Function addCombinator
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && dir === "parentNode",
doneName = done++;
Function val
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
val: function( value ) {
var hooks, ret, isFunction,
elem = this[0];
if ( !arguments.length ) {
Method update
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
# Find the true branch
true_template = nil
@branches.each do |branch|
value, template_name = branch