Method process
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void process(Entity player) {
Preferences prefs = GameSettings.getPreferences();
int pathDrawRadius = prefs.getInteger(GameSettings.KEY_WEAPON_PATHDRAW_RADIUS);
- 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 handlePath
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private void handlePath(
InputComponent inComp,
Vector2 pos,
Camera camera
) {
- 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 process
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void process(Entity player) {
Preferences prefs = GameSettings.getPreferences();
int pathDrawRadius = prefs.getInteger(GameSettings.KEY_WEAPON_PATHDRAW_RADIUS);
Method handlePath
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void handlePath(
InputComponent inComp,
Vector2 pos,
Camera camera
) {
Method addInputConfigButtons
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void addInputConfigButtons(VisTable menuTable, final VisWindow menuWindow) {
final Preferences prefs = GameSettings.getPreferences();
int pathDrawRadius = prefs.getInteger(GameSettings.KEY_WEAPON_PATHDRAW_RADIUS, PATH_RADIUS_DEFAULT);
Method inputComponentDebugRender
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void inputComponentDebugRender(
Vector2 playerPos,
InputComponent inComp,
Vector2 mouse
) {
- 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 handleDrawing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void handleDrawing(Vector2 playerPos, InputComponent incComp, Vector2 mouse) {
Preferences prefs = GameSettings.getPreferences();
int pathDrawRadius = prefs.getInteger(GameSettings.KEY_WEAPON_PATHDRAW_RADIUS);
incComp.moveState = MoveState.PATH_FOLLOW;
- 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"