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
- 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
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'
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|
- 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 scan
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scan(*args, &block)
has_seed = false
seed = nil
action = nil
Method tap
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def tap(observer)
raise ArgumentError.new 'Observer cannot be nil' unless observer
AnonymousObservable.new do |obs|
new_obs = Rx::Observer.configure do |o|
- 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 window_with_count
has 33 lines of code (exceeds 25 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|
Method take_last
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def take_last(count, scheduler = CurrentThreadScheduler.instance)
raise ArgumentError.new 'Count cannot be less than zero' if count < 0
AnonymousObservable.new do |observer|
q = []
g = CompositeSubscription.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 distinct_until_changed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def distinct_until_changed(&key_selector)
key_selector ||= lambda {|x| x}
AnonymousObservable.new do |observer|
current_key = nil
has_current = nil
- 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 tap
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tap(observer)
raise ArgumentError.new 'Observer cannot be nil' unless observer
AnonymousObservable.new do |obs|
new_obs = Rx::Observer.configure do |o|