# celluloid/celluloid

### 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
Found in lib/celluloid/mailbox/evented.rb - About 1 hr to fix

#### 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``````
Found in lib/celluloid/supervision/container/instance.rb - About 55 mins to fix

# 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"

#### 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)``````
Found in lib/celluloid/supervision/container/behavior.rb - About 55 mins to fix

# 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"

#### 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``````
Found in lib/celluloid/future.rb - About 55 mins to fix

# 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"

#### 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``````
Found in lib/celluloid/actor.rb - About 55 mins to fix

# 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"

#### Method `<<` has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open

``````      def <<(message)
@mutex.lock
begin
Found in lib/celluloid/mailbox/evented.rb - About 55 mins to fix

# 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"

#### Method `shutdown` has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open

``````      def shutdown
@running = false
queue = []
@mutex.synchronize do
loop do``````
Found in lib/celluloid/group/spawner.rb - About 55 mins to fix

# 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"

#### 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?

Found in lib/celluloid/condition.rb - About 45 mins to fix

# 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"

#### 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``````
Found in lib/celluloid/logging/incident_logger.rb - About 45 mins to fix

# 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"

#### Method `inspect` has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open

``````    def inspect
return "..." if Celluloid.detect_recursion

str = "#<"

``````
Found in lib/celluloid.rb - About 45 mins to fix

# 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"

#### Method `initialize` has 6 arguments (exceeds 4 allowed). Consider refactoring. Open

``````          sender,
method,
arguments = [],
block = nil,
Found in lib/celluloid/call/sync.rb - About 45 mins to fix

#### Method `task` has 5 arguments (exceeds 4 allowed). Consider refactoring. Open

``    def task(task_type, method_name = nil, subject = nil, meta = nil, &_block)``
Found in lib/celluloid/cell.rb - About 35 mins to fix

#### Method `initialize` has 5 arguments (exceeds 4 allowed). Consider refactoring. Open

``    def initialize(severity, message, progname, time = Time.now, &_block)``
Found in lib/celluloid/logging/log_event.rb - About 35 mins to fix

#### 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``````
Found in lib/celluloid/supervision/configuration.rb - About 35 mins to fix

# 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"

#### 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] = []``````
Found in lib/celluloid/internals/registry.rb - About 35 mins to fix

# 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"

#### Method `initialize` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open

``````    def initialize(type, meta)
@type     = type
@meta     = meta
@status   = :new

``````

# 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"

#### 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``````
Found in lib/celluloid/supervision/container/pool.rb - About 35 mins to fix

# 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"

#### 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]``````
Found in lib/celluloid/supervision/configuration.rb - About 35 mins to fix

# 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"

#### Method `deliver` has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open

``````      def deliver(value)

@yield_mutex.synchronize do
@resume_queue.push(value)``````

# 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"
{"ft_lang_label":"__label__en","ft_lang_prob":0.8749268,"math_prob":0.73016745,"size":14386,"snap":"2021-43-2021-49","text_gpt3_token_len":3030,"char_repetition_ratio":0.20261438,"word_repetition_ratio":0.8266727,"special_character_ratio":0.19977756,"punctuation_ratio":0.08386009,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95191735,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-21T15:31:38Z\",\"WARC-Record-ID\":\"<urn:uuid:bc7fb02f-5798-43da-8c6d-ed7d207251b1>\",\"Content-Length\":\"59882\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a2bc9a14-b0a0-4f74-aa43-ea9bcbf92761>\",\"WARC-Concurrent-To\":\"<urn:uuid:4ad27a26-9ecb-453f-81b0-9d05dcd324be>\",\"WARC-IP-Address\":\"3.94.226.54\",\"WARC-Target-URI\":\"https://codeclimate.com/github/celluloid/celluloid/issues?category=complexity&engine_name%5B%5D=structure&engine_name%5B%5D=duplication&page=2\",\"WARC-Payload-Digest\":\"sha1:72UXGY6SI3NKTWLSRLPSVLYC5NJU5FTD\",\"WARC-Block-Digest\":\"sha1:K47HY2VXNQLNVUUPVPJXDYB3MOFGFBSA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585424.97_warc_CC-MAIN-20211021133500-20211021163500-00015.warc.gz\"}"}