The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableDoOnEachTest.java
142 issues
Avoid throwing raw exception types.
Design

Line: 77

                          @Override
            public String apply(String s) {
                if ("fail".equals(s)) {
                    throw new RuntimeException("Forced Failure");
                }
                return s;
            }
        });


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 106

                          @Override
            public void accept(String s) {
                if ("fail".equals(s)) {
                    throw new RuntimeException("Forced Failure");
                }
            }
        });

        doOnEach.subscribe(subscribedObserver);

            

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.observable;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;


            

Reported by PMD.

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

Line: 37

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

public class ObservableDoOnEachTest extends RxJavaTest {

    Observer<String> subscribedObserver;
    Observer<String> sideEffectObserver;

    @Before

            

Reported by PMD.

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

Line: 39

              
public class ObservableDoOnEachTest extends RxJavaTest {

    Observer<String> subscribedObserver;
    Observer<String> sideEffectObserver;

    @Before
    public void before() {
        subscribedObserver = TestHelper.mockObserver();

            

Reported by PMD.

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

Line: 40

              public class ObservableDoOnEachTest extends RxJavaTest {

    Observer<String> subscribedObserver;
    Observer<String> sideEffectObserver;

    @Before
    public void before() {
        subscribedObserver = TestHelper.mockObserver();
        sideEffectObserver = TestHelper.mockObserver();

            

Reported by PMD.

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

Line: 51

                  @Test
    public void doOnEach() {
        Observable<String> base = Observable.just("a", "b", "c");
        Observable<String> doOnEach = base.doOnEach(sideEffectObserver);

        doOnEach.subscribe(subscribedObserver);

        // ensure the leaf Observer is still getting called
        verify(subscribedObserver, never()).onError(any(Throwable.class));

            

Reported by PMD.

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

Line: 53

                      Observable<String> base = Observable.just("a", "b", "c");
        Observable<String> doOnEach = base.doOnEach(sideEffectObserver);

        doOnEach.subscribe(subscribedObserver);

        // ensure the leaf Observer is still getting called
        verify(subscribedObserver, never()).onError(any(Throwable.class));
        verify(subscribedObserver, times(1)).onNext("a");
        verify(subscribedObserver, times(1)).onNext("b");

            

Reported by PMD.

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

Line: 56

                      doOnEach.subscribe(subscribedObserver);

        // ensure the leaf Observer is still getting called
        verify(subscribedObserver, never()).onError(any(Throwable.class));
        verify(subscribedObserver, times(1)).onNext("a");
        verify(subscribedObserver, times(1)).onNext("b");
        verify(subscribedObserver, times(1)).onNext("c");
        verify(subscribedObserver, times(1)).onComplete();


            

Reported by PMD.

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

Line: 57

              
        // ensure the leaf Observer is still getting called
        verify(subscribedObserver, never()).onError(any(Throwable.class));
        verify(subscribedObserver, times(1)).onNext("a");
        verify(subscribedObserver, times(1)).onNext("b");
        verify(subscribedObserver, times(1)).onNext("c");
        verify(subscribedObserver, times(1)).onComplete();

        // ensure our injected Observer is getting called

            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/subjects/ReplaySubject.java
140 issues
Avoid reassigning parameters such as 'array'
Design

Line: 703

              
        @Override
        @SuppressWarnings("unchecked")
        public T[] getValues(T[] array) {
            int s = size;
            if (s == 0) {
                if (array.length != 0) {
                    array[0] = null;
                }

            

Reported by PMD.

Avoid reassigning parameters such as 'array'
Design

Line: 944

              
        @Override
        @SuppressWarnings("unchecked")
        public T[] getValues(T[] array) {
            Node<Object> h = head;
            int s = size();

            if (s == 0) {
                if (array.length != 0) {

            

Reported by PMD.

Avoid reassigning parameters such as 'array'
Design

Line: 1234

              
        @Override
        @SuppressWarnings("unchecked")
        public T[] getValues(T[] array) {
            TimedNode<Object> h = getHead();
            int s = size(h);

            if (s == 0) {
                if (array.length != 0) {

            

Reported by PMD.

Avoid reassigning parameters such as 'h'
Design

Line: 1326

                          return size(getHead());
        }

        int size(TimedNode<Object> h) {
            int s = 0;
            while (s != Integer.MAX_VALUE) {
                TimedNode<Object> next = h.get();
                if (next == null) {
                    Object o = h.value;

            

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.subjects;

import java.lang.reflect.Array;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.*;

            

Reported by PMD.

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

Line: 134

               *
 * @param <T> the value type
 */
public final class ReplaySubject<T> extends Subject<T> {
    final ReplayBuffer<T> buffer;

    final AtomicReference<ReplayDisposable<T>[]> observers;

    @SuppressWarnings("rawtypes")

            

Reported by PMD.

Avoid really long classes.
Design

Line: 134

               *
 * @param <T> the value type
 */
public final class ReplaySubject<T> extends Subject<T> {
    final ReplayBuffer<T> buffer;

    final AtomicReference<ReplayDisposable<T>[]> observers;

    @SuppressWarnings("rawtypes")

            

Reported by PMD.

Possible God Class (WMC=48, ATFD=24, TCC=31.667%)
Design

Line: 134

               *
 * @param <T> the value type
 */
public final class ReplaySubject<T> extends Subject<T> {
    final ReplayBuffer<T> buffer;

    final AtomicReference<ReplayDisposable<T>[]> observers;

    @SuppressWarnings("rawtypes")

            

Reported by PMD.

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

Line: 135

               * @param <T> the value type
 */
public final class ReplaySubject<T> extends Subject<T> {
    final ReplayBuffer<T> buffer;

    final AtomicReference<ReplayDisposable<T>[]> observers;

    @SuppressWarnings("rawtypes")
    static final ReplayDisposable[] EMPTY = new ReplayDisposable[0];

            

Reported by PMD.

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

Line: 137

              public final class ReplaySubject<T> extends Subject<T> {
    final ReplayBuffer<T> buffer;

    final AtomicReference<ReplayDisposable<T>[]> observers;

    @SuppressWarnings("rawtypes")
    static final ReplayDisposable[] EMPTY = new ReplayDisposable[0];

    @SuppressWarnings("rawtypes")

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/SingleFlattenStreamAsObservableTest.java
140 issues
This class has too many methods, consider refactoring it.
Design

Line: 35

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

public class SingleFlattenStreamAsObservableTest extends RxJavaTest {

    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsObservable(Stream::of)

            

Reported by PMD.

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

Line: 38

              public class SingleFlattenStreamAsObservableTest extends RxJavaTest {

    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsObservable(Stream::of)
        .test()
        .assertResult(1);
    }

            

Reported by PMD.

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

Line: 39

              
    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsObservable(Stream::of)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 39

              
    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsObservable(Stream::of)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 39

              
    @Test
    public void successJust() {
        Single.just(1)
        .flattenStreamAsObservable(Stream::of)
        .test()
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 46

                  }

    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsObservable(v -> Stream.of())
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 47

              
    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsObservable(v -> Stream.of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 47

              
    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsObservable(v -> Stream.of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 47

              
    @Test
    public void successEmpty() {
        Single.just(1)
        .flattenStreamAsObservable(v -> Stream.of())
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 54

                  }

    @Test
    public void successMany() {
        Single.just(1)
        .flattenStreamAsObservable(v -> Stream.of(2, 3, 4, 5, 6))
        .test()
        .assertResult(2, 3, 4, 5, 6);
    }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/processors/UnicastProcessorTest.java
140 issues
This class has too many methods, consider refactoring it.
Design

Line: 36

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

public class UnicastProcessorTest extends FlowableProcessorTest<Object> {

    @Override
    protected FlowableProcessor<Object> create() {
        return UnicastProcessor.create();
    }

            

Reported by PMD.

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

Line: 44

                  }

    @Test
    public void fusionLive() {
        UnicastProcessor<Integer> ap = UnicastProcessor.create();

        TestSubscriberEx<Integer> ts = new TestSubscriberEx<Integer>().setInitialFusionMode(QueueFuseable.ANY);

        ap.subscribe(ts);

            

Reported by PMD.

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

Line: 49

              
        TestSubscriberEx<Integer> ts = new TestSubscriberEx<Integer>().setInitialFusionMode(QueueFuseable.ANY);

        ap.subscribe(ts);

        ts
        .assertFuseable()
        .assertFusionMode(QueueFuseable.ASYNC);


            

Reported by PMD.

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

Line: 51

              
        ap.subscribe(ts);

        ts
        .assertFuseable()
        .assertFusionMode(QueueFuseable.ASYNC);

        ts.assertNoValues().assertNoErrors().assertNotComplete();


            

Reported by PMD.

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

Line: 55

                      .assertFuseable()
        .assertFusionMode(QueueFuseable.ASYNC);

        ts.assertNoValues().assertNoErrors().assertNotComplete();

        ap.onNext(1);

        ts.assertValue(1).assertNoErrors().assertNotComplete();


            

Reported by PMD.

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

Line: 55

                      .assertFuseable()
        .assertFusionMode(QueueFuseable.ASYNC);

        ts.assertNoValues().assertNoErrors().assertNotComplete();

        ap.onNext(1);

        ts.assertValue(1).assertNoErrors().assertNotComplete();


            

Reported by PMD.

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

Line: 57

              
        ts.assertNoValues().assertNoErrors().assertNotComplete();

        ap.onNext(1);

        ts.assertValue(1).assertNoErrors().assertNotComplete();

        ap.onComplete();


            

Reported by PMD.

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

Line: 59

              
        ap.onNext(1);

        ts.assertValue(1).assertNoErrors().assertNotComplete();

        ap.onComplete();

        ts.assertResult(1);
    }

            

Reported by PMD.

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

Line: 59

              
        ap.onNext(1);

        ts.assertValue(1).assertNoErrors().assertNotComplete();

        ap.onComplete();

        ts.assertResult(1);
    }

            

Reported by PMD.

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

Line: 61

              
        ts.assertValue(1).assertNoErrors().assertNotComplete();

        ap.onComplete();

        ts.assertResult(1);
    }

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableUsingTest.java
140 issues
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.completable;

import static org.junit.Assert.*;

import java.util.List;


            

Reported by PMD.

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

Line: 32

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

public class CompletableUsingTest extends RxJavaTest {

    @Test
    public void resourceSupplierThrows() {

        Completable.using(new Supplier<Object>() {

            

Reported by PMD.

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

Line: 35

              public class CompletableUsingTest extends RxJavaTest {

    @Test
    public void resourceSupplierThrows() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                throw new TestException();

            

Reported by PMD.

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

Line: 58

                  }

    @Test
    public void errorEager() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 81

                  }

    @Test
    public void emptyEager() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 104

                  }

    @Test
    public void errorNonEager() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 127

                  }

    @Test
    public void emptyNonEager() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 150

                  }

    @Test
    public void supplierCrashEager() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 173

                  }

    @Test
    public void supplierCrashNonEager() {

        Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 196

                  }

    @Test
    public void supplierAndDisposerCrashEager() {
        TestObserverEx<Void> to = Completable.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;
            }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeUsingTest.java
140 issues
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.maybe;

import static org.junit.Assert.*;

import java.util.List;


            

Reported by PMD.

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

Line: 32

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

public class MaybeUsingTest extends RxJavaTest {

    @Test
    public void resourceSupplierThrows() {

        Maybe.using(new Supplier<Object>() {

            

Reported by PMD.

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

Line: 35

              public class MaybeUsingTest extends RxJavaTest {

    @Test
    public void resourceSupplierThrows() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                throw new TestException();

            

Reported by PMD.

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

Line: 58

                  }

    @Test
    public void errorEager() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 81

                  }

    @Test
    public void emptyEager() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 104

                  }

    @Test
    public void errorNonEager() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 127

                  }

    @Test
    public void emptyNonEager() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 150

                  }

    @Test
    public void supplierCrashEager() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 173

                  }

    @Test
    public void supplierCrashNonEager() {

        Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;

            

Reported by PMD.

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

Line: 196

                  }

    @Test
    public void supplierAndDisposerCrashEager() {
        TestObserverEx<Integer> to = Maybe.using(new Supplier<Object>() {
            @Override
            public Object get() throws Exception {
                return 1;
            }

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableSequenceEqualTest.java
139 issues
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.isA;
import static org.mockito.Mockito.*;

import java.util.List;

            

Reported by PMD.

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

Line: 37

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

public class FlowableSequenceEqualTest extends RxJavaTest {

    @Test
    public void flowable1() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),

            

Reported by PMD.

Possible God Class (WMC=57, ATFD=19, TCC=0.000%)
Design

Line: 37

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

public class FlowableSequenceEqualTest extends RxJavaTest {

    @Test
    public void flowable1() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),

            

Reported by PMD.

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

Line: 41

              
    @Test
    public void flowable1() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),
                Flowable.just("one", "two", "three")).toFlowable();
        verifyResult(flowable, true);
    }


            

Reported by PMD.

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

Line: 42

                  @Test
    public void flowable1() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),
                Flowable.just("one", "two", "three")).toFlowable();
        verifyResult(flowable, true);
    }

    @Test

            

Reported by PMD.

The String literal 'three' appears 20 times in this file; the first occurrence is on line 42
Error

Line: 42

                  @Test
    public void flowable1() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),
                Flowable.just("one", "two", "three")).toFlowable();
        verifyResult(flowable, true);
    }

    @Test

            

Reported by PMD.

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

Line: 42

                  @Test
    public void flowable1() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),
                Flowable.just("one", "two", "three")).toFlowable();
        verifyResult(flowable, true);
    }

    @Test

            

Reported by PMD.

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

Line: 49

              
    @Test
    public void flowable2() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),
                Flowable.just("one", "two", "three", "four")).toFlowable();
        verifyResult(flowable, false);
    }


            

Reported by PMD.

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

Line: 51

                  public void flowable2() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three"),
                Flowable.just("one", "two", "three", "four")).toFlowable();
        verifyResult(flowable, false);
    }

    @Test
    public void flowable3() {

            

Reported by PMD.

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

Line: 57

              
    @Test
    public void flowable3() {
        Flowable<Boolean> flowable = Flowable.sequenceEqual(
                Flowable.just("one", "two", "three", "four"),
                Flowable.just("one", "two", "three")).toFlowable();
        verifyResult(flowable, false);
    }


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithStartEndObservableTest.java
139 issues
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.observable;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.*;

            

Reported by PMD.

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

Line: 38

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

public class ObservableWindowWithStartEndObservableTest extends RxJavaTest {

    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;

    @Before

            

Reported by PMD.

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

Line: 40

              
public class ObservableWindowWithStartEndObservableTest extends RxJavaTest {

    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;

    @Before
    public void before() {
        scheduler = new TestScheduler();

            

Reported by PMD.

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

Line: 41

              public class ObservableWindowWithStartEndObservableTest extends RxJavaTest {

    private TestScheduler scheduler;
    private Scheduler.Worker innerScheduler;

    @Before
    public void before() {
        scheduler = new TestScheduler();
        innerScheduler = scheduler.createWorker();

            

Reported by PMD.

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

Line: 50

                  }

    @Test
    public void observableBasedOpenerAndCloser() {
        final List<String> list = new ArrayList<>();
        final List<List<String>> lists = new ArrayList<>();

        Observable<String> source = Observable.unsafeCreate(new ObservableSource<String>() {
            @Override

            

Reported by PMD.

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

Line: 92

                      };

        Observable<Observable<String>> windowed = source.window(openings, closer);
        windowed.subscribe(observeWindow(list, lists));

        scheduler.advanceTimeTo(500, TimeUnit.MILLISECONDS);
        assertEquals(2, lists.size());
        assertEquals(lists.get(0), list("two", "three"));
        assertEquals(lists.get(1), list("five"));

            

Reported by PMD.

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

Line: 152

                  }

    @Test
    public void noUnsubscribeAndNoLeak() {
        PublishSubject<Integer> source = PublishSubject.create();

        PublishSubject<Integer> open = PublishSubject.create();
        final PublishSubject<Integer> close = PublishSubject.create();


            

Reported by PMD.

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

Line: 174

                      })
        .subscribe(to);

        open.onNext(1);
        source.onNext(1);

        assertTrue(open.hasObservers());
        assertTrue(close.hasObservers());


            

Reported by PMD.

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

Line: 175

                      .subscribe(to);

        open.onNext(1);
        source.onNext(1);

        assertTrue(open.hasObservers());
        assertTrue(close.hasObservers());

        close.onNext(1);

            

Reported by PMD.

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

Line: 177

                      open.onNext(1);
        source.onNext(1);

        assertTrue(open.hasObservers());
        assertTrue(close.hasObservers());

        close.onNext(1);

        assertFalse(close.hasObservers());

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/flowable/FlowableSubscriberTest.java
139 issues
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.flowable;

import static org.junit.Assert.*;

import java.util.*;
import java.util.concurrent.atomic.*;

            

Reported by PMD.

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

Line: 36

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

public class FlowableSubscriberTest {

    /**
     * Should request n for whatever the final Subscriber asks for.
     */
    @Test

            

Reported by PMD.

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

Line: 36

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

public class FlowableSubscriberTest {

    /**
     * Should request n for whatever the final Subscriber asks for.
     */
    @Test

            

Reported by PMD.

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

Line: 36

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

public class FlowableSubscriberTest {

    /**
     * Should request n for whatever the final Subscriber asks for.
     */
    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 59

                          }

        });
        assertEquals(10, r.get());
    }

    /**
     * Should request -1 for infinite.
     */

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 82

                          }

        });
        assertEquals(Long.MAX_VALUE, r.get());
    }

    @Test
    public void requestFromChainedOperator() throws Throwable {
        TestSubscriber<String> s = new TestSubscriber<>(10L);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 134

                          }

        });
        assertEquals(10, r.get());
    }

    @Test
    public void requestFromDecoupledOperator() throws Throwable {
        TestSubscriber<String> s = new TestSubscriber<>(0L);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 187

                          }

        });
        assertEquals(10, r.get());
    }

    @Test
    public void requestFromDecoupledOperatorThatRequestsN() throws Throwable {
        TestSubscriber<String> s = new TestSubscriber<>(10L);

            

Reported by PMD.

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

Line: 191

                  }

    @Test
    public void requestFromDecoupledOperatorThatRequestsN() throws Throwable {
        TestSubscriber<String> s = new TestSubscriber<>(10L);
        final AtomicLong innerR = new AtomicLong();
        FlowableOperator<String, String> o = new FlowableOperator<String, String>() {
            @Override
            public Subscriber<? super String> apply(Subscriber<? super String> child) {

            

Reported by PMD.

The method 'requestFromDecoupledOperatorThatRequestsN' has a Standard Cyclomatic Complexity of 10.
Design

Line: 191

                  }

    @Test
    public void requestFromDecoupledOperatorThatRequestsN() throws Throwable {
        TestSubscriber<String> s = new TestSubscriber<>(10L);
        final AtomicLong innerR = new AtomicLong();
        FlowableOperator<String, String> o = new FlowableOperator<String, String>() {
            @Override
            public Subscriber<? super String> apply(Subscriber<? super String> child) {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/mixed/ObservableSwitchMapCompletableTest.java
138 issues
This class has too many methods, consider refactoring it.
Design

Line: 32

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

public class ObservableSwitchMapCompletableTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 10)
        .switchMapCompletable(new Function<Integer, CompletableSource>() {

            

Reported by PMD.

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

Line: 35

              public class ObservableSwitchMapCompletableTest extends RxJavaTest {

    @Test
    public void normal() {
        Observable.range(1, 10)
        .switchMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();

            

Reported by PMD.

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

Line: 48

                  }

    @Test
    public void mainError() {
        Observable.<Integer>error(new TestException())
        .switchMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();

            

Reported by PMD.

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

Line: 61

                  }

    @Test
    public void innerError() {
        PublishSubject<Integer> ps = PublishSubject.create();
        CompletableSubject cs = CompletableSubject.create();

        TestObserver<Void> to = ps.switchMapCompletable(Functions.justFunction(cs))
        .test();

            

Reported by PMD.

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

Line: 65

                      PublishSubject<Integer> ps = PublishSubject.create();
        CompletableSubject cs = CompletableSubject.create();

        TestObserver<Void> to = ps.switchMapCompletable(Functions.justFunction(cs))
        .test();

        assertTrue(ps.hasObservers());
        assertFalse(cs.hasObservers());


            

Reported by PMD.

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

Line: 65

                      PublishSubject<Integer> ps = PublishSubject.create();
        CompletableSubject cs = CompletableSubject.create();

        TestObserver<Void> to = ps.switchMapCompletable(Functions.justFunction(cs))
        .test();

        assertTrue(ps.hasObservers());
        assertFalse(cs.hasObservers());


            

Reported by PMD.

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

Line: 68

                      TestObserver<Void> to = ps.switchMapCompletable(Functions.justFunction(cs))
        .test();

        assertTrue(ps.hasObservers());
        assertFalse(cs.hasObservers());

        ps.onNext(1);

        assertTrue(cs.hasObservers());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 68

                      TestObserver<Void> to = ps.switchMapCompletable(Functions.justFunction(cs))
        .test();

        assertTrue(ps.hasObservers());
        assertFalse(cs.hasObservers());

        ps.onNext(1);

        assertTrue(cs.hasObservers());

            

Reported by PMD.

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

Line: 69

                      .test();

        assertTrue(ps.hasObservers());
        assertFalse(cs.hasObservers());

        ps.onNext(1);

        assertTrue(cs.hasObservers());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 69

                      .test();

        assertTrue(ps.hasObservers());
        assertFalse(cs.hasObservers());

        ps.onNext(1);

        assertTrue(cs.hasObservers());


            

Reported by PMD.