File DiceController.java
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.ext.javafx;
/*
NetworkParser
The MIT License
DiceController
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
public class DiceController extends SendableItem
implements PropertyChangeListener, SendableEntityCreator, ObjectCondition {
public static final String PROPERTY_CLICK = "click";
public static final String PROPERTY_VALUE = "value";
public static final String STOPPED = "STOPPED";
Method showAnimation
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
public DiceController showAnimation(int number) {
if(pane == null) {
return this;
}
Method addListener
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean addListener(Object item, String property, PropertyChangeListener listener) {
if (item == null) {
return false;
}
GenericCreator creator = new GenericCreator(item);
Method addListener
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public boolean addListener(Object item, String property, PropertyChangeListener listener) {
if (item == null) {
return false;
}
GenericCreator creator = new GenericCreator(item);
- 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 showNumber
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public void showNumber(int number) {
this.reset();
if (number == 1) {
this.addCircle(2, 2);
} else if (number == 2) {
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Method update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean update(Object value) {
if(mouseEventClass == null || value == null) {
return false;
}
- 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"