org.usfirst.frc.team3695.robot.commands.ToggleCommandReverse   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 6

10 Methods

Rating   Name   Duplication   Size   Complexity  
isFinished 0 1 ?
interrupted 0 2 ?
end 0 2 ?
initialize 0 1 ?
A initialize() 0 1 1
A isFinished() 0 1 1
A interrupted() 0 2 1
A ToggleCommandReverse() 0 3 1
A execute() 0 3 1
A end() 0 2 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.command.Command;
4
import org.usfirst.frc.team3695.robot.Robot;
5
6
/** toggles the state of the clamp */
7
public class ToggleCommandReverse extends Command {
8
9
    boolean isFinished;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like isFinished. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
10
    public ToggleCommandReverse() {
11
        requires(Robot.SUB_DRIVE);
12
        isFinished = false;
13
    }
14
15
    protected void initialize() {}
16
17
    protected void execute() {
18
        Robot.SUB_DRIVE.toggleReversing();
19
        isFinished = true;
20
    }
21
22
    protected boolean isFinished() { return isFinished; }
23
24
    protected void end() {
25
        isFinished = false;
26
    }
27
28
    protected void interrupted() {
29
        end();
30
    }
31
}
32