The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeDelayTest.java
37 issues
JUnit tests should include assert() or fail()
Design

Line: 33

              public class MaybeDelayTest extends RxJavaTest {

    @Test
    public void success() {
        Maybe.just(1).delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult(1);
    }

            

Reported by PMD.

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

Line: 34

              
    @Test
    public void success() {
        Maybe.just(1).delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 34

              
    @Test
    public void success() {
        Maybe.just(1).delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 34

              
    @Test
    public void success() {
        Maybe.just(1).delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 34

              
    @Test
    public void success() {
        Maybe.just(1).delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult(1);
    }


            

Reported by PMD.

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

Line: 41

                  }

    @Test
    public void error() {
        Maybe.error(new TestException()).delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertFailure(TestException.class);
    }

            

Reported by PMD.

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

Line: 49

                  }

    @Test
    public void complete() {
        Maybe.empty().delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult();
    }

            

Reported by PMD.

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

Line: 50

              
    @Test
    public void complete() {
        Maybe.empty().delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult();
    }


            

Reported by PMD.

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

Line: 50

              
    @Test
    public void complete() {
        Maybe.empty().delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult();
    }


            

Reported by PMD.

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

Line: 50

              
    @Test
    public void complete() {
        Maybe.empty().delay(100, TimeUnit.MILLISECONDS)
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult();
    }


            

Reported by PMD.

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

Line: 33

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

public class ObservableFromCompletableTest extends RxJavaTest {
    @Test
    public void fromCompletable() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Observable.fromCompletable(Completable.fromAction(new Action() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 47

                          .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());
    }

    @Test
    public void fromCompletableTwice() {
        final AtomicInteger atomicInteger = new AtomicInteger();

            

Reported by PMD.

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

Line: 51

                  }

    @Test
    public void fromCompletableTwice() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Action run = new Action() {
            @Override
            public void run() throws Exception {

            

Reported by PMD.

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

Line: 61

                          }
        };

        Observable.fromCompletable(Completable.fromAction(run))
            .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());


            

Reported by PMD.

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

Line: 61

                          }
        };

        Observable.fromCompletable(Completable.fromAction(run))
            .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 65

                          .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());

        Observable.fromCompletable(Completable.fromAction(run))
            .test()
            .assertResult();


            

Reported by PMD.

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

Line: 67

              
        assertEquals(1, atomicInteger.get());

        Observable.fromCompletable(Completable.fromAction(run))
            .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

            

Reported by PMD.

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

