ReactiveX/RxJava

View on GitHub

Showing 657 of 1,068 total issues

Method downstreamRequest has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    final void downstreamRequest(long n) {
        if (n < 0L) {
            throw new IllegalArgumentException("n >= 0 required but it was " + n);
        }
        if (n != 0L) {
Severity: Minor
Found in src/main/java/rx/internal/operators/DeferredScalarSubscriber.java - 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

File OnSubscribePublishMulticast.java has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright 2016 Netflix, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
Severity: Minor
Found in src/main/java/rx/internal/operators/OnSubscribePublishMulticast.java - About 3 hrs to fix

    File CachedObservable.java has 296 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Copyright 2014 Netflix, Inc.
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
    Severity: Minor
    Found in src/main/java/rx/internal/operators/CachedObservable.java - About 3 hrs to fix

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

          @Override
          public Subscriber<? super T> call(final Subscriber<? super T> child) {
              final AtomicLong requested = new AtomicLong();
      
              child.setProducer(new Producer() {
      Severity: Minor
      Found in src/main/java/rx/internal/operators/OperatorOnBackpressureDrop.java - 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 assertCapacity has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

              private boolean assertCapacity() {
                  if (capacity == null) {
                      return true;
                  }
      
      
      Severity: Minor
      Found in src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java - 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 drain has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              @Override
              public void drain(ReplayProducer<T> rp) {
                  if (rp.getAndIncrement() != 0) {
                      return;
                  }
      Severity: Major
      Found in src/main/java/rx/subjects/ReplaySubject.java - About 3 hrs to fix

        Method setup has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Setup
            public void setup() {
                scalar = Observable.just(1);
                one = Observable.unsafeCreate(new OnSubscribe<Integer>() {
                    @Override
        Severity: Major
        Found in src/perf/java/rx/OneItemPerf.java - About 3 hrs to fix

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

              @Override
              public Subscriber<? super T> call(final Subscriber<? super R> child) {
                  final R initialValue = initialValueFactory.call();
          
                  if (initialValue == NO_INITIAL_VALUE) {
          Severity: Minor
          Found in src/main/java/rx/internal/operators/OperatorScan.java - 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 request has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

                  @Override
                  public void request(long n) {
                      if (n >= 0) {
                          for (;;) {
                              long r = get();
          Severity: Minor
          Found in src/main/java/rx/internal/operators/OperatorOnBackpressureLatest.java - 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 onNext has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public void onNext(T t) {
                  if (terminated) {
                      return;
                  }
          Severity: Minor
          Found in src/main/java/rx/observers/SerializedObserver.java - 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

          File BlockingObservable.java has 286 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * Copyright 2014 Netflix, Inc.
           *
           * Licensed under the Apache License, Version 2.0 (the "License");
           * you may not use this file except in compliance with the License.
          Severity: Minor
          Found in src/main/java/rx/observables/BlockingObservable.java - About 2 hrs to fix

            Method drain has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    void drain() {
                        boolean localInnerActive;
                        long localRequested;
                        Throwable localError;
                        synchronized (this) {
            Severity: Major
            Found in src/main/java/rx/internal/operators/OperatorSwitch.java - About 2 hrs to fix

              Method drain has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      void drain() {
                          if (wip.getAndIncrement() != 0) {
                              return;
                          }
              
              
              Severity: Major
              Found in src/main/java/rx/internal/operators/OnSubscribeConcatMap.java - About 2 hrs to fix

                File OnSubscribeGroupJoin.java has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * Copyright 2014 Netflix, Inc.
                 *
                 * Licensed under the Apache License, Version 2.0 (the "License");
                 * you may not use this file except in compliance with the License.
                Severity: Minor
                Found in src/main/java/rx/internal/operators/OnSubscribeGroupJoin.java - About 2 hrs to fix

                  Method call has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public Subscriber<? super T> call(final Subscriber<? super T> child) {
                          final ProducerArbiter pa = new ProducerArbiter();
                  
                          final SerialSubscription serial = new SerialSubscription();

                    Method drain has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                            void drain() {
                                AtomicInteger dw = drainWip;
                                if (dw.getAndIncrement() != 0) {
                                    return;
                                }
                    Severity: Minor
                    Found in src/main/java/rx/internal/operators/OperatorWindowWithSize.java - 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 call has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                        @Override
                        public Subscriber<? super T> call(final Subscriber<? super T> child) {
                            final ProducerArbiter pa = new ProducerArbiter();
                    
                            final SerialSubscription serial = new SerialSubscription();

                    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 manageRequests has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            void manageRequests(InnerProducer<T> inner) {
                                // if the upstream has completed, no more requesting is possible
                                if (isUnsubscribed()) {
                                    return;
                                }
                    Severity: Major
                    Found in src/main/java/rx/internal/operators/OperatorReplay.java - About 2 hrs to fix

                      Method drain has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public void drain() {
                              boolean term;
                              synchronized (this) {
                                  if (emitting) {
                                      return;
                      Severity: Major
                      Found in src/main/java/rx/internal/util/BackpressureDrainManager.java - About 2 hrs to fix

                        Method replay has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                @Override
                                public final void replay(InnerProducer<T> output) {
                                    synchronized (output) {
                                        if (output.emitting) {
                                            output.missed = true;
                        Severity: Major
                        Found in src/main/java/rx/internal/operators/OperatorReplay.java - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language