The following issues were found

src/test/java/io/reactivex/rxjava3/internal/disposables/ListCompositeDisposableTest.java
91 issues
This class has too many methods, consider refactoring it.
Design

Line: 27

              import io.reactivex.rxjava3.exceptions.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ListCompositeDisposableTest extends RxJavaTest {

    @Test
    public void constructorAndAddVarargs() {
        Disposable d1 = Disposable.empty();
        Disposable d2 = Disposable.empty();

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 30

              public class ListCompositeDisposableTest extends RxJavaTest {

    @Test
    public void constructorAndAddVarargs() {
        Disposable d1 = Disposable.empty();
        Disposable d2 = Disposable.empty();

        ListCompositeDisposable lcd = new ListCompositeDisposable(d1, d2);


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 38

              
        lcd.clear();

        assertFalse(lcd.isDisposed());

        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());

        d1 = Disposable.empty();

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 40

              
        assertFalse(lcd.isDisposed());

        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());

        d1 = Disposable.empty();
        d2 = Disposable.empty();


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 40

              
        assertFalse(lcd.isDisposed());

        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());

        d1 = Disposable.empty();
        d2 = Disposable.empty();


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 41

                      assertFalse(lcd.isDisposed());

        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());

        d1 = Disposable.empty();
        d2 = Disposable.empty();

        lcd.addAll(d1, d2);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

                      assertFalse(lcd.isDisposed());

        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());

        d1 = Disposable.empty();
        d2 = Disposable.empty();

        lcd.addAll(d1, d2);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 50

              
        lcd.dispose();

        assertTrue(lcd.isDisposed());
        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 51

                      lcd.dispose();

        assertTrue(lcd.isDisposed());
        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());
    }

    @Test
    public void constructorIterable() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 51

                      lcd.dispose();

        assertTrue(lcd.isDisposed());
        assertTrue(d1.isDisposed());
        assertTrue(d2.isDisposed());
    }

    @Test
    public void constructorIterable() {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableDistinctUntilChangedTest.java
90 issues
Avoid throwing raw exception types.
Design

Line: 185

                  private static final Function<String, String> THROWS_NON_FATAL = new Function<String, String>() {
        @Override
        public String apply(String s) {
            throw new RuntimeException();
        }
    };

    @Test
    public void distinctUntilChangedWhenNonFatalExceptionThrownByKeySelectorIsNotReportedByUpstream() {

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.internal.operators.flowable;

import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;

import java.io.IOException;

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 38

              import io.reactivex.rxjava3.subscribers.TestSubscriber;
import io.reactivex.rxjava3.testsupport.*;

public class FlowableDistinctUntilChangedTest extends RxJavaTest {

    Subscriber<String> w;
    Subscriber<String> w2;

    // nulls lead to exceptions

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 40

              
public class FlowableDistinctUntilChangedTest extends RxJavaTest {

    Subscriber<String> w;
    Subscriber<String> w2;

    // nulls lead to exceptions
    final Function<String, String> TO_UPPER_WITH_EXCEPTION = new Function<String, String>() {
        @Override

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 41

              public class FlowableDistinctUntilChangedTest extends RxJavaTest {

    Subscriber<String> w;
    Subscriber<String> w2;

    // nulls lead to exceptions
    final Function<String, String> TO_UPPER_WITH_EXCEPTION = new Function<String, String>() {
        @Override
        public String apply(String s) {

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 44

                  Subscriber<String> w2;

    // nulls lead to exceptions
    final Function<String, String> TO_UPPER_WITH_EXCEPTION = new Function<String, String>() {
        @Override
        public String apply(String s) {
            if (s.equals("x")) {
                return "xx";
            }

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 47

                  final Function<String, String> TO_UPPER_WITH_EXCEPTION = new Function<String, String>() {
        @Override
        public String apply(String s) {
            if (s.equals("x")) {
                return "xx";
            }
            return s.toUpperCase();
        }
    };

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 47

                  final Function<String, String> TO_UPPER_WITH_EXCEPTION = new Function<String, String>() {
        @Override
        public String apply(String s) {
            if (s.equals("x")) {
                return "xx";
            }
            return s.toUpperCase();
        }
    };

            

Reported by PMD.

When doing a String.toLowerCase()/toUpperCase() call, use a Locale
Error

Line: 50

                          if (s.equals("x")) {
                return "xx";
            }
            return s.toUpperCase();
        }
    };

    @Before
    public void before() {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 63

                  @Test
    public void distinctUntilChangedOfNone() {
        Flowable<String> src = Flowable.empty();
        src.distinctUntilChanged().subscribe(w);

        verify(w, never()).onNext(anyString());
        verify(w, never()).onError(any(Throwable.class));
        verify(w, times(1)).onComplete();
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/validators/BaseTypeAnnotations.java
90 issues
System.out.println is used
Design

Line: 79

                      }

        if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }

            

Reported by PMD.

System.out.println is used
Design

Line: 80

              
        if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }
    }

            

Reported by PMD.

System.out.println is used
Design

Line: 81

                      if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }
    }


            

Reported by PMD.

System.out.println is used
Design

Line: 127

                      }

        if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }

            

Reported by PMD.

System.out.println is used
Design

Line: 128

              
        if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }
    }

            

