Showing 45 of 53 total issues
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(type, meta)
@type = type
@meta = meta
@status = :new
Method <<
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def <<(message)
@mutex.lock
begin
if mailbox_full || @dead
dead_letter(message)
Method signal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def signal(value)
return if @cancelled
result = Result.new(value, self)
@mutex.synchronize do
- 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 remove_accessors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def remove_accessors
if @configuration[:accessors].is_a? Array
@configuration[:accessors].each do |name|
Celluloid.instance_eval do
remove_method(name) rescue nil # avoid warnings in tests
- 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 configure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def configure(options)
behavior = nil
injection = nil
@@behaviors.map do |identifier, injector|
if identifier = parameter(identifier, options)
- 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 shutdown
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def shutdown
@running = false
queue = []
@mutex.synchronize do
loop do
- 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 <<
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def <<(message)
@mutex.lock
begin
if mailbox_full || @dead
dead_letter(message)
- 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 cleanup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def cleanup(exit_event)
# !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
# rubocop:disable Style/GlobalVars
Celluloid::Probe.actor_died(self) if $CELLULOID_MONITORING
# rubocop:enable Style/GlobalVars
- 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 inspect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def inspect
return "..." if Celluloid.detect_recursion
str = "#<"
- 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 wait
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wait(timeout = nil)
raise ConditionError, "cannot wait for signals while exclusive" if Celluloid.exclusive?
if actor = Thread.current[:celluloid_actor]
task = Task.current
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
sender,
method,
arguments = [],
block = nil,
task = Thread.current[:celluloid_task],
Method add
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add(severity, message = nil, progname = nil, &block)
progname ||= @progname
severity ||= UNKNOWN
return event.id if severity < @level
- 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 task
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def task(task_type, method_name = nil, subject = nil, meta = nil, &_block)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(severity, message, progname, time = Time.now, &_block)
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(type, meta)
@type = type
@meta = meta
@status = :new
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = {})
@instances = [Instance.new]
@branch = :services
@i = 0 # incrementer of instances in this branch
resync_accessors
- 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 deliver
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def deliver(value)
raise DeadTaskError, "cannot resume a dead task" unless @thread.alive?
@yield_mutex.synchronize do
@resume_queue.push(value)
- 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 add
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add(name, actor, branch = :services)
set(name, actor)
@registry.synchronize do
unless @branches.key? branch
@branches[branch] = []
- 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 __shutdown__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __shutdown__
return unless defined?(@actors) && @actors
# TODO: these can be nil if initializer crashes
terminators = @actors.map do |actor|
begin
- 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 define
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def define(configuration, fail = false)
if configuration.is_a? Array
configuration.each { |c| define(c, fail) }
else
unless include? configuration[:as]
- 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"