Line: 67

              
        assertEquals(1, atomicInteger.get());

        Observable.fromCompletable(Completable.fromAction(run))
            .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 71

                          .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

    @Test
    public void fromCompletableInvokesLazy() {
        final AtomicInteger atomicInteger = new AtomicInteger();

            

Reported by PMD.

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

Line: 75

                  }

    @Test
    public void fromCompletableInvokesLazy() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Observable<Object> source = Observable.fromCompletable(Completable.fromAction(new Action() {
            @Override
            public void run() throws Exception {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/disposables/DisposableHelperTest.java
37 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 30

              
public class DisposableHelperTest extends RxJavaTest {
    @Test
    public void enumMethods() {
        assertEquals(1, DisposableHelper.values().length);
        assertNotNull(DisposableHelper.valueOf("DISPOSED"));
    }

    @Test

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 31

              public class DisposableHelperTest extends RxJavaTest {
    @Test
    public void enumMethods() {
        assertEquals(1, DisposableHelper.values().length);
        assertNotNull(DisposableHelper.valueOf("DISPOSED"));
    }

    @Test
    public void innerDisposed() {

            

Reported by PMD.

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

Line: 31

              public class DisposableHelperTest extends RxJavaTest {
    @Test
    public void enumMethods() {
        assertEquals(1, DisposableHelper.values().length);
        assertNotNull(DisposableHelper.valueOf("DISPOSED"));
    }

    @Test
    public void innerDisposed() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 32

                  @Test
    public void enumMethods() {
        assertEquals(1, DisposableHelper.values().length);
        assertNotNull(DisposableHelper.valueOf("DISPOSED"));
    }

    @Test
    public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());

            

Reported by PMD.

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

Line: 36

                  }

    @Test
    public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
        DisposableHelper.DISPOSED.dispose();
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
    }


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 37

              
    @Test
    public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
        DisposableHelper.DISPOSED.dispose();
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 37

              
    @Test
    public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
        DisposableHelper.DISPOSED.dispose();
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
    }

    @Test

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 38

                  @Test
    public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
        DisposableHelper.DISPOSED.dispose();
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
    }

    @Test
    public void validationNull() {

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 39

                  public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
        DisposableHelper.DISPOSED.dispose();
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
    }

    @Test
    public void validationNull() {
        List<Throwable> list = TestHelper.trackPluginErrors();

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 39

                  public void innerDisposed() {
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
        DisposableHelper.DISPOSED.dispose();
        assertTrue(DisposableHelper.DISPOSED.isDisposed());
    }

    @Test
    public void validationNull() {
        List<Throwable> list = TestHelper.trackPluginErrors();

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/BlockingFlowableToIteratorTest.java
37 issues
Unit tests should not contain more than 1 assert(s).
Design

Line: 35

              public class BlockingFlowableToIteratorTest extends RxJavaTest {

    @Test
    public void toIterator() {
        Flowable<String> obs = Flowable.just("one", "two", "three");

        Iterator<String> it = obs.blockingIterable().iterator();

        assertTrue(it.hasNext());

            

Reported by PMD.

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

Line: 36

              
    @Test
    public void toIterator() {
        Flowable<String> obs = Flowable.just("one", "two", "three");

        Iterator<String> it = obs.blockingIterable().iterator();

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

            

Reported by PMD.

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

Line: 38

                  public void toIterator() {
        Flowable<String> obs = Flowable.just("one", "two", "three");

        Iterator<String> it = obs.blockingIterable().iterator();

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

        assertTrue(it.hasNext());

            

Reported by PMD.

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

Line: 38

                  public void toIterator() {
        Flowable<String> obs = Flowable.just("one", "two", "three");

        Iterator<String> it = obs.blockingIterable().iterator();

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

        assertTrue(it.hasNext());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 40

              
        Iterator<String> it = obs.blockingIterable().iterator();

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

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


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 41

                      Iterator<String> it = obs.blockingIterable().iterator();

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

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

        assertTrue(it.hasNext());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 43

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

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

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


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 44

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

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

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

        assertFalse(it.hasNext());

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 46

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

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

        assertFalse(it.hasNext());

    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 47

                      assertEquals("two", it.next());

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

        assertFalse(it.hasNext());

    }


            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTakeLastTimed.java
37 issues
Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 27

              import io.reactivex.rxjava3.internal.util.BackpressureHelper;

public final class FlowableTakeLastTimed<T> extends AbstractFlowableWithUpstream<T, T> {
    final long count;
    final long time;
    final TimeUnit unit;
    final Scheduler scheduler;
    final int bufferSize;
    final boolean delayError;

            

Reported by PMD.

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

Line: 28

              
public final class FlowableTakeLastTimed<T> extends AbstractFlowableWithUpstream<T, T> {
    final long count;
    final long time;
    final TimeUnit unit;
    final Scheduler scheduler;
    final int bufferSize;
    final boolean delayError;


            

Reported by PMD.

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

Line: 29

              public final class FlowableTakeLastTimed<T> extends AbstractFlowableWithUpstream<T, T> {
    final long count;
    final long time;
    final TimeUnit unit;
    final Scheduler scheduler;
    final int bufferSize;
    final boolean delayError;

    public FlowableTakeLastTimed(Flowable<T> source,

            

Reported by PMD.

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

Line: 30

                  final long count;
    final long time;
    final TimeUnit unit;
    final Scheduler scheduler;
    final int bufferSize;
    final boolean delayError;

    public FlowableTakeLastTimed(Flowable<T> source,
            long count, long time, TimeUnit unit, Scheduler scheduler,

            

Reported by PMD.

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

Line: 31

                  final long time;
    final TimeUnit unit;
    final Scheduler scheduler;
    final int bufferSize;
    final boolean delayError;

    public FlowableTakeLastTimed(Flowable<T> source,
            long count, long time, TimeUnit unit, Scheduler scheduler,
            int bufferSize, boolean delayError) {

            

Reported by PMD.

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

Line: 32

                  final TimeUnit unit;
    final Scheduler scheduler;
    final int bufferSize;
    final boolean delayError;

    public FlowableTakeLastTimed(Flowable<T> source,
            long count, long time, TimeUnit unit, Scheduler scheduler,
            int bufferSize, boolean delayError) {
        super(source);

            

Reported by PMD.

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

Line: 51

                      source.subscribe(new TakeLastTimedSubscriber<>(s, count, time, unit, scheduler, bufferSize, delayError));
    }

    static final class TakeLastTimedSubscriber<T> extends AtomicInteger implements FlowableSubscriber<T>, Subscription {

        private static final long serialVersionUID = -5677354903406201275L;
        final Subscriber<? super T> downstream;
        final long count;
        final long time;

            

Reported by PMD.

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

Line: 51

                      source.subscribe(new TakeLastTimedSubscriber<>(s, count, time, unit, scheduler, bufferSize, delayError));
    }

    static final class TakeLastTimedSubscriber<T> extends AtomicInteger implements FlowableSubscriber<T>, Subscription {

        private static final long serialVersionUID = -5677354903406201275L;
        final Subscriber<? super T> downstream;
        final long count;
        final long time;

            

Reported by PMD.

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

Line: 54

                  static final class TakeLastTimedSubscriber<T> extends AtomicInteger implements FlowableSubscriber<T>, Subscription {

        private static final long serialVersionUID = -5677354903406201275L;
        final Subscriber<? super T> downstream;
        final long count;
        final long time;
        final TimeUnit unit;
        final Scheduler scheduler;
        final SpscLinkedArrayQueue<Object> queue;

            

Reported by PMD.

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

Line: 55

              
        private static final long serialVersionUID = -5677354903406201275L;
        final Subscriber<? super T> downstream;
        final long count;
        final long time;
        final TimeUnit unit;
        final Scheduler scheduler;
        final SpscLinkedArrayQueue<Object> queue;
        final boolean delayError;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableFromActionTest.java
37 issues
JUnit assertions should include a message
Design

Line: 47

                          .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());
    }

    @Test
    public void fromActionTwice() {
        final AtomicInteger atomicInteger = new AtomicInteger();

            

Reported by PMD.

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

Line: 51

                  }

    @Test
    public void fromActionTwice() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Action run = new Action() {
            @Override
            public void run() throws Exception {

            

Reported by PMD.

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

Line: 61

                          }
        };

        Flowable.fromAction(run)
            .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());


            

Reported by PMD.

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

Line: 61

                          }
        };

        Flowable.fromAction(run)
            .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());


            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 65

                          .test()
            .assertResult();

        assertEquals(1, atomicInteger.get());

        Flowable.fromAction(run)
            .test()
            .assertResult();


            

Reported by PMD.

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

Line: 67

              
        assertEquals(1, atomicInteger.get());

        Flowable.fromAction(run)
            .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

            

Reported by PMD.

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

Line: 67

              
        assertEquals(1, atomicInteger.get());

        Flowable.fromAction(run)
            .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 71

                          .test()
            .assertResult();

        assertEquals(2, atomicInteger.get());
    }

    @Test
    public void fromActionInvokesLazy() {
        final AtomicInteger atomicInteger = new AtomicInteger();

            

Reported by PMD.

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

Line: 75

                  }

    @Test
    public void fromActionInvokesLazy() {
        final AtomicInteger atomicInteger = new AtomicInteger();

        Flowable<Object> source = Flowable.fromAction(new Action() {
            @Override
            public void run() throws Exception {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 85

                          }
        });

        assertEquals(0, atomicInteger.get());

        source
            .test()
            .assertResult();


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeTimestampTest.java
37 issues
JUnit tests should include assert() or fail()
Design

Line: 30

              public class MaybeTimestampTest {

    @Test
    public void just() {
        Maybe.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timestamp()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 40

                  }

    @Test
    public void empty() {
        Maybe.empty()
        .timestamp()
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 41

              
    @Test
    public void empty() {
        Maybe.empty()
        .timestamp()
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 41

              
    @Test
    public void empty() {
        Maybe.empty()
        .timestamp()
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 41

              
    @Test
    public void empty() {
        Maybe.empty()
        .timestamp()
        .test()
        .assertResult();
    }


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeDoOnLifecycleTest.java
37 issues
The String literal 'unchecked' appears 6 times in this file; the first occurrence is on line 33
Error

Line: 33

              
    @Test
    public void success() throws Throwable {
        @SuppressWarnings("unchecked")
        Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.just(1)
        .doOnLifecycle(onSubscribe, onDispose)

            

Reported by PMD.

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

Line: 37

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.just(1)
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 37

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.just(1)
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 37

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.just(1)
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 42

                      .test()
        .assertResult(1);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void empty() throws Throwable {

            

Reported by PMD.

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

Line: 43

                      .assertResult(1);

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void empty() throws Throwable {
        @SuppressWarnings("unchecked")

            

Reported by PMD.

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

Line: 52

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.empty()
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult();

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 52

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.empty()
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult();

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 52

                      Consumer<? super Disposable> onSubscribe = mock(Consumer.class);
        Action onDispose = mock(Action.class);

        Maybe.empty()
        .doOnLifecycle(onSubscribe, onDispose)
        .test()
        .assertResult();

        verify(onSubscribe).accept(any());

            

Reported by PMD.

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

Line: 57

                      .test()
        .assertResult();

        verify(onSubscribe).accept(any());
        verify(onDispose, never()).run();
    }

    @Test
    public void error() throws Throwable {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeTimeIntervalTest.java
37 issues
JUnit tests should include assert() or fail()
Design

Line: 30

              public class MaybeTimeIntervalTest {

    @Test
    public void just() {
        Maybe.just(1)
        .timeInterval()
        .test()
        .assertValueCount(1)
        .assertNoErrors()

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timeInterval()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timeInterval()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timeInterval()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timeInterval()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 31

              
    @Test
    public void just() {
        Maybe.just(1)
        .timeInterval()
        .test()
        .assertValueCount(1)
        .assertNoErrors()
        .assertComplete();

            

Reported by PMD.

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

Line: 40

                  }

    @Test
    public void empty() {
        Maybe.empty()
        .timeInterval()
        .test()
        .assertResult();
    }

            

Reported by PMD.

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

Line: 41

              
    @Test
    public void empty() {
        Maybe.empty()
        .timeInterval()
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 41

              
    @Test
    public void empty() {
        Maybe.empty()
        .timeInterval()
        .test()
        .assertResult();
    }


            

Reported by PMD.

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

Line: 41

              
    @Test
    public void empty() {
        Maybe.empty()
        .timeInterval()
        .test()
        .assertResult();
    }


            

Reported by PMD.

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableGenerate.java
37 issues
Avoid reassigning parameters such as 'n'
Design

Line: 82

                      }

        @Override
        public void request(long n) {
            if (!SubscriptionHelper.validate(n)) {
                return;
            }
            if (BackpressureHelper.add(this, n) != 0L) {
                return;

            

Reported by PMD.

Avoid reassigning parameters such as 'n'
Design

Line: 82

                      }

        @Override
        public void request(long n) {
            if (!SubscriptionHelper.validate(n)) {
                return;
            }
            if (BackpressureHelper.add(this, n) != 0L) {
                return;

            

Reported by PMD.

Avoid reassigning parameters such as 't'
Design

Line: 180

                      }

        @Override
        public void onError(Throwable t) {
            if (terminate) {
                RxJavaPlugins.onError(t);
            } else {
                if (t == null) {
                    t = ExceptionHelper.createNullPointerException("onError called with a null Throwable.");

            

Reported by PMD.

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

Line: 28

              import io.reactivex.rxjava3.plugins.RxJavaPlugins;

public final class FlowableGenerate<T, S> extends Flowable<T> {
    final Supplier<S> stateSupplier;
    final BiFunction<S, Emitter<T>, S> generator;
    final Consumer<? super S> disposeState;

    public FlowableGenerate(Supplier<S> stateSupplier, BiFunction<S, Emitter<T>, S> generator,
            Consumer<? super S> disposeState) {

            

Reported by PMD.

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

Line: 29

              
public final class FlowableGenerate<T, S> extends Flowable<T> {
    final Supplier<S> stateSupplier;
    final BiFunction<S, Emitter<T>, S> generator;
    final Consumer<? super S> disposeState;

    public FlowableGenerate(Supplier<S> stateSupplier, BiFunction<S, Emitter<T>, S> generator,
            Consumer<? super S> disposeState) {
        this.stateSupplier = stateSupplier;

            

Reported by PMD.

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

Line: 30

              public final class FlowableGenerate<T, S> extends Flowable<T> {
    final Supplier<S> stateSupplier;
    final BiFunction<S, Emitter<T>, S> generator;
    final Consumer<? super S> disposeState;

    public FlowableGenerate(Supplier<S> stateSupplier, BiFunction<S, Emitter<T>, S> generator,
            Consumer<? super S> disposeState) {
        this.stateSupplier = stateSupplier;
        this.generator = generator;

            

Reported by PMD.

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

Line: 45

              
        try {
            state = stateSupplier.get();
        } catch (Throwable e) {
            Exceptions.throwIfFatal(e);
            EmptySubscription.error(e, s);
            return;
        }


            

Reported by PMD.

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

Line: 54

                      s.onSubscribe(new GeneratorSubscription<>(s, generator, disposeState, state));
    }

    static final class GeneratorSubscription<T, S>
    extends AtomicLong
    implements Emitter<T>, Subscription {

        private static final long serialVersionUID = 7565982551505011832L;


            

Reported by PMD.

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

Line: 54

                      s.onSubscribe(new GeneratorSubscription<>(s, generator, disposeState, state));
    }

    static final class GeneratorSubscription<T, S>
    extends AtomicLong
    implements Emitter<T>, Subscription {

        private static final long serialVersionUID = 7565982551505011832L;


            

Reported by PMD.

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

Line: 60

              
        private static final long serialVersionUID = 7565982551505011832L;

        final Subscriber<? super T> downstream;
        final BiFunction<S, ? super Emitter<T>, S> generator;
        final Consumer<? super S> disposeState;

        S state;


            

Reported by PMD.