The following issues were found

src/test/java/io/reactivex/rxjava3/internal/operators/observable/AbstractObservableWithUpstreamTest.java
3 issues
Potential violation of Law of Demeter (object not created locally)
Design

Line: 31

                  public void source() {
        Observable<Integer> o = Observable.just(1);

        assertSame(o, ((HasUpstreamObservableSource<Integer>)o.map(Functions.<Integer>identity())).source());
    }
}

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 31

                  public void source() {
        Observable<Integer> o = Observable.just(1);

        assertSame(o, ((HasUpstreamObservableSource<Integer>)o.map(Functions.<Integer>identity())).source());
    }
}

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 20

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.internal.fuseable.HasUpstreamObservableSource;

public class AbstractObservableWithUpstreamTest extends RxJavaTest {


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableReduceWithSingleTest.java
3 issues
JUnit tests should include assert() or fail()
Design

Line: 26

              public class FlowableReduceWithSingleTest extends RxJavaTest {

    @Test
    public void normal() {
        Flowable.range(1, 5)
        .reduceWith(Functions.justSupplier(1), new BiFunction<Integer, Integer, Integer>() {
            @Override
            public Integer apply(Integer a, Integer b) throws Exception {
                return a + b;

            

Reported by PMD.

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

Line: 39

                  }

    @Test
    public void disposed() {
        TestHelper.checkDisposed(Flowable.range(1, 5)
        .reduceWith(Functions.justSupplier(1), new BiFunction<Integer, Integer, Integer>() {
            @Override
            public Integer apply(Integer a, Integer b) throws Exception {
                return a + b;

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 18

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.BiFunction;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class FlowableReduceWithSingleTest extends RxJavaTest {

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/AbstractMaybeWithUpstreamTest.java
3 issues
JUnit assertions should include a message
Design

Line: 31

                  public void upstream() {
        Maybe<Integer> source = Maybe.just(1);

        assertSame(source, ((HasUpstreamMaybeSource<Integer>)source.map(Functions.<Integer>identity())).source());
    }
}

            

Reported by PMD.

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

Line: 31

                  public void upstream() {
        Maybe<Integer> source = Maybe.just(1);

        assertSame(source, ((HasUpstreamMaybeSource<Integer>)source.map(Functions.<Integer>identity())).source());
    }
}

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 20

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.internal.fuseable.HasUpstreamMaybeSource;

public class AbstractMaybeWithUpstreamTest extends RxJavaTest {


            

Reported by PMD.

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

Line: 26

              public class MaybeEqualTest extends RxJavaTest {

    @Test
    public void dispose() {
        TestHelper.checkDisposed(Maybe.sequenceEqual(Maybe.just(1), Maybe.just(1)));
    }

    @Test
    public void predicateThrows() {

            

Reported by PMD.

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

Line: 31

                  }

    @Test
    public void predicateThrows() {
        Maybe.sequenceEqual(Maybe.just(1), Maybe.just(2), new BiPredicate<Integer, Integer>() {
            @Override
            public boolean test(Integer a, Integer b) throws Exception {
                throw new TestException();
            }

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 18

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.exceptions.TestException;
import io.reactivex.rxjava3.functions.BiPredicate;
import io.reactivex.rxjava3.testsupport.TestHelper;

public class MaybeEqualTest extends RxJavaTest {

            

Reported by PMD.

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

Line: 25

              public class MaybeSubscribeOnTest extends RxJavaTest {

    @Test
    public void dispose() {
        TestHelper.checkDisposed(Maybe.just(1).subscribeOn(Schedulers.single()));
    }
}

            

Reported by PMD.

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

Line: 26

              
    @Test
    public void dispose() {
        TestHelper.checkDisposed(Maybe.just(1).subscribeOn(Schedulers.single()));
    }
}

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 18

              
import org.junit.Test;

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

public class MaybeSubscribeOnTest extends RxJavaTest {


            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeIsEmptySingleTest.java
3 issues
JUnit assertions should include a message
Design

Line: 29

                  public void source() {
        Maybe<Integer> m = Maybe.just(1);

        assertSame(m, (((HasUpstreamMaybeSource<?>)m.isEmpty()).source()));
    }
}

            

Reported by PMD.

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

Line: 29

                  public void source() {
        Maybe<Integer> m = Maybe.just(1);

        assertSame(m, (((HasUpstreamMaybeSource<?>)m.isEmpty()).source()));
    }
}

            

Reported by PMD.

Avoid unused imports such as 'io.reactivex.rxjava3.core'
Design

Line: 20

              
import org.junit.Test;

import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.internal.fuseable.HasUpstreamMaybeSource;

public class MaybeIsEmptySingleTest extends RxJavaTest {

    @Test

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/jdk8/FlatMapStream0TckTest.java
3 issues
Potential violation of Law of Demeter (method chain calls)
Design

Line: 30

                  @Override
    public Publisher<Integer> createPublisher(final long elements) {
        return
                Flowable.just(1).flatMapStream(v -> IntStream.range(0, (int)elements).boxed())
            ;
    }

    @Override
    public Publisher<Integer> createFailedPublisher() {

            

Reported by PMD.

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

Line: 37

                  @Override
    public Publisher<Integer> createFailedPublisher() {
        Stream<Integer> stream = Stream.of(1);
        stream.forEach(v -> { });
        return Flowable.just(1).flatMapStream(v -> stream);
    }
}

            

Reported by PMD.

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

Line: 38

                  public Publisher<Integer> createFailedPublisher() {
        Stream<Integer> stream = Stream.of(1);
        stream.forEach(v -> { });
        return Flowable.just(1).flatMapStream(v -> stream);
    }
}

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/tck/ReplayProcessorTimeBoundAsPublisherTckTest.java
3 issues
Avoid using Literals in Conditional Statements
Error

Line: 46

                                      return;
                    }

                    if (System.currentTimeMillis() - start > 200) {
                        return;
                    }
                }

                for (int i = 0; i < elements; i++) {

            

Reported by PMD.

Found 'DU'-anomaly for variable 'start' (lines '38'-'58').
Error

Line: 38

                      Schedulers.io().scheduleDirect(new Runnable() {
            @Override
            public void run() {
                long start = System.currentTimeMillis();
                while (!pp.hasSubscribers()) {
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException ex) {
                        return;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'start' (lines '38'-'58').
Error

Line: 38

                      Schedulers.io().scheduleDirect(new Runnable() {
            @Override
            public void run() {
                long start = System.currentTimeMillis();
                while (!pp.hasSubscribers()) {
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException ex) {
                        return;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/tck/ReplayProcessorUnboundedAsPublisherTckTest.java
3 issues
Avoid using Literals in Conditional Statements
Error

Line: 44

                                      return;
                    }

                    if (System.currentTimeMillis() - start > 200) {
                        return;
                    }
                }

                for (int i = 0; i < elements; i++) {

            

Reported by PMD.

Found 'DU'-anomaly for variable 'start' (lines '36'-'56').
Error

Line: 36

                      Schedulers.io().scheduleDirect(new Runnable() {
            @Override
            public void run() {
                long start = System.currentTimeMillis();
                while (!pp.hasSubscribers()) {
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException ex) {
                        return;

            

Reported by PMD.

Found 'DU'-anomaly for variable 'start' (lines '36'-'56').
Error

Line: 36

                      Schedulers.io().scheduleDirect(new Runnable() {
            @Override
            public void run() {
                long start = System.currentTimeMillis();
                while (!pp.hasSubscribers()) {
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException ex) {
                        return;

            

Reported by PMD.

src/test/java/io/reactivex/rxjava3/internal/schedulers/InterruptibleRunnableTest.java
3 issues
In JUnit4, use the @Test(expected) annotation to denote tests that should throw exceptions
Design

Line: 40

              
            try {
                task.run();
                fail("Should have thrown!");
            } catch (TestException expected) {
                // expected
            }

            TestHelper.assertUndeliverable(errors, 0, TestException.class);

            

Reported by PMD.

Found 'DU'-anomaly for variable 'errors' (lines '32'-'49').
Error

Line: 32

              
    @Test
    public void runnableThrows() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            InterruptibleRunnable task = new InterruptibleRunnable(() -> {
                throw new TestException();
            }, null);


            

Reported by PMD.

Found 'DU'-anomaly for variable 'task' (lines '34'-'49').
Error

Line: 34

                  public void runnableThrows() {
        List<Throwable> errors = TestHelper.trackPluginErrors();
        try {
            InterruptibleRunnable task = new InterruptibleRunnable(() -> {
                throw new TestException();
            }, null);

            try {
                task.run();

            

Reported by PMD.