Showing 316 of 336 total issues
Method validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate(field_name = nil, options = nil, &block)
if block
if field_name || options
fail 'validate should be passed a field name and options or a block, not both.'
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 validations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validations(*run_in_actions, &block)
unless block_given?
raise 'validations must take a block, use `validate` to setup a validation on a class directly.'
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 call
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
type = Rack::Request.new(env).media_type
parser = parsers.detect { |content_type, _| type.match(content_type) } if type
return @app.call(env) unless parser
body = env[POST_BODY].read ; env[POST_BODY].rewind
- 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 deny
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def deny(*fields)
if @__deny_fields
if @__deny_fields != true
if fields.size == 0
# No field's were passed, this means we deny all
- 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 lookup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def lookup(*args, &block)
section = @pool
# TODO: This is to work around opal issue #500
args.pop if args.last.nil? if RUBY_PLATFORM == 'opal'
- 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 allow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def allow(*fields)
if @__allow_fields
if @__allow_fields != true
if fields.size == 0
# No field's were passed, this means we deny all
- 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 stop_listening
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def stop_listening
Timers.client_set_timeout(5000) do
Computation.run_without_tracking do
if @listener_event_counter.count == 0
if @added_to_query
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
@child_lock.with_read_lock do
if @exiting
[500, {}, 'Server Exiting']
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
Avoid deeply nested control flow statements. Open
if time.is_a?(Numeric)
return VoltTime.at(time / 1000.0)
end
Consider simplifying this complex logical expression. Open
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
Consider simplifying this complex logical expression. Open
if ( support.matchesSelector && documentIsHTML &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
try {
Consider simplifying this complex logical expression. Open
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
Consider simplifying this complex logical expression. Open
if RUBY_PLATFORM == 'opal'
require 'ostruct'
# TODO: Temporary fix for missing on OpenStruct in opal
class OpenStruct
Function Tween
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Tween( elem, options, prop, end, easing ) {
Function remove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
remove: function( elem, types, handler, selector, mappedTypes ) {
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(volt_app, target, context, binding_name, getter)
Function on
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
Function condense
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function condense( unmatched, map, filter, context, xml ) {
Function add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(volt_app, target, context, binding_name, template_name)