Reported by PMD.

System.out.println is used
Design

Line: 129

                      if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }
    }


            

Reported by PMD.

System.out.println is used
Design

Line: 182

                      }

        if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }

            

Reported by PMD.

System.out.println is used
Design

Line: 183

              
        if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }
    }

            

Reported by PMD.

System.out.println is used
Design

Line: 184

                      if (b.length() != 0) {
            System.out.println(clazz);
            System.out.println("------------------------");
            System.out.println(b);

            fail(b.toString());
        }
    }


            

Reported by PMD.

High amount of different objects as members denotes a high coupling
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.validators;

import static org.junit.Assert.fail;

import java.lang.reflect.*;


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/observers/ResourceMaybeObserverTest.java
90 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 31

              
public class ResourceMaybeObserverTest extends RxJavaTest {
    static final class TestResourceMaybeObserver<T> extends ResourceMaybeObserver<T> {
        T value;

        final List<Throwable> errors = new ArrayList<>();

        int complete;


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 33

                  static final class TestResourceMaybeObserver<T> extends ResourceMaybeObserver<T> {
        T value;

        final List<Throwable> errors = new ArrayList<>();

        int complete;

        int start;


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 35

              
        final List<Throwable> errors = new ArrayList<>();

        int complete;

        int start;

        @Override
        protected void onStart() {

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 37

              
        int complete;

        int start;

        @Override
        protected void onStart() {
            super.onStart();


            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 75

                  }

    @Test
    public void addResources() {
        TestResourceMaybeObserver<Integer> rmo = new TestResourceMaybeObserver<>();

        assertFalse(rmo.isDisposed());

        Disposable d = Disposable.empty();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 78

                  public void addResources() {
        TestResourceMaybeObserver<Integer> rmo = new TestResourceMaybeObserver<>();

        assertFalse(rmo.isDisposed());

        Disposable d = Disposable.empty();

        rmo.add(d);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 84

              
        rmo.add(d);

        assertFalse(d.isDisposed());

        rmo.dispose();

        assertTrue(rmo.isDisposed());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 84

              
        rmo.add(d);

        assertFalse(d.isDisposed());

        rmo.dispose();

        assertTrue(rmo.isDisposed());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 88

              
        rmo.dispose();

        assertTrue(rmo.isDisposed());

        assertTrue(d.isDisposed());

        rmo.dispose();


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 90

              
        assertTrue(rmo.isDisposed());

        assertTrue(d.isDisposed());

        rmo.dispose();

        assertTrue(rmo.isDisposed());


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableOnErrorResumeNextViaFunctionTest.java
90 issues
Avoid throwing raw exception types.
Design

Line: 127

              
            @Override
            public Flowable<String> apply(Throwable t1) {
                throw new RuntimeException("exception from function");
            }

        };
        Flowable<String> flowable = Flowable.unsafeCreate(w).onErrorResumeNext(resume);


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 161

                          @Override
            public String apply(String s) {
                if ("fail".equals(s)) {
                    throw new RuntimeException("Forced Failure");
                }
                System.out.println("BadMapper:" + s);
                return s;
            }
        });

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 215

                                          System.out.println("TestFlowable onNext: " + s);
                            subscriber.onNext(s);
                        }
                        throw new RuntimeException("Forced Failure");
                    } catch (Throwable e) {
                        subscriber.onError(e);
                    }
                }


            

