Showing 103 of 213 total issues
Avoid deeply nested control flow statements. Open
if (eItem.getItem().getItemMeta().getDisplayName().equalsIgnoreCase(meta.getDisplayName())) {
item = eItem;
}
- Create a ticketCreate a ticket
Method initConnection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void initConnection() {
loadValues();
if (!main.getToggles().usingSQL) {
return;
}
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if (main.getSignManager().getSign(e.getClickedBlock()).getGame() != null) {
if (main.getSignManager().getSign(e.getClickedBlock()).getGame().equals(
main.getGameManager().getGamePlayerIsIn(e.getPlayer()))) {
e.getPlayer().sendMessage("You are already in a game!");
return;
- Create a ticketCreate a ticket
Method removePlayerFromGame
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void removePlayerFromGame(Player p, DGame game) {
DPlayer dPlayer = game.getPlayer(p.getUniqueId());
game.getPlayers().remove(dPlayer);
dPlayer.setStatus(PlayerStatus.OUT_OF_GAME);
game.announceLeave(p);
- Read upRead up
- Create a ticketCreate a ticket
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 editorBlockBreak
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void editorBlockBreak(BlockBreakEvent e) {
if (!main.getArenaEditor().editing.containsKey(e.getPlayer().getUniqueId())) {
for (DArena a : main.getArenaManager().getArenas()) {
if (isArenaBlock(a, e.getBlock().getLocation())) {
- Read upRead up
- Create a ticketCreate a ticket
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 reInitConnection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public boolean reInitConnection() {
loadValues();
try {
if (connection != null && !connection.isClosed()) {
- Read upRead up
- Create a ticketCreate a ticket
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 isHunter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public boolean isHunter(UUID id) {
for (DPlayer player : players) {
if (player.getId().equals(id)) {
if (player.getStatus() == PlayerStatus.HUNTER
|| player.getStatus() == PlayerStatus.CARRYING) {
- Read upRead up
- Create a ticketCreate a ticket
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 signBreakEvent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void signBreakEvent(BlockBreakEvent e) {
if (e.getBlock().getType().equals(Material.SIGN) || e.getBlock().getType().equals(Material.WALL_SIGN)) {
if (((Sign) e.getBlock().getState()).getLine(0).equals(signLine)) {
if (e.getPlayer().hasPermission("dbdl.sign.break")) {
- Read upRead up
- Create a ticketCreate a ticket
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 onDisable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onDisable() {
noJump.cancel();
for (UUID id : arenaEditor.editing.keySet()) {
- Read upRead up
- Create a ticketCreate a ticket
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;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket