ReactiveX/RxRuby

View on GitHub

Showing 104 of 124 total issues

File multiple.rb has 558 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'monitor'
require 'rx/concurrency/async_lock'
require 'rx/subscriptions/subscription'
require 'rx/subscriptions/composite_subscription'
require 'rx/subscriptions/ref_count_subscription'
Severity: Major
Found in lib/rx/operators/multiple.rb - About 1 day to fix

    Method sequence_eql? has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        def sequence_eql?(other)
          AnonymousObservable.new do |observer|
            gate = Mutex.new
            left_done = false
            right_done = false
    Severity: Minor
    Found in lib/rx/operators/aggregates.rb - About 1 day 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 delay_time_span has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def delay_time_span(due_time, scheduler)
          AnonymousObservable.new do |observer|
            active = false
            cancelable = SerialSubscription.new
            exception = nil
    Severity: Minor
    Found in lib/rx/linq/observable/delay.rb - About 6 hrs 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

    File aggregates.rb has 420 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'thread'
    require 'rx/subscriptions/composite_subscription'
    require 'rx/core/observer'
    require 'rx/core/observable'
    require 'rx/operators/single'
    Severity: Minor
    Found in lib/rx/operators/aggregates.rb - About 6 hrs to fix

      Method combine_latest has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          def combine_latest(other, &result_selector)
            AnonymousObservable.new do |observer|
              has_left = false
              has_right = false
      
      
      Severity: Minor
      Found in lib/rx/operators/multiple.rb - About 5 hrs 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 rescue_error has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

            def rescue_error(*args)
              AnonymousObservable.new do |observer|
                gate = AsyncLock.new
                disposed = false
                e = args.length == 1 && args[0].is_a?(Enumerator) ? args[0] : args.to_enum
      Severity: Minor
      Found in lib/rx/operators/multiple.rb - About 4 hrs 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 scan has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          def scan(*args, &block)
            has_seed = false
            seed = nil
            action = nil
      
      
      Severity: Minor
      Found in lib/rx/operators/single.rb - About 4 hrs 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 window_with_time has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def window_with_time(time_span, time_shift = time_span, scheduler = DefaultScheduler.instance)
            raise ArgumentError.new 'time_span must be greater than zero' if time_span <= 0
            raise ArgumentError.new 'time_span must be greater than zero' if time_shift <= 0
      
            AnonymousObservable.new do |observer|
      Severity: Minor
      Found in lib/rx/operators/time.rb - About 3 hrs 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 concat has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

            def concat(*args)
              AnonymousObservable.new do |observer|
                disposed = false
                e = args.length == 1 && args[0].is_a?(Enumerator) ? args[0] : args.to_enum
                subscription = SerialSubscription.new
      Severity: Minor
      Found in lib/rx/operators/multiple.rb - About 3 hrs 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 on_error_resume_next has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

            def on_error_resume_next(*args)
              AnonymousObservable.new do |observer|
                gate = AsyncLock.new
                disposed = false
                e = args.length == 1 && args[0].is_a?(Enumerator) ? args[0] : args.to_enum
      Severity: Minor
      Found in lib/rx/operators/multiple.rb - About 3 hrs 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 merge_concurrent has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def merge_concurrent(max_concurrent = 1)
            AnonymousObservable.new do |observer|
              gate = Monitor.new
              q = []
              stopped = false
      Severity: Minor
      Found in lib/rx/operators/multiple.rb - About 3 hrs 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 group_join has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def group_join(right, left_duration_selector, right_duration_selector, result_selector)
            AnonymousObservable.new do |observer|
              group = CompositeSubscription.new
              r = RefCountSubscription.new(group)
              left_map = {}
      Severity: Major
      Found in lib/rx/linq/observable/group_join.rb - About 3 hrs to fix

        File single.rb has 299 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'rx/subscriptions/subscription'
        require 'rx/subscriptions/composite_subscription'
        require 'rx/subscriptions/ref_count_subscription'
        require 'rx/subscriptions/single_assignment_subscription'
        require 'rx/core/observer'
        Severity: Minor
        Found in lib/rx/operators/single.rb - About 3 hrs to fix

          Method sequence_eql? has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def sequence_eql?(other)
                AnonymousObservable.new do |observer|
                  gate = Mutex.new
                  left_done = false
                  right_done = false
          Severity: Major
          Found in lib/rx/operators/aggregates.rb - About 3 hrs to fix

            Method extrema_by has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                def extrema_by(is_min = false, &block)
                  AnonymousObservable.new do |observer|
                    has_value = false
                    last_key = nil
                    list = []
            Severity: Minor
            Found in lib/rx/operators/aggregates.rb - About 3 hrs 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 window_with_time has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def window_with_time(time_span, time_shift = time_span, scheduler = DefaultScheduler.instance)
                  raise ArgumentError.new 'time_span must be greater than zero' if time_span <= 0
                  raise ArgumentError.new 'time_span must be greater than zero' if time_shift <= 0
            
                  AnonymousObservable.new do |observer|
            Severity: Major
            Found in lib/rx/operators/time.rb - About 2 hrs to fix

              Method fork_join has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                  def fork_join(*all_sources)
                    AnonymousObservable.new {|subscriber|
                      count = all_sources.length
                      if count == 0
                        subscriber.on_completed
              Severity: Minor
              Found in lib/rx/linq/observable/fork_join.rb - About 2 hrs 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 latest has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  def latest
                    AnonymousObservable.new do |observer|
                      gate = Monitor.new
                      inner_subscription = SerialSubscription.new
                      stopped = false
              Severity: Minor
              Found in lib/rx/operators/multiple.rb - About 2 hrs 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 group_join has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  def group_join(right, left_duration_selector, right_duration_selector, result_selector)
                    AnonymousObservable.new do |observer|
                      group = CompositeSubscription.new
                      r = RefCountSubscription.new(group)
                      left_map = {}
              Severity: Minor
              Found in lib/rx/linq/observable/group_join.rb - About 2 hrs 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 window_with_count has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  def window_with_count(count, skip)
                    raise ArgumentError.new 'Count must be greater than zero' if count <= 0
                    raise ArgumentError.new 'Skip must be greater than zero' if skip <= 0
              
                    AnonymousObservable.new do |observer|
              Severity: Minor
              Found in lib/rx/operators/single.rb - About 2 hrs 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