Reported by PMD.

System.out.println is used
Design

Line: 163

                              if ("fail".equals(s)) {
                    throw new RuntimeException("Forced Failure");
                }
                System.out.println("BadMapper:" + s);
                return s;
            }
        });

        Flowable<String> flowable = w.onErrorResumeNext(new Function<Throwable, Flowable<String>>() {

            

Reported by PMD.

System.out.println is used
Design

Line: 203

              
        @Override
        public void subscribe(final Subscriber<? super String> subscriber) {
            System.out.println("TestFlowable subscribed to ...");
            subscriber.onSubscribe(new BooleanSubscription());
            t = new Thread(new Runnable() {

                @Override
                public void run() {

            

Reported by PMD.

System.out.println is used
Design

Line: 210

                              @Override
                public void run() {
                    try {
                        System.out.println("running TestFlowable thread");
                        for (String s : values) {
                            System.out.println("TestFlowable onNext: " + s);
                            subscriber.onNext(s);
                        }
                        throw new RuntimeException("Forced Failure");

            

Reported by PMD.

System.out.println is used
Design

Line: 212

                                  try {
                        System.out.println("running TestFlowable thread");
                        for (String s : values) {
                            System.out.println("TestFlowable onNext: " + s);
                            subscriber.onNext(s);
                        }
                        throw new RuntimeException("Forced Failure");
                    } catch (Throwable e) {
                        subscriber.onError(e);

            

Reported by PMD.

System.out.println is used
Design

Line: 222

                              }

            });
            System.out.println("starting TestFlowable thread");
            t.start();
            System.out.println("done starting TestFlowable thread");
        }

    }

            

Reported by PMD.

System.out.println is used
Design

Line: 224

                          });
            System.out.println("starting TestFlowable thread");
            t.start();
            System.out.println("done starting TestFlowable thread");
        }

    }

    @Test

            

Reported by PMD.

The String literal 'one' appears 8 times in this file; the first occurrence is on line 48
Error

Line: 48

                          @Override
            public void subscribe(Subscriber<? super String> subscriber) {
                subscriber.onSubscribe(new BooleanSubscription());
                subscriber.onNext("one");
                subscriber.onError(new Throwable("injected failure"));
                subscriber.onNext("two");
                subscriber.onNext("three");
            }
        });

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/core/Single.java
90 issues
Avoid throwing null pointer exceptions.
Design

Line: 4862

                          Exceptions.throwIfFatal(ex);
            NullPointerException npe = new NullPointerException("subscribeActual failed");
            npe.initCause(ex);
            throw npe;
        }
    }

    /**
     * Implement this method in subclasses to handle the incoming {@link SingleObserver}s.

            

Reported by PMD.

Avoid reassigning parameters such as 'observer'
Design

Line: 4847

              
    @SchedulerSupport(SchedulerSupport.NONE)
    @Override
    public final void subscribe(@NonNull SingleObserver<? super T> observer) {
        Objects.requireNonNull(observer, "observer is null");

        observer = RxJavaPlugins.onSubscribe(this, observer);

        Objects.requireNonNull(observer, "The RxJavaPlugins.onSubscribe hook returned a null SingleObserver. Please check the handler provided to RxJavaPlugins.setOnSingleSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 14

               * the License for the specific language governing permissions and limitations under the License.
 */

package io.reactivex.rxjava3.core;

import java.util.*;
import java.util.concurrent.*;
import java.util.stream.*;


            

Reported by PMD.

Possible God Class (WMC=201, ATFD=29, TCC=0.000%)
Design

Line: 116

               * @since 2.0
 * @see io.reactivex.rxjava3.observers.DisposableSingleObserver
 */
public abstract class Single<@NonNull T> implements SingleSource<T> {

    /**
     * Runs multiple {@link SingleSource}s and signals the events of the first one that signals (disposing
     * the rest).
     * <p>

            

Reported by PMD.

Avoid really long classes.
Design

Line: 116

               * @since 2.0
 * @see io.reactivex.rxjava3.observers.DisposableSingleObserver
 */
public abstract class Single<@NonNull T> implements SingleSource<T> {

