File PlayerSet.java
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.ludo.model.util;
import de.uniks.networkparser.interfaces.SendableEntityCreator;
import de.uniks.ludo.model.Player;
import de.uniks.networkparser.list.SimpleSet;
import de.uniks.ludo.model.Home;
PlayerSet
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
public class PlayerSet extends SimpleSet<Player> implements SendableEntityCreator {
private final String[] properties = new String[] {
Player.PROPERTY_HOME,
Player.PROPERTY_CURRENTGAME,
Method getHome
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public HomeSet getHome(Home... filter) {
HomeSet result = new HomeSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getPrev
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public PlayerSet getPrev(Player... filter) {
PlayerSet result = new PlayerSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getCurrentGame
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public LudoSet getCurrentGame(Ludo... filter) {
LudoSet result = new LudoSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getWonGame
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public LudoSet getWonGame(Ludo... filter) {
LudoSet result = new LudoSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getName
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public StringList getName(String... filter) {
StringList result = new StringList();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getMeeple
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public MeepleSet getMeeple(Meeple... filter) {
MeepleSet result = new MeepleSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getNext
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public PlayerSet getNext(Player... filter) {
PlayerSet result = new PlayerSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getStart
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public StartSet getStart(Start... filter) {
StartSet result = new StartSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getGame
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public LudoSet getGame(Ludo... filter) {
LudoSet result = new LudoSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getColor
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public StringList getColor(String... filter) {
StringList result = new StringList();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 getTarget
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public TargetSet getTarget(Target... filter) {
TargetSet result = new TargetSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
- 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 setValue
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public boolean setValue(Object entity, String attribute, Object value, String type) {
if(attribute == null || entity instanceof Player == false) {
return false;
}
Method setValue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean setValue(Object entity, String attribute, Object value, String type) {
if(attribute == null || entity instanceof Player == false) {
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"
Further reading
Method getValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Object getValue(Object entity, String attribute) {
if(attribute == null || entity instanceof Player == false) {
return null;
}
- 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 getValue
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Object getValue(Object entity, String attribute) {
if(attribute == null || entity instanceof Player == false) {
return null;
}
Method getTarget
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public TargetSet getTarget(Target... filter) {
TargetSet result = new TargetSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getHome
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public HomeSet getHome(Home... filter) {
HomeSet result = new HomeSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getCurrentGame
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public LudoSet getCurrentGame(Ludo... filter) {
LudoSet result = new LudoSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getPrev
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PlayerSet getPrev(Player... filter) {
PlayerSet result = new PlayerSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getNext
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PlayerSet getNext(Player... filter) {
PlayerSet result = new PlayerSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getStart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public StartSet getStart(Start... filter) {
StartSet result = new StartSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getGame
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public LudoSet getGame(Ludo... filter) {
LudoSet result = new LudoSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getMeeple
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public MeepleSet getMeeple(Meeple... filter) {
MeepleSet result = new MeepleSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Method getWonGame
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public LudoSet getWonGame(Ludo... filter) {
LudoSet result = new LudoSet();
if(listener != null) {
result.withListener(listener);
Player[] children = this.toArray(new Player[size()]);
Avoid too many return
statements within this method. Open
return null;
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 element.getWonGame();
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 element.setColor((String) value);
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return element.getMeeple();
Avoid too many return
statements within this method. Open
return element.getStart();
Avoid too many return
statements within this method. Open
return element.getTarget();
Avoid too many return
statements within this method. Open
return element.getColor();
Avoid too many return
statements within this method. Open
return element.getName();
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return element.setName((String) value);
Avoid too many return
statements within this method. Open
return element.getPrev();