ReactiveX/RxJava

View on GitHub

Showing 657 of 1,068 total issues

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

    private void drain() {
        if (wip.getAndIncrement() == 0) {
            final Subscriber<? super T> c = child;
            final Queue<Object> q = queue;
            do {
Severity: Minor
Found in src/main/java/rx/internal/producers/QueuedValueProducer.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 a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    private void drain() {
        if (wip.getAndIncrement() == 0) {
            final Subscriber<? super T> c = child;
            final Queue<Object> q = queue;

Severity: Minor
Found in src/main/java/rx/internal/producers/QueuedProducer.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 emitLoop has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    void emitLoop() {
        final Subscriber<? super T> c = child;

        long toRequest = 0L;
        Producer requestFrom = null;
Severity: Major
Found in src/main/java/rx/internal/producers/ProducerObserverArbiter.java - About 3 hrs to fix

    File OnSubscribeCombineLatest.java has 328 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Copyright 2015 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 the License at
    Severity: Minor
    Found in src/main/java/rx/internal/operators/OnSubscribeCombineLatest.java - About 3 hrs to fix

      Method amb has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static Completable amb(final Iterable<? extends Completable> sources) {
              requireNonNull(sources);
      
              return create(new OnSubscribe() {
                  @Override
      Severity: Major
      Found in src/main/java/rx/Completable.java - About 3 hrs to fix

        OnSubscribeRedo has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public final class OnSubscribeRedo<T> implements OnSubscribe<T> {
            final Observable<T> source;
            private final Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> controlHandlerFunction;
            final boolean stopOnComplete;
            final boolean stopOnError;
        Severity: Minor
        Found in src/main/java/rx/internal/operators/OnSubscribeRedo.java - About 3 hrs to fix

          OneItemPerf has 31 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @BenchmarkMode(Mode.Throughput)
          @OutputTimeUnit(TimeUnit.SECONDS)
          @State(Scope.Thread)
          public class OneItemPerf {
          
          
          Severity: Minor
          Found in src/perf/java/rx/OneItemPerf.java - About 3 hrs to fix

            Method drain has 94 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/OnSubscribeFlattenIterable.java - About 3 hrs to fix

              File TestSubscriber.java has 323 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/observers/TestSubscriber.java - About 3 hrs to fix

                Method emitLoop has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void emitLoop() {
                        for (;;) {
                            long localRequested;
                            long localProduced;
                            Producer localProducer;
                Severity: Minor
                Found in src/main/java/rx/internal/producers/ProducerArbiter.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 tryEnableCancelPolicy has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static boolean tryEnableCancelPolicy(ScheduledExecutorService executor) {
                        if (SHOULD_TRY_ENABLE_CANCEL_POLICY) { // NOPMD
                            final boolean isInstanceOfScheduledThreadPoolExecutor = executor instanceof ScheduledThreadPoolExecutor;
                
                            Method methodToCall;
                Severity: Minor
                Found in src/main/java/rx/internal/schedulers/NewThreadWorker.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 dispatch has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        void dispatch() {
                            // standard construct of emitter loop (blocking)
                            // if there is an emission going on, indicate that more work needs to be done
                            // the exact nature of this work needs to be determined from other data structures
                            synchronized (this) {
                Severity: Major
                Found in src/main/java/rx/internal/operators/OperatorPublish.java - About 3 hrs to fix

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

                      @Override
                      public void call(final CompletableSubscriber s) {
                          final CompositeSubscription set = new CompositeSubscription();
                  
                          s.onSubscribe(set);

                    AtomicPerf has 30 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    @BenchmarkMode(Mode.Throughput)
                    @OutputTimeUnit(TimeUnit.SECONDS)
                    public class AtomicPerf {
                        @State(Scope.Thread)
                        public static class Times {
                    Severity: Minor
                    Found in src/perf/java/rx/internal/AtomicPerf.java - About 3 hrs to fix

                      File OperatorSwitch.java has 317 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. You may obtain a copy of
                      Severity: Minor
                      Found in src/main/java/rx/internal/operators/OperatorSwitch.java - About 3 hrs to fix

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

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

                          Method init has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @SuppressWarnings({ "rawtypes", "unchecked", "deprecation"})
                              static void init() {
                                  onError = new Action1<Throwable>() {
                                      @Override
                                      public void call(Throwable e) {
                          Severity: Major
                          Found in src/main/java/rx/plugins/RxJavaHooks.java - About 3 hrs to fix

                            Functions has 28 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public final class Functions {
                                private Functions() {
                                    throw new IllegalStateException("No instances!");
                                }
                            
                            
                            Severity: Minor
                            Found in src/main/java/rx/functions/Functions.java - About 3 hrs to fix

                              Method drain has 83 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/OnSubscribeFlatMapSingle.java - About 3 hrs to fix

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

                                        void drain() {
                                            if (getAndIncrement() != 0) {
                                                return;
                                            }
                                
                                
                                Severity: Minor
                                Found in src/main/java/rx/internal/operators/OnSubscribeCombineLatest.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

                                Severity
                                Category
                                Status
                                Source
                                Language