wh1ter0se/PowerUp-2018

View on GitHub

Showing 13 of 39 total issues

SubsystemDrive has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

public class SubsystemDrive extends Subsystem {


    private static TalonSRX leftMaster;
    private static TalonSRX leftSlave;
Severity: Minor
Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemDrive.java - About 2 hrs to fix

    Method robotInit has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void robotInit() {
            /// instantiate bot chooser
            botChooser = new SendableChooser<>();
            botChooser.addDefault(Bot.TEUFELSKIND.toString(), Bot.TEUFELSKIND);
            botChooser.addObject(Bot.OOF.toString(), Bot.OOF);
    Severity: Minor
    Found in src/org/usfirst/frc/team3695/robot/Robot.java - About 1 hr to fix

      Method driveForza has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public void driveForza(Joystick joy, double ramp, double radius, double inhibitor) {
              double left = 0,
                      right = 0;
              double acceleration = Xbox.RT(joy) - Xbox.LT(joy);
      
      Severity: Minor
      Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemDrive.java - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method concatCameraStream has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void concatCameraStream() {
              cameraLeft = CameraServer.getInstance().startAutomaticCapture("Left", VisionConstants.LEFT_ID);
              cameraRight = CameraServer.getInstance().startAutomaticCapture("Right", VisionConstants.RIGHT_ID);
      
              /// Dummy sinks to keep camera connections open.
      Severity: Minor
      Found in src/org/usfirst/frc/team3695/robot/Vision.java - About 1 hr to fix

        Method moveBySpeed has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public void moveBySpeed(Joystick joy, double inhibitor) {
                double dualAction = Xbox.RT(joy) - Xbox.LT(joy);
                double screwSpeed = Xbox.LEFT_Y(joy) + dualAction;
                double pinionSpeed = Xbox.RIGHT_Y(joy) + dualAction;
                
        Severity: Minor
        Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemMast.java - About 55 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method setPIDF has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                public static void setPIDF(TalonSRX _talon, Boolean invert, double p, double i, double d, double f) {
        Severity: Minor
        Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemDrive.java - About 45 mins to fix

          Method screwCameraStream has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private void screwCameraStream(){
          
                  cameraScrew = CameraServer.getInstance().startAutomaticCapture("Screw", VisionConstants.SCREW_ID);
                  
                  CvSink cvsinkScrew = new CvSink("screwSink");
          Severity: Minor
          Found in src/org/usfirst/frc/team3695/robot/Vision.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method frameCameraStream has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private void frameCameraStream(){
                  cameraFrame = CameraServer.getInstance().startAutomaticCapture("Frame", VisionConstants.HOOK_ID);
                  
                  CvSink cvsinkFrame = new CvSink("frameSink");
                  cvsinkFrame.setSource(cameraFrame);
          Severity: Minor
          Found in src/org/usfirst/frc/team3695/robot/Vision.java - About 45 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method driveRLTank has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void driveRLTank(Joystick joy, double ramp, double inhibitor) {
                  double adder = Xbox.RT(joy) - Xbox.LT(joy);
                  double left = adder + (Xbox.LEFT_X(joy) / 1.333333);
                  double right = adder - (Xbox.LEFT_X(joy) / 1.333333);
                  left = (left > 1.0 ? 1.0 : (left < -1.0 ? -1.0 : left));
          Severity: Minor
          Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemDrive.java - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method adjustPinion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void adjustPinion(Position direction){
          
                  if (direction == Position.UP) {
                      while (!upperPinionLimit.get()) {
                          rightPinion.set(ControlMode.PercentOutput, rightPinionate(1));
          Severity: Minor
          Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemMast.java - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function show(type)
          {
              count = 0;
              for (var key in methods) {
                  var row = document.getElementById(key);
          Severity: Minor
          Found in wpilib18/java/current/javadoc/script.js - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method adjustScrew has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void adjustScrew(Position direction){
                  if (direction == Position.UP){
                      while (!upperScrewLimit.get()){
                          screw.set(ControlMode.PercentOutput, screwify(1));
                      }
          Severity: Minor
          Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemMast.java - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method driveDirect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void driveDirect(double left, double right) {
                  left = (left > 1.0 ? 1.0 : (left < -1.0 ? -1.0 : left));
                  right = (right > 1.0 ? 1.0 : (right < -1.0 ? -1.0 : right));
                  leftMaster.set(ControlMode.PercentOutput, leftify(left));
                  rightMaster.set(ControlMode.PercentOutput, rightify(right));
          Severity: Minor
          Found in src/org/usfirst/frc/team3695/robot/subsystems/SubsystemDrive.java - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language