Showing 104 of 124 total issues
Method while
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def while(condition, source)
enum = Enumerator.new {|y|
while condition.call
y << source
end
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|
Method when
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def when(*plans)
AnonymousObservable.new do |observer|
active_plans = []
external_subscriptions = {}
out_observer = Observer.configure {|o|
Method generate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(initial_state, condition, iterate, result_selector, scheduler = CurrentThreadScheduler.instance)
AnonymousObservable.new do |observer|
state = initial_state
first = true
Method from
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def from(iterable, map_fn = nil, scheduler = CurrentThreadScheduler.instance)
it = iterable.to_enum
AnonymousObservable.new {|observer|
i = 0
scheduler.schedule_recursive lambda {|this|
- 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 take
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def take(count, scheduler = ImmediateScheduler.instance)
return Observable.empty(scheduler) if count == 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 skip_until
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def skip_until(other)
raise ArgumentError.new 'Other cannot be nil' unless other
AnonymousObservable.new do |observer|
source_subscription = SingleAssignmentSubscription.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 match
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def match
has_values = true
@join_observer_array.each {|v|
if v.queue.length == 0
has_values = false
- 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_all
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge_all
AnonymousObservable.new do |observer|
gate = Monitor.new
stopped = false
m = SingleAssignmentSubscription.new
Method configure
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(options = {})
options.each {|key,_|
unless [:created, :subscribed, :disposed].include? key
raise ArgumentError, "Should be specified whether :created, :subscribed or :disposed, but the #{key.inspect}"
end
Method from
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from(iterable, map_fn = nil, scheduler = CurrentThreadScheduler.instance)
it = iterable.to_enum
AnonymousObservable.new {|observer|
i = 0
scheduler.schedule_recursive lambda {|this|
Method select_with_index
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def select_with_index(&block)
AnonymousObservable.new do |observer|
i = 0
new_observer = 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 rescue_error
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def rescue_error(other = nil, &action)
return Observable.rescue_error(other) if other && !block_given?
raise ArgumentError.new 'Invalid arguments' if other.nil? && !block_given?
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 reduce
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def reduce(*args, &block)
# Argument parsing to support:
# 1. (seed, Symbol) || (seed, &block)
# 2. (Symbol) || (&block)
if (args.length == 2 && args[1].is_a?(Symbol)) || (args.length == 1 && block_given?)
- 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 concat_map_observer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def concat_map_observer(on_next, on_error, on_completed)
AnonymousObservable.new do |observer|
index = 0
subscribe(
- 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 initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(source, on_error)
super Observer.configure {|o|
o.on_next {|notification|
if !@is_disposed
if notification.on_error?
- 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 while
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def while(condition, source)
enum = Enumerator.new {|y|
while condition.call
y << source
end
- 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 _subscribe
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _subscribe(observer)
auto_detach_observer = AutoDetachObserver.new observer
if CurrentThreadScheduler.schedule_required?
- 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 zip
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def zip(*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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start
unless @enabled
@enabled = true
begin
- 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"