Showing 104 of 124 total issues
Method combine_latest
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def combine_latest(other, &result_selector)
AnonymousObservable.new do |observer|
has_left = false
has_right = false
Method delay_with_selector
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delay_with_selector(subscription_delay, delay_duration_selector = nil)
if Proc === subscription_delay
selector = subscription_delay
else
sub_delay = subscription_delay
Method delay_time_span
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delay_time_span(due_time, scheduler)
AnonymousObservable.new do |observer|
active = false
cancelable = SerialSubscription.new
exception = nil
Method take_while_with_index
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def take_while_with_index(&block)
AnonymousObservable.new do |observer|
running = true
i = 0
- 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 skip_while_with_index
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def skip_while_with_index(&block)
AnonymousObservable.new do |observer|
running = false
i = 0
- 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 rescue_error
has 49 lines of code (exceeds 25 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
Method fork_join
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fork_join(*all_sources)
AnonymousObservable.new {|subscriber|
count = all_sources.length
if count == 0
subscriber.on_completed
Method combine_latest
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def combine_latest(*args, &result_selector)
AnonymousObservable.new do |observer|
result_selector ||= lambda {|*inner_args| inner_args }
n = args.length
- 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 generate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def generate(initial_state, condition, iterate, result_selector, scheduler = CurrentThreadScheduler.instance)
AnonymousObservable.new do |observer|
state = initial_state
first = true
- 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
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def distinct(&key_selector)
key_selector ||= lambda {|x| x}
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 merge_concurrent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge_concurrent(max_concurrent = 1)
AnonymousObservable.new do |observer|
gate = Monitor.new
q = []
stopped = false
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 do
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def do(observer_or_on_next = nil, on_error_func = nil, on_completed_func = nil)
if block_given?
on_next_func = Proc.new
elsif Proc === observer_or_on_next
on_next_func = observer_or_on_next
- 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 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 combine_latest
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def combine_latest(*args, &result_selector)
AnonymousObservable.new do |observer|
result_selector ||= lambda {|*inner_args| inner_args }
n = args.length
Method concat
has 41 lines of code (exceeds 25 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
Method on_error_resume_next
has 41 lines of code (exceeds 25 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
Method sample
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def sample(intervalOrSampler, scheduler = DefaultScheduler.instance, &recipe)
sampler = if intervalOrSampler.is_a? Numeric
Observable.interval(intervalOrSampler, scheduler)
else
intervalOrSampler
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def wait(&action)
@gate.synchronize do
@queue.push action unless @has_faulted
if @is_acquired or @has_faulted
- 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 delay_with_selector
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def delay_with_selector(subscription_delay, delay_duration_selector = nil)
if Proc === subscription_delay
selector = subscription_delay
else
sub_delay = subscription_delay
- 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"