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;
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);
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);
- Read upRead up
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.
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;
- Read upRead up
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) {
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");
- Read upRead up
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);
- Read upRead up
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));
- Read upRead up
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));
- Read upRead up
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);
- Read upRead up
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));
}
- Read upRead up
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));
- Read upRead up
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"