celluloid/celluloid

View on GitHub

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

Severity: Minor
Found in lib/celluloid/task.rb - About 1 hr to fix

    Method << has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def <<(message)
            @mutex.lock
            begin
              if mailbox_full || @dead
                dead_letter(message)
    Severity: Minor
    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
      Severity: Minor
      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"

      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)
      Severity: Minor
      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"

      Further reading

      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
      Severity: Minor
      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"

      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
      Severity: Minor
      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"

      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)
      Severity: Minor
      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"

      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
      Severity: Minor
      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"

      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
      Severity: Minor
      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"

      Further reading

      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
      Severity: Minor
      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"

      Further reading

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

          def inspect
            return "..." if Celluloid.detect_recursion
      
            str = "#<"
      
      
      Severity: Minor
      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"

      Further reading

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

                sender,
                method,
                arguments = [],
                block = nil,
                task = Thread.current[:celluloid_task],
      Severity: Minor
      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)
        Severity: Minor
        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)
          Severity: Minor
          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
            Severity: Minor
            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"

            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] = []
            Severity: Minor
            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"

            Further reading

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

                def initialize(type, meta)
                  @type     = type
                  @meta     = meta
                  @status   = :new
            
            
            Severity: Minor
            Found in lib/celluloid/task.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"

            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
            Severity: Minor
            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"

            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]
            Severity: Minor
            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"

            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)
            Severity: Minor
            Found in lib/celluloid/task/threaded.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"

            Further reading

            Severity
            Category
            Status
            Source
            Language