The following issues were found

guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java
481 issues
This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Objects.equal;
import static com.google.common.collect.Platform.reduceExponentIfGwt;
import static com.google.common.collect.Platform.reduceIterationsIfGwt;
import static com.google.common.truth.Truth.assertThat;

            

Reported by PMD.

A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Objects.equal;
import static com.google.common.collect.Platform.reduceExponentIfGwt;
import static com.google.common.collect.Platform.reduceIterationsIfGwt;
import static com.google.common.truth.Truth.assertThat;

            

Reported by PMD.

Possible God Class (WMC=121, ATFD=67, TCC=0.913%)
Design

Line: 58

               * @author Sverre Sundsdal
 */
@GwtCompatible(emulated = true)
public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

            

Reported by PMD.

The class 'MinMaxPriorityQueueTest' has a total cyclomatic complexity of 121 (highest 6).
Design

Line: 58

               * @author Sverre Sundsdal
 */
@GwtCompatible(emulated = true)
public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

            

Reported by PMD.

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

Line: 58

               * @author Sverre Sundsdal
 */
@GwtCompatible(emulated = true)
public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

            

Reported by PMD.

JUnit 4 indicates test suites via annotations, not the suite method.
Design

Line: 61

              public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(MinMaxPriorityQueueTest.class);
    suite.addTest(
        QueueTestSuiteBuilder.using(

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 81

              
  // Overkill alert!  Test all combinations of 0-2 options during creation.

  public void testCreation_simple() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    checkNatural(queue);
  }

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 83

              
  public void testCreation_simple() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    checkNatural(queue);
  }

  public void testCreation_comparator() {

            

Reported by PMD.

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

Line: 83

              
  public void testCreation_simple() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    checkNatural(queue);
  }

  public void testCreation_comparator() {

            

Reported by PMD.

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

Line: 88

                  checkNatural(queue);
  }

  public void testCreation_comparator() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.orderedBy(SOME_COMPARATOR).create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    assertSame(SOME_COMPARATOR, queue.comparator());
  }

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java
481 issues
A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Objects.equal;
import static com.google.common.collect.Platform.reduceExponentIfGwt;
import static com.google.common.collect.Platform.reduceIterationsIfGwt;
import static com.google.common.truth.Truth.assertThat;

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Objects.equal;
import static com.google.common.collect.Platform.reduceExponentIfGwt;
import static com.google.common.collect.Platform.reduceIterationsIfGwt;
import static com.google.common.truth.Truth.assertThat;

            

Reported by PMD.

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

Line: 58

               * @author Sverre Sundsdal
 */
@GwtCompatible(emulated = true)
public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

            

Reported by PMD.

The class 'MinMaxPriorityQueueTest' has a total cyclomatic complexity of 121 (highest 6).
Design

Line: 58

               * @author Sverre Sundsdal
 */
@GwtCompatible(emulated = true)
public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

            

Reported by PMD.

Possible God Class (WMC=121, ATFD=67, TCC=0.913%)
Design

Line: 58

               * @author Sverre Sundsdal
 */
@GwtCompatible(emulated = true)
public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

            

Reported by PMD.

JUnit 4 indicates test suites via annotations, not the suite method.
Design