    /**
     * Runs multiple {@link SingleSource}s and signals the events of the first one that signals (disposing
     * the rest).
     * <p>

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 116

               * @since 2.0
 * @see io.reactivex.rxjava3.observers.DisposableSingleObserver
 */
public abstract class Single<@NonNull T> implements SingleSource<T> {

    /**
     * Runs multiple {@link SingleSource}s and signals the events of the first one that signals (disposing
     * the rest).
     * <p>

            

Reported by PMD.

The class 'Single' has a total cyclomatic complexity of 201 (highest 5).
Design

Line: 116

               * @since 2.0
 * @see io.reactivex.rxjava3.observers.DisposableSingleObserver
 */
public abstract class Single<@NonNull T> implements SingleSource<T> {

    /**
     * Runs multiple {@link SingleSource}s and signals the events of the first one that signals (disposing
     * the rest).
     * <p>

            

Reported by PMD.

The String literal 'sources is null' appears 10 times in this file; the first occurrence is on line 138
Error

Line: 138

                  @NonNull
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <@NonNull T> Single<T> amb(@NonNull Iterable<@NonNull ? extends SingleSource<? extends T>> sources) {
        Objects.requireNonNull(sources, "sources is null");
        return RxJavaPlugins.onAssembly(new SingleAmb<>(null, sources));
    }

    /**
     * Runs multiple {@link SingleSource}s and signals the events of the first one that signals (disposing

            

Reported by PMD.

Avoid using Literals in Conditional Statements
Error

Line: 167

                      if (sources.length == 0) {
            return error(SingleInternalHelper.emptyThrower());
        }
        if (sources.length == 1) {
            @SuppressWarnings("unchecked")
            SingleSource<T> source = (SingleSource<T>)sources[0];
            return wrap(source);
        }
        return RxJavaPlugins.onAssembly(new SingleAmb<>(sources, null));

            

Reported by PMD.

The String literal 'unchecked' appears 6 times in this file; the first occurrence is on line 168
Error

Line: 168

                          return error(SingleInternalHelper.emptyThrower());
        }
        if (sources.length == 1) {
            @SuppressWarnings("unchecked")
            SingleSource<T> source = (SingleSource<T>)sources[0];
            return wrap(source);
        }
        return RxJavaPlugins.onAssembly(new SingleAmb<>(sources, null));
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableMergeWithMaybeTest.java
89 issues
This class has too many methods, consider refactoring it.
Design

Line: 33

              import io.reactivex.rxjava3.subjects.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class ObservableMergeWithMaybeTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 5)
        .mergeWith(Maybe.just(100))

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 36

              public class ObservableMergeWithMaybeTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 5)
        .mergeWith(Maybe.just(100))
        .test()
        .assertResult(1, 2, 3, 4, 5, 100);
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void normal() {
        Observable.range(1, 5)
        .mergeWith(Maybe.just(100))
        .test()
        .assertResult(1, 2, 3, 4, 5, 100);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void normal() {
        Observable.range(1, 5)
        .mergeWith(Maybe.just(100))
        .test()
        .assertResult(1, 2, 3, 4, 5, 100);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 37

              
    @Test
    public void normal() {
        Observable.range(1, 5)
        .mergeWith(Maybe.just(100))
        .test()
        .assertResult(1, 2, 3, 4, 5, 100);
    }


            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 44

                  }

    @Test
    public void emptyOther() {
        Observable.range(1, 5)
        .mergeWith(Maybe.<Integer>empty())
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

              
    @Test
    public void emptyOther() {
        Observable.range(1, 5)
        .mergeWith(Maybe.<Integer>empty())
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

              
    @Test
    public void emptyOther() {
        Observable.range(1, 5)
        .mergeWith(Maybe.<Integer>empty())
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 45

              
    @Test
    public void emptyOther() {
        Observable.range(1, 5)
        .mergeWith(Maybe.<Integer>empty())
        .test()
        .assertResult(1, 2, 3, 4, 5);
    }


            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 52

                  }

    @Test
    public void normalLong() {
        Observable.range(1, 512)
        .mergeWith(Maybe.just(100))
        .test()
        .assertValueCount(513)
        .assertComplete();

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableGroupBy.java
89 issues
Avoid reassigning parameters such as 'emitted'
Design

Line: 588

                          }
        }

        void cleanupQueue(long emitted, boolean polled) {
            // if this group is canceled, all accumulated emissions and
            // remaining items in the queue should be requested
            // so that other groups can proceed
            while (queue.poll() != null) {
                emitted++;

            

Reported by PMD.

Avoid reassigning parameters such as 'emitted'
Design

Line: 599

                          replenishParent(emitted, polled);
        }

        void replenishParent(long emitted, boolean polled) {
            if (polled) {
                emitted++;
            }
            if (emitted != 0L) {
                requestParent(emitted);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 33

              import io.reactivex.rxjava3.plugins.RxJavaPlugins;

public final class FlowableGroupBy<T, K, V> extends AbstractFlowableWithUpstream<T, GroupedFlowable<K, V>> {
    final Function<? super T, ? extends K> keySelector;
    final Function<? super T, ? extends V> valueSelector;
    final int bufferSize;
    final boolean delayError;
    final Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory;


            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 34

              
public final class FlowableGroupBy<T, K, V> extends AbstractFlowableWithUpstream<T, GroupedFlowable<K, V>> {
    final Function<? super T, ? extends K> keySelector;
    final Function<? super T, ? extends V> valueSelector;
    final int bufferSize;
    final boolean delayError;
    final Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory;

    public FlowableGroupBy(Flowable<T> source, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector,

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 35

              public final class FlowableGroupBy<T, K, V> extends AbstractFlowableWithUpstream<T, GroupedFlowable<K, V>> {
    final Function<? super T, ? extends K> keySelector;
    final Function<? super T, ? extends V> valueSelector;
    final int bufferSize;
    final boolean delayError;
    final Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory;

    public FlowableGroupBy(Flowable<T> source, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector,
            int bufferSize, boolean delayError, Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory) {

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 36

                  final Function<? super T, ? extends K> keySelector;
    final Function<? super T, ? extends V> valueSelector;
    final int bufferSize;
    final boolean delayError;
    final Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory;

    public FlowableGroupBy(Flowable<T> source, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector,
            int bufferSize, boolean delayError, Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory) {
        super(source);

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 37

                  final Function<? super T, ? extends V> valueSelector;
    final int bufferSize;
    final boolean delayError;
    final Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory;

    public FlowableGroupBy(Flowable<T> source, Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector,
            int bufferSize, boolean delayError, Function<? super Consumer<Object>, ? extends Map<K, Object>> mapFactory) {
        super(source);
        this.keySelector = keySelector;

            

Reported by PMD.

A catch statement should never catch throwable since it includes errors.
Error

Line: 65

                              Consumer<Object> evictionAction = (Consumer) new EvictionAction<>(evictedGroups);
                groups = (Map) mapFactory.apply(evictionAction);
            }
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            s.onSubscribe(EmptyComponent.INSTANCE);
            s.onError(e);
            return;
        }

            

Reported by PMD.

The class 'GroupBySubscriber' has a Standard Cyclomatic Complexity of 4 (Highest = 12).
Design

Line: 76

                      source.subscribe(subscriber);
    }

    public static final class GroupBySubscriber<T, K, V>
    extends AtomicLong
    implements FlowableSubscriber<T>, Subscription {

        private static final long serialVersionUID = -3688291656102519502L;


            

Reported by PMD.

The class 'GroupBySubscriber' has a Modified Cyclomatic Complexity of 4 (Highest = 12).
Design

Line: 76

                      source.subscribe(subscriber);
    }

    public static final class GroupBySubscriber<T, K, V>
    extends AtomicLong
    implements FlowableSubscriber<T>, Subscription {

        private static final long serialVersionUID = -3688291656102519502L;


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeBlockingSubscribeTest.java
87 issues
This class has too many methods, consider refactoring it.
Design

Line: 31

              import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class MaybeBlockingSubscribeTest {

    @Test
    public void noArgSuccess() {
        Maybe.just(1)
        .blockingSubscribe();

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 34

              public class MaybeBlockingSubscribeTest {

    @Test
    public void noArgSuccess() {
        Maybe.just(1)
        .blockingSubscribe();
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 35

              
    @Test
    public void noArgSuccess() {
        Maybe.just(1)
        .blockingSubscribe();
    }

    @Test
    public void noArgSuccessAsync() {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 40

                  }

    @Test
    public void noArgSuccessAsync() {
        Maybe.just(1)
        .delay(100, TimeUnit.MILLISECONDS)
        .blockingSubscribe();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 41

              
    @Test
    public void noArgSuccessAsync() {
        Maybe.just(1)
        .delay(100, TimeUnit.MILLISECONDS)
        .blockingSubscribe();
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 41

              
    @Test
    public void noArgSuccessAsync() {
        Maybe.just(1)
        .delay(100, TimeUnit.MILLISECONDS)
        .blockingSubscribe();
    }

    @Test

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 47

                  }

    @Test
    public void noArgEmpty() {
        Maybe.empty()
        .blockingSubscribe();
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 48

              
    @Test
    public void noArgEmpty() {
        Maybe.empty()
        .blockingSubscribe();
    }

    @Test
    public void noArgEmptyAsync() {

            

Reported by PMD.

JUnit tests should include assert() or fail()
Design

Line: 53

                  }

    @Test
    public void noArgEmptyAsync() {
        Maybe.empty()
        .delay(100, TimeUnit.MILLISECONDS)
        .blockingSubscribe();
    }


            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 54

              
    @Test
    public void noArgEmptyAsync() {
        Maybe.empty()
        .delay(100, TimeUnit.MILLISECONDS)
        .blockingSubscribe();
    }

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/BlockingObservableNextTest.java
87 issues
System.out.println is used
Design

Line: 301

              
                assertFalse(it.hasNext());

                System.out.println("a: " + a + " b: " + b + " c: " + c);
                break;
            } catch (AssertionError ex) {
                if (++repeat == 3) {
                    throw ex;
                }

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 35

              import io.reactivex.rxjava3.subjects.*;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class BlockingObservableNextTest extends RxJavaTest {

    private void fireOnNextInNewThread(final Subject<String> o, final String value) {
        new Thread() {
            @Override
            public void run() {

            

Reported by PMD.

Unit tests should not contain more than 1 assert(s).
Design

Line: 70

                  }

    @Test
    public void next() {
        Subject<String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertTrue(it.hasNext());
        assertEquals("one", it.next());

            

Reported by PMD.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 72

                  @Test
    public void next() {
        Subject<String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertTrue(it.hasNext());
        assertEquals("one", it.next());

        fireOnNextInNewThread(obs, "two");

            

Reported by PMD.

The String literal 'one' appears 8 times in this file; the first occurrence is on line 73
Error

Line: 73

                  public void next() {
        Subject<String> obs = PublishSubject.create();
        Iterator<String> it = next(obs).iterator();
        fireOnNextInNewThread(obs, "one");
        assertTrue(it.hasNext());
        assertEquals("one", it.next());

        fireOnNextInNewThread(obs, "two");
        assertTrue(it.hasNext());

            

Reported by PMD.

The String literal 'two' appears 4 times in this file; the first occurrence is on line 77
Error

Line: 77

                      assertTrue(it.hasNext());
        assertEquals("one", it.next());

        fireOnNextInNewThread(obs, "two");
        assertTrue(it.hasNext());
        assertEquals("two", it.next());

        fireOnNextInNewThread(obs, "three");
        try {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 88

                          fail("Calling next() without hasNext() should wait for next fire");
        }

        obs.onComplete();
        assertFalse(it.hasNext());
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {

            

Reported by PMD.

The String literal 'At the end of an iterator should throw a NoSuchElementException' appears 6 times in this file; the first occurrence is on line 92
Error

Line: 92

                      assertFalse(it.hasNext());
        try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }

        // If the Observable is completed, hasNext always returns false and next always throw a NoSuchElementException.
        assertFalse(it.hasNext());

            

Reported by PMD.

Avoid empty catch blocks
Error

Line: 93

                      try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }

        // If the Observable is completed, hasNext always returns false and next always throw a NoSuchElementException.
        assertFalse(it.hasNext());
        try {

            

Reported by PMD.

Avoid empty catch blocks
Error

Line: 101

                      try {
            it.next();
            fail("At the end of an iterator should throw a NoSuchElementException");
        } catch (NoSuchElementException e) {
        }
    }

    @Test
    public void nextWithError() {

            

Reported by PMD.