[build] Globally Exclude PMD.TooManyMethods (#2793)

This was not a useful check, as every time we hit it, we simply excluded it.
This commit is contained in:
Austin Shalit
2020-10-22 23:53:48 -04:00
committed by GitHub
parent fb7b41793b
commit 6e7c7374fd
48 changed files with 28 additions and 61 deletions

View File

@@ -25,7 +25,6 @@ import edu.wpi.first.hal.HAL;
* read methods and the byte[] passed into the write methods need to not
* be modified for the duration of their respective calls.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class CAN implements Closeable {
public static final int kTeamManufacturer = 8;
public static final int kTeamDeviceType = 10;

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -39,7 +39,6 @@ import edu.wpi.first.networktables.NetworkTableInstance;
*
* @deprecated Replaced with edu.wpi.first.cameraserver.CameraServer
*/
@SuppressWarnings("PMD.TooManyMethods")
@Deprecated
public final class CameraServer {
public static final int kBasePort = 1181;

View File

@@ -25,8 +25,7 @@ import edu.wpi.first.networktables.NetworkTableInstance;
* Provide access to the network communication data to / from the Driver Station.
*/
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.ExcessiveClassLength",
"PMD.ExcessivePublicCount", "PMD.GodClass", "PMD.TooManyFields",
"PMD.TooManyMethods"})
"PMD.ExcessivePublicCount", "PMD.GodClass", "PMD.TooManyFields"})
public class DriverStation {
/**
* Number of Joystick Ports.

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -22,7 +22,7 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
* <p>This class is intended to be used by sensor (and other I2C device) drivers. It probably should
* not be used directly.
*/
@SuppressWarnings({"PMD.GodClass", "PMD.TooManyMethods"})
@SuppressWarnings("PMD.GodClass")
public class I2C implements AutoCloseable {
public enum Port {
kOnboard(0), kMXP(1);

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -16,7 +16,6 @@ import edu.wpi.first.hal.util.AllocationException;
/**
* Base for sensors to be used with interrupts.
*/
@SuppressWarnings("PMD.TooManyMethods")
public abstract class InterruptableSensorBase implements AutoCloseable {
@SuppressWarnings("JavadocMethod")
public enum WaitResult {

View File

@@ -42,7 +42,6 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
* - teleopPeriodic()
* - testPeriodic()
*/
@SuppressWarnings("PMD.TooManyMethods")
public abstract class IterativeRobotBase extends RobotBase {
protected double m_period;

View File

@@ -31,7 +31,6 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
* <p> This will also interact with {@link NetworkTable} by creating a table called "Preferences"
* with all the key-value pairs. </p>
*/
@SuppressWarnings("PMD.TooManyMethods")
public final class Preferences {
/**
* The Preferences table name.

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -25,7 +25,7 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
* or {@link edu.wpi.first.wpilibj.drive.MecanumDrive} classes instead.
*/
@Deprecated
@SuppressWarnings({"PMD.GodClass", "PMD.TooManyMethods"})
@SuppressWarnings("PMD.GodClass")
public class RobotDrive extends MotorSafety implements AutoCloseable {
/**
* The location of a motor on the robot for the purpose of driving.

View File

@@ -19,7 +19,7 @@ import edu.wpi.first.hal.SPIJNI;
/**
* Represents a SPI bus port.
*/
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.TooManyMethods"})
@SuppressWarnings("PMD.CyclomaticComplexity")
public class SPI implements AutoCloseable {
public enum Port {
kOnboardCS0(0), kOnboardCS1(1), kOnboardCS2(2), kOnboardCS3(3), kMXP(4);

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -16,7 +16,6 @@ import edu.wpi.first.hal.SerialPortJNI;
/**
* Driver for the serial ports (USB, MXP, Onboard) on the roboRIO.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class SerialPort implements AutoCloseable {
private int m_portHandle;

View File

@@ -21,7 +21,6 @@ import edu.wpi.first.hal.NotifierJNI;
*
* <p>The watchdog is initialized disabled, so the user needs to call enable() before use.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class Watchdog implements Closeable, Comparable<Watchdog> {
// Used for timeout print rate-limiting
private static final long kMinPrintPeriod = 1000000; // microseconds

View File

@@ -18,7 +18,6 @@ import edu.wpi.first.wpilibj.trajectory.TrapezoidProfile;
* profile. Users should call reset() when they first start running the controller
* to avoid unwanted behavior.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class ProfiledPIDController implements Sendable {
private static int instances;

View File

@@ -27,7 +27,6 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableRegistry;
/**
* A helper class for Shuffleboard containers to handle common child operations.
*/
@SuppressWarnings("PMD.TooManyMethods")
final class ContainerHelper {
private final ShuffleboardContainer m_container;
private final Set<String> m_usedTitles = new HashSet<>();

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -19,7 +19,6 @@ import edu.wpi.first.wpilibj.Sendable;
/**
* Common interface for objects that can contain shuffleboard components.
*/
@SuppressWarnings("PMD.TooManyMethods")
public interface ShuffleboardContainer extends ShuffleboardValue {
/**

View File

@@ -21,7 +21,6 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
/**
* A layout in a Shuffleboard tab. Layouts can contain widgets and other layouts.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class ShuffleboardLayout extends ShuffleboardComponent<ShuffleboardLayout>
implements ShuffleboardContainer {
private final ContainerHelper m_helper = new ContainerHelper(this);

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -22,7 +22,6 @@ import edu.wpi.first.wpilibj.Sendable;
* can also be added to layouts with {@link #getLayout(String, String)}; layouts can be nested
* arbitrarily deep (note that too many levels may make deeper components unusable).
*/
@SuppressWarnings("PMD.TooManyMethods")
public final class ShuffleboardTab implements ShuffleboardContainer {
private final ContainerHelper m_helper = new ContainerHelper(this);
private final ShuffleboardRoot m_root;

View File

@@ -14,7 +14,6 @@ import edu.wpi.first.wpilibj.AnalogInput;
/**
* Class to control a simulated analog input.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class AnalogInputSim {
private final int m_index;

View File

@@ -15,7 +15,6 @@ import java.util.NoSuchElementException;
/**
* Class to control a simulated encoder.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class EncoderSim {
private final int m_index;

View File

@@ -13,7 +13,7 @@ import edu.wpi.first.hal.simulation.RoboRioDataJNI;
/**
* Class to control a simulated RoboRIO.
*/
@SuppressWarnings({"PMD.ExcessivePublicCount", "PMD.TooManyMethods", "PMD.UseUtilityClass"})
@SuppressWarnings({"PMD.ExcessivePublicCount", "PMD.UseUtilityClass"})
public class RoboRioSim {
public static CallbackStore registerFPGAButtonCallback(NotifyCallback callback,
boolean initialNotify) {

View File

@@ -21,7 +21,6 @@ import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableValue;
@SuppressWarnings("PMD.TooManyMethods")
public class SendableBuilderImpl implements SendableBuilder {
private static class Property {
Property(NetworkTable table, String key) {

View File

@@ -24,7 +24,6 @@ import edu.wpi.first.wpilibj.Sendable;
* The SendableRegistry class is the public interface for registering sensors
* and actuators for use on dashboards and LiveWindow.
*/
@SuppressWarnings("PMD.TooManyMethods")
public class SendableRegistry {
private static class Component {
Component() {}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -26,7 +26,7 @@ import edu.wpi.first.wpilibj.Sendable;
* <p>When a value is put into the SmartDashboard here, it pops up on the SmartDashboard on the
* laptop. Users can put values into and get values from the SmartDashboard.
*/
@SuppressWarnings({"PMD.GodClass", "PMD.TooManyMethods"})
@SuppressWarnings("PMD.GodClass")
public final class SmartDashboard {
/**
* The {@link NetworkTable} used by {@link SmartDashboard}.