Line: 61

              public class MinMaxPriorityQueueTest extends TestCase {
  private static final Ordering<Integer> SOME_COMPARATOR = Ordering.natural().reverse();

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(MinMaxPriorityQueueTest.class);
    suite.addTest(
        QueueTestSuiteBuilder.using(

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 81

              
  // Overkill alert!  Test all combinations of 0-2 options during creation.

  public void testCreation_simple() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    checkNatural(queue);
  }

            

Reported by PMD.

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

Line: 83

              
  public void testCreation_simple() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    checkNatural(queue);
  }

  public void testCreation_comparator() {

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 83

              
  public void testCreation_simple() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    checkNatural(queue);
  }

  public void testCreation_comparator() {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 88

                  checkNatural(queue);
  }

  public void testCreation_comparator() {
    MinMaxPriorityQueue<Integer> queue = MinMaxPriorityQueue.orderedBy(SOME_COMPARATOR).create();
    assertEquals(11, queue.capacity());
    checkUnbounded(queue);
    assertSame(SOME_COMPARATOR, queue.comparator());
  }

            

Reported by PMD.

guava-tests/test/com/google/common/collect/MultimapsTest.java
479 issues
A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Maps.immutableEntry;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.Helpers.mapEntry;

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Maps.immutableEntry;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.Helpers.mapEntry;

            

Reported by PMD.

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

Line: 73

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class MultimapsTest extends TestCase {

  private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  public void testMultimapCollectorGenerics() {

            

Reported by PMD.

Possible God Class (WMC=86, ATFD=84, TCC=0.235%)
Design

Line: 73

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class MultimapsTest extends TestCase {

  private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  public void testMultimapCollectorGenerics() {

            

Reported by PMD.

The class 'MultimapsTest' has a total cyclomatic complexity of 86 (highest 5).
Design

Line: 73

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class MultimapsTest extends TestCase {

  private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  public void testMultimapCollectorGenerics() {

            

Reported by PMD.

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

Line: 78

                private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  public void testMultimapCollectorGenerics() {
    ListMultimap<Integer, String> unused =
        Stream.of("foo", "bar", "quux")
            .collect(
                Multimaps.toMultimap(
                    String::length, s -> s, MultimapBuilder.treeKeys().arrayListValues()::build));

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 78

                private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  public void testMultimapCollectorGenerics() {
    ListMultimap<Integer, String> unused =
        Stream.of("foo", "bar", "quux")
            .collect(
                Multimaps.toMultimap(
                    String::length, s -> s, MultimapBuilder.treeKeys().arrayListValues()::build));

            

Reported by PMD.

Avoid unused local variables such as 'unused'.
Design

Line: 79

                    Ordering.<Integer>natural().reverse().nullsFirst();

  public void testMultimapCollectorGenerics() {
    ListMultimap<Integer, String> unused =
        Stream.of("foo", "bar", "quux")
            .collect(
                Multimaps.toMultimap(
                    String::length, s -> s, MultimapBuilder.treeKeys().arrayListValues()::build));
  }

            

Reported by PMD.

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

Line: 80

              
  public void testMultimapCollectorGenerics() {
    ListMultimap<Integer, String> unused =
        Stream.of("foo", "bar", "quux")
            .collect(
                Multimaps.toMultimap(
                    String::length, s -> s, MultimapBuilder.treeKeys().arrayListValues()::build));
  }


            

Reported by PMD.

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

Line: 80

              
  public void testMultimapCollectorGenerics() {
    ListMultimap<Integer, String> unused =
        Stream.of("foo", "bar", "quux")
            .collect(
                Multimaps.toMultimap(
                    String::length, s -> s, MultimapBuilder.treeKeys().arrayListValues()::build));
  }


            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/ImmutableSortedSetTest.java
454 issues
This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;

import com.google.common.annotations.GwtCompatible;

            

Reported by PMD.

A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;

import com.google.common.annotations.GwtCompatible;

            

Reported by PMD.

Avoid really long classes.
Design

Line: 58

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

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

Line: 58

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

Possible God Class (WMC=139, ATFD=81, TCC=3.950%)
Design

Line: 58

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

The class 'ImmutableSortedSetTest' has a total cyclomatic complexity of 139 (highest 3).
Design

Line: 58

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

JUnit 4 indicates test suites via annotations, not the suite method.
Design

Line: 60

              @GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

    suite.addTest(
        NavigableSetTestSuiteBuilder.using(new ImmutableSortedSetCopyOfGenerator())

            

Reported by PMD.

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

Line: 204

                  return ImmutableSortedSet.of(e1, e2, e3, e4, e5);
  }

  @SuppressWarnings("unchecked")
  @Override
  protected <E extends Comparable<? super E>> SortedSet<E> of(
      E e1, E e2, E e3, E e4, E e5, E e6, E... rest) {
    return ImmutableSortedSet.of(e1, e2, e3, e4, e5, e6, rest);
  }

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 232

                  return ImmutableSortedSet.copyOf(elements);
  }

  @GwtIncompatible // NullPointerTester
  public void testNullPointers() {
    new NullPointerTester().testAllPublicStaticMethods(ImmutableSortedSet.class);
  }

  public void testEmpty_comparator() {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 237

                  new NullPointerTester().testAllPublicStaticMethods(ImmutableSortedSet.class);
  }

  public void testEmpty_comparator() {
    SortedSet<String> set = of();
    assertSame(Ordering.natural(), set.comparator());
  }

  public void testEmpty_headSet() {

            

Reported by PMD.

android/guava-tests/test/com/google/common/reflect/InvokableTest.java
454 issues
System.out.println is used
Design

Line: 555

                      new Runnable() {
          @Override
          public void run() {
            System.out.println(s + i);
          }
        }.getClass();
    Constructor<?> constructor = anonymous.getDeclaredConstructors()[0];
    assertEquals(0, Invokable.from(constructor).getParameters().size());
  }

            

Reported by PMD.

System.out.println is used
Design

Line: 578

                  class LocalWithDefaultConstructor implements Runnable {
      @Override
      public void run() {
        System.out.println(s + i);
      }
    }
    Constructor<?> constructor = LocalWithDefaultConstructor.class.getDeclaredConstructors()[0];
    assertEquals(0, Invokable.from(constructor).getParameters().size());
  }

            

Reported by PMD.

System.out.println is used
Design

Line: 596

                      new Runnable() {
          @Override
          public void run() {
            System.out.println(s + i);
          }
        }.getClass();
    Constructor<?> constructor = anonymous.getDeclaredConstructors()[0];
    assertEquals(0, Invokable.from(constructor).getParameters().size());
  }

            

Reported by PMD.

System.out.println is used
Design

Line: 615

                        new Runnable() {
            @Override
            public void run() {
              System.out.println(s + i);
            }
          }.getClass();
      Constructor<?> constructor = anonymous.getDeclaredConstructors()[0];
      assertEquals(0, Invokable.from(constructor).getParameters().size());
    }

            

Reported by PMD.

System.out.println is used
Design

Line: 673

                  class LocalWithOneParameterConstructor {
      @SuppressWarnings("unused") // called by reflection
      public LocalWithOneParameterConstructor(String x) {
        System.out.println(s + i);
      }
    }
    Constructor<?> constructor =
        LocalWithOneParameterConstructor.class.getDeclaredConstructors()[0];
    Invokable<?, ?> invokable = Invokable.from(constructor);

            

Reported by PMD.

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

Line: 17

               * limitations under the License.
 */

package com.google.common.reflect;

import static com.google.common.truth.Truth.assertThat;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.reflect;

import static com.google.common.truth.Truth.assertThat;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

            

Reported by PMD.

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

Line: 44

               * @author Ben Yu
 */
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class InvokableTest extends TestCase {
  // Historically Invokable inherited from java.lang.reflect.AccessibleObject. That's no longer the
  // case, but we do check that its API still has the same public methods. We exclude some methods
  // that were added in Java 9 and that people probably weren't calling via Invokable, namely
  // `boolean canAccess(Object)`.
  public void testApiCompatibleWithAccessibleObject() {

            

Reported by PMD.

Possible God Class (WMC=74, ATFD=229, TCC=0.000%)
Design

Line: 44

               * @author Ben Yu
 */
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class InvokableTest extends TestCase {
  // Historically Invokable inherited from java.lang.reflect.AccessibleObject. That's no longer the
  // case, but we do check that its API still has the same public methods. We exclude some methods
  // that were added in Java 9 and that people probably weren't calling via Invokable, namely
  // `boolean canAccess(Object)`.
  public void testApiCompatibleWithAccessibleObject() {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 49

                // case, but we do check that its API still has the same public methods. We exclude some methods
  // that were added in Java 9 and that people probably weren't calling via Invokable, namely
  // `boolean canAccess(Object)`.
  public void testApiCompatibleWithAccessibleObject() {
    ImmutableSet<String> invokableMethods =
        publicMethodSignatures(Invokable.class, ImmutableSet.<String>of());
    ImmutableSet<String> accesibleObjectMethods =
        publicMethodSignatures(AccessibleObject.class, ImmutableSet.of("canAccess"));
    assertThat(invokableMethods).containsAtLeastElementsIn(accesibleObjectMethods);

            

Reported by PMD.

guava-tests/test/com/google/common/reflect/InvokableTest.java
454 issues
System.out.println is used
Design

Line: 555

                      new Runnable() {
          @Override
          public void run() {
            System.out.println(s + i);
          }
        }.getClass();
    Constructor<?> constructor = anonymous.getDeclaredConstructors()[0];
    assertEquals(0, Invokable.from(constructor).getParameters().size());
  }

            

Reported by PMD.

System.out.println is used
Design

Line: 578

                  class LocalWithDefaultConstructor implements Runnable {
      @Override
      public void run() {
        System.out.println(s + i);
      }
    }
    Constructor<?> constructor = LocalWithDefaultConstructor.class.getDeclaredConstructors()[0];
    assertEquals(0, Invokable.from(constructor).getParameters().size());
  }

            

Reported by PMD.

System.out.println is used
Design

Line: 596

                      new Runnable() {
          @Override
          public void run() {
            System.out.println(s + i);
          }
        }.getClass();
    Constructor<?> constructor = anonymous.getDeclaredConstructors()[0];
    assertEquals(0, Invokable.from(constructor).getParameters().size());
  }

            

Reported by PMD.

System.out.println is used
Design

Line: 615

                        new Runnable() {
            @Override
            public void run() {
              System.out.println(s + i);
            }
          }.getClass();
      Constructor<?> constructor = anonymous.getDeclaredConstructors()[0];
      assertEquals(0, Invokable.from(constructor).getParameters().size());
    }

            

Reported by PMD.

System.out.println is used
Design

Line: 673

                  class LocalWithOneParameterConstructor {
      @SuppressWarnings("unused") // called by reflection
      public LocalWithOneParameterConstructor(String x) {
        System.out.println(s + i);
      }
    }
    Constructor<?> constructor =
        LocalWithOneParameterConstructor.class.getDeclaredConstructors()[0];
    Invokable<?, ?> invokable = Invokable.from(constructor);

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.reflect;

import static com.google.common.truth.Truth.assertThat;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

            

Reported by PMD.

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

Line: 17

               * limitations under the License.
 */

package com.google.common.reflect;

import static com.google.common.truth.Truth.assertThat;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

            

Reported by PMD.

Possible God Class (WMC=74, ATFD=229, TCC=0.000%)
Design

Line: 44

               * @author Ben Yu
 */
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class InvokableTest extends TestCase {
  // Historically Invokable inherited from java.lang.reflect.AccessibleObject. That's no longer the
  // case, but we do check that its API still has the same public methods. We exclude some methods
  // that were added in Java 9 and that people probably weren't calling via Invokable, namely
  // `boolean canAccess(Object)` and `boolean trySetAccessible()`.
  public void testApiCompatibleWithAccessibleObject() {

            

Reported by PMD.

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

Line: 44

               * @author Ben Yu
 */
@AndroidIncompatible // lots of failures, possibly some related to bad equals() implementations?
public class InvokableTest extends TestCase {
  // Historically Invokable inherited from java.lang.reflect.AccessibleObject. That's no longer the
  // case, but we do check that its API still has the same public methods. We exclude some methods
  // that were added in Java 9 and that people probably weren't calling via Invokable, namely
  // `boolean canAccess(Object)` and `boolean trySetAccessible()`.
  public void testApiCompatibleWithAccessibleObject() {

            

Reported by PMD.

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

Line: 49

                // case, but we do check that its API still has the same public methods. We exclude some methods
  // that were added in Java 9 and that people probably weren't calling via Invokable, namely
  // `boolean canAccess(Object)` and `boolean trySetAccessible()`.
  public void testApiCompatibleWithAccessibleObject() {
    ImmutableSet<String> invokableMethods =
        publicMethodSignatures(Invokable.class, ImmutableSet.<String>of());
    ImmutableSet<String> accesibleObjectMethods =
        publicMethodSignatures(AccessibleObject.class, ImmutableSet.of("canAccess"));
    assertThat(invokableMethods).containsAtLeastElementsIn(accesibleObjectMethods);

            

Reported by PMD.

guava-tests/test/com/google/common/collect/ImmutableSortedSetTest.java
451 issues
This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;

import com.google.common.annotations.GwtCompatible;

            

Reported by PMD.

A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;

import com.google.common.annotations.GwtCompatible;

            

Reported by PMD.

Possible God Class (WMC=136, ATFD=84, TCC=3.703%)
Design

Line: 62

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

Avoid really long classes.
Design

Line: 62

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

The class 'ImmutableSortedSetTest' has a total cyclomatic complexity of 136 (highest 3).
Design

Line: 62

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

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

Line: 62

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();


            

Reported by PMD.

JUnit 4 indicates test suites via annotations, not the suite method.
Design

Line: 64

              @GwtCompatible(emulated = true)
public class ImmutableSortedSetTest extends AbstractImmutableSetTest {

  @GwtIncompatible // suite
  public static Test suite() {
    TestSuite suite = new TestSuite();

    suite.addTest(
        NavigableSetTestSuiteBuilder.using(new ImmutableSortedSetCopyOfGenerator())

            

Reported by PMD.

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

Line: 208

                  return ImmutableSortedSet.of(e1, e2, e3, e4, e5);
  }

  @SuppressWarnings("unchecked")
  @Override
  protected <E extends Comparable<? super E>> SortedSet<E> of(
      E e1, E e2, E e3, E e4, E e5, E e6, E... rest) {
    return ImmutableSortedSet.of(e1, e2, e3, e4, e5, e6, rest);
  }

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 236

                  return ImmutableSortedSet.copyOf(elements);
  }

  @GwtIncompatible // NullPointerTester
  public void testNullPointers() {
    new NullPointerTester().testAllPublicStaticMethods(ImmutableSortedSet.class);
  }

  public void testEmpty_comparator() {

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 241

                  new NullPointerTester().testAllPublicStaticMethods(ImmutableSortedSet.class);
  }

  public void testEmpty_comparator() {
    SortedSet<String> set = of();
    assertSame(Ordering.natural(), set.comparator());
  }

  public void testEmpty_headSet() {

            

Reported by PMD.

android/guava-tests/test/com/google/common/collect/MultimapsTest.java
445 issues
This class has a bunch of public methods and attributes
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Maps.immutableEntry;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.Helpers.nefariousMapEntry;

            

Reported by PMD.

A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 17

               * limitations under the License.
 */

package com.google.common.collect;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Maps.immutableEntry;
import static com.google.common.collect.Sets.newHashSet;
import static com.google.common.collect.testing.Helpers.nefariousMapEntry;

            

Reported by PMD.

Possible God Class (WMC=83, ATFD=78, TCC=0.256%)
Design

Line: 67

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class MultimapsTest extends TestCase {

  private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  @SuppressWarnings("deprecation")

            

Reported by PMD.

The class 'MultimapsTest' has a total cyclomatic complexity of 83 (highest 5).
Design

Line: 67

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class MultimapsTest extends TestCase {

  private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  @SuppressWarnings("deprecation")

            

Reported by PMD.

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

Line: 67

               * @author Jared Levy
 */
@GwtCompatible(emulated = true)
public class MultimapsTest extends TestCase {

  private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  @SuppressWarnings("deprecation")

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 72

                private static final Comparator<Integer> INT_COMPARATOR =
      Ordering.<Integer>natural().reverse().nullsFirst();

  @SuppressWarnings("deprecation")
  public void testUnmodifiableListMultimapShortCircuit() {
    ListMultimap<String, Integer> mod = ArrayListMultimap.create();
    ListMultimap<String, Integer> unmod = Multimaps.unmodifiableListMultimap(mod);
    assertNotSame(mod, unmod);
    assertSame(unmod, Multimaps.unmodifiableListMultimap(unmod));

            

Reported by PMD.

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

Line: 73

                    Ordering.<Integer>natural().reverse().nullsFirst();

  @SuppressWarnings("deprecation")
  public void testUnmodifiableListMultimapShortCircuit() {
    ListMultimap<String, Integer> mod = ArrayListMultimap.create();
    ListMultimap<String, Integer> unmod = Multimaps.unmodifiableListMultimap(mod);
    assertNotSame(mod, unmod);
    assertSame(unmod, Multimaps.unmodifiableListMultimap(unmod));
    ImmutableListMultimap<String, Integer> immutable =

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 76

                public void testUnmodifiableListMultimapShortCircuit() {
    ListMultimap<String, Integer> mod = ArrayListMultimap.create();
    ListMultimap<String, Integer> unmod = Multimaps.unmodifiableListMultimap(mod);
    assertNotSame(mod, unmod);
    assertSame(unmod, Multimaps.unmodifiableListMultimap(unmod));
    ImmutableListMultimap<String, Integer> immutable =
        ImmutableListMultimap.of("a", 1, "b", 2, "a", 3);
    assertSame(immutable, Multimaps.unmodifiableListMultimap(immutable));
    assertSame(

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 77

                  ListMultimap<String, Integer> mod = ArrayListMultimap.create();
    ListMultimap<String, Integer> unmod = Multimaps.unmodifiableListMultimap(mod);
    assertNotSame(mod, unmod);
    assertSame(unmod, Multimaps.unmodifiableListMultimap(unmod));
    ImmutableListMultimap<String, Integer> immutable =
        ImmutableListMultimap.of("a", 1, "b", 2, "a", 3);
    assertSame(immutable, Multimaps.unmodifiableListMultimap(immutable));
    assertSame(
        immutable, Multimaps.unmodifiableListMultimap((ListMultimap<String, Integer>) immutable));

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 80

                  assertSame(unmod, Multimaps.unmodifiableListMultimap(unmod));
    ImmutableListMultimap<String, Integer> immutable =
        ImmutableListMultimap.of("a", 1, "b", 2, "a", 3);
    assertSame(immutable, Multimaps.unmodifiableListMultimap(immutable));
    assertSame(
        immutable, Multimaps.unmodifiableListMultimap((ListMultimap<String, Integer>) immutable));
  }

  @SuppressWarnings("deprecation")

            

Reported by PMD.

android/guava-tests/test/com/google/common/net/InetAddressesTest.java
439 issues
The class 'InetAddressesTest' has a Standard Cyclomatic Complexity of 2 (Highest = 12).
Design

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

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

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

Possible God Class (WMC=92, ATFD=150, TCC=0.317%)
Design

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

The class 'InetAddressesTest' has a total cyclomatic complexity of 92 (highest 12).
Design

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

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

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 37

               */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);
  }


            

Reported by PMD.

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

Line: 37

               */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);
  }


            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 43

                  tester.testAllPublicStaticMethods(InetAddresses.class);
  }

  public void testForStringBogusInput() {
    ImmutableSet<String> bogusInputs =
        ImmutableSet.of(
            "",
            "016.016.016.016",
            "016.016.016",

            

Reported by PMD.

Do not hard code the IP address
Design

Line: 47

                  ImmutableSet<String> bogusInputs =
        ImmutableSet.of(
            "",
            "016.016.016.016",
            "016.016.016",
            "016.016",
            "016",
            "000.000.000.000",
            "000",

            

Reported by PMD.

Do not hard code the IP address
Design

Line: 51

                          "016.016.016",
            "016.016",
            "016",
            "000.000.000.000",
            "000",
            "0x0a.0x0a.0x0a.0x0a",
            "0x0a.0x0a.0x0a",
            "0x0a.0x0a",
            "0x0a",

            

Reported by PMD.

guava-tests/test/com/google/common/net/InetAddressesTest.java
439 issues
Possible God Class (WMC=92, ATFD=150, TCC=0.317%)
Design

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

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

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

The class 'InetAddressesTest' has a total cyclomatic complexity of 92 (highest 12).
Design

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

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

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

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

Line: 35

               *
 * @author Erik Kline
 */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);

            

Reported by PMD.

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

Line: 37

               */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);
  }


            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 37

               */
public class InetAddressesTest extends TestCase {

  public void testNulls() {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);
  }


            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 43

                  tester.testAllPublicStaticMethods(InetAddresses.class);
  }

  public void testForStringBogusInput() {
    ImmutableSet<String> bogusInputs =
        ImmutableSet.of(
            "",
            "016.016.016.016",
            "016.016.016",

            

Reported by PMD.

Do not hard code the IP address
Design

Line: 47

                  ImmutableSet<String> bogusInputs =
        ImmutableSet.of(
            "",
            "016.016.016.016",
            "016.016.016",
            "016.016",
            "016",
            "000.000.000.000",
            "000",

            

Reported by PMD.

Do not hard code the IP address
Design

Line: 51

                          "016.016.016",
            "016.016",
            "016",
            "000.000.000.000",
            "000",
            "0x0a.0x0a.0x0a.0x0a",
            "0x0a.0x0a.0x0a",
            "0x0a.0x0a",
            "0x0a",

            

Reported by PMD.