Showing 316 of 336 total issues
Method getter_to_setter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def getter_to_setter(getter)
getter = getter.strip.gsub(/\(\s*\)/, '')
# Check to see if this can be converted to a setter
if getter[0] =~ /^[A-Z]/ && getter[-1] != ')'
- 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 dispatch_in_thread
has a Cognitive Complexity of 12 (exceeds 5 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
- 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 access
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
Function dispatch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
Method item_added
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def item_added(position)
item_context = nil
binding_name = @@binding_number
@@binding_number += 1
Method add_linking_in_asset_path
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_linking_in_asset_path
app_path = @volt_app.app_path
@env.context_class.class_eval do
# We "freedom-patch" sprockets-helpers asset_path method to
# automatically link assets.
Method validate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.validate(model, field_name, args)
errors = {}
value = model.get(field_name)
type_restriction = args.is_a?(Hash) ? (args[:type] || args[:types]) : args
Method update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(path, section_or_arguments = nil, options = {})
Computation.run_without_tracking do
@options = options
# A blank path needs to load a missing template, otherwise it tries to load
Consider simplifying this complex logical expression. Open
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
} else {
Consider simplifying this complex logical expression. Open
if ( start && start[ 3 ] !== unit ) {
// Trust units reported by jQuery.css
unit = unit || start[ 3 ];
// Make sure we update the tween properties later on
Function setOffset
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
Method parse
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse
loop do
if last && SPECIAL[last]
# In a script or style tag, just look for the first end
close_tag = "</#{last}>"
Function load
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
Function style
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
Method update_binding_anchors!
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_binding_anchors!(nodes)
new_bindings = {}
@binding_anchors.each_pair do |name, anchors|
new_name = @@binding_number
Method server
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def server
move_to_root
if ENV['PROFILE_BOOT']
begin
require 'ruby-prof'
Method field
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def field(name, klasses = nil, options = {})
if klasses
klasses = [klasses].flatten
unless klasses.any? {|kl| FIELD_CASTS.key?(kl) }
Method start_child
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def start_child
# Aquire the write lock, so we prevent anyone from using the child until
# its setup or recreated.
unless @drb_object
# Get the id of the parent process, so we can wait for exit in the child
- 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 assign_from_old
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def assign_from_old(params, new_params)
queued_deletes = []
params.attributes.each_pair do |name, old_val|
# If there is a new value, see if it has [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
Method run_initial_setup
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run_initial_setup(initial_setup)
# Save the changes
if initial_setup
# Run initial validation
if Volt.in_mode?(:no_validate)
- 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"