ReactiveX/Rx.rb

View on GitHub
lib/rx/operators/standard_query_operators.rb

Summary

Maintainability
C
1 day
Test Coverage

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

Severity: Minor
Found in lib/rx/operators/standard_query_operators.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 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

Severity: Minor
Found in lib/rx/operators/standard_query_operators.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 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|

Severity: Minor
Found in lib/rx/operators/standard_query_operators.rb - About 1 hr 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 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|

Severity: Minor
Found in lib/rx/operators/standard_query_operators.rb - About 1 hr 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 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|
Severity: Minor
Found in lib/rx/operators/standard_query_operators.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

There are no issues that match your filters.

Category
Status