Showing 213 of 213 total issues
Method blockInteract
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void blockInteract(PlayerInteractEvent e) {
DGame game = main.getGameManager().getGamePlayerIsIn(e.getPlayer());
if (game != null && game.getStatus() == STATUS.INGAME) {
- 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 huntedDies
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void huntedDies(EntityDamageByEntityEvent e) {
if (e.getEntity() instanceof Player && e.getDamager() instanceof Firework) {
if (e.getDamager().getCustomName().equals("DBDL-FIREWORK")) {
e.setCancelled(true);
- 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 sneakMenu
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void sneakMenu(PlayerToggleSneakEvent e) {
if (!e.isSneaking()) {
DGame game = main.getGameManager().getGamePlayerIsIn(e.getPlayer());
- 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
File ArenaEditor.java
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
package noahnok.dbdl.files.utils;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import noahnok.dbdl.files.DeadByDaylight;
- Create a ticketCreate a ticket
DGame
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
public class DGame {
@Getter
private final String id;
@Getter
- Create a ticketCreate a ticket
PlayerStateManager
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
public class PlayerStateManager {
private final DeadByDaylight main;
public PlayerStateManager(DeadByDaylight main) {
- Create a ticketCreate a ticket
Method loadArenasFromFile
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public void loadArenasFromFile() {
if (main.getArenasConfig().getConfig().get("arenas") == null) {
return;
}
for (String key : main.getArenasConfig().getConfig().getConfigurationSection("arenas").getKeys(false)) {
- 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 editorBlockPlace
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void editorBlockPlace(BlockPlaceEvent e) {
if (!main.getArenaEditor().editing.containsKey(e.getPlayer().getUniqueId())) {
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
File DGame.java
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
package noahnok.dbdl.files.game;
import lombok.Getter;
import lombok.Setter;
import net.md_5.bungee.api.ChatMessageType;
- Create a ticketCreate a ticket
Method signInteract
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void signInteract(PlayerInteractEvent e) {
if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
if (e.getClickedBlock().getType().equals(Material.SIGN) ||
e.getClickedBlock().getType().equals(Material.WALL_SIGN)) {
- 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 setUpItems
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void setUpItems() {
generator = new EditorItem(new ItemStack(Material.FURNACE, 1), "&bGenerator")
.addExecutor((Player p, Location bloc) -> {
p.sendMessage("Generator placed!");
editing.get(p.getUniqueId()).getPossibleGeneratorLocations().add(bloc);
- Create a ticketCreate a ticket
Method onCommand
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if (!(commandSender instanceof Player)) {
commandSender.sendMessage(main.prefix + "Only players can use this command!");
return true;
}
- 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 canMove
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void canMove(PlayerMoveEvent e) {
DPlayer dPlayer = main.getDPlayerManager().getPlayer(e.getPlayer().getUniqueId());
if (dPlayer == null) {
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
Method editorBlockBreakEntity
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
@EventHandler
public void editorBlockBreakEntity(PlayerInteractAtEntityEvent e) {
if (!main.getArenaEditor().editing.containsKey(e.getPlayer().getUniqueId())) {
Shulker shulker;
try {
- 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 loadArenasFromFile
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void loadArenasFromFile() {
if (main.getArenasConfig().getConfig().get("arenas") == null) {
return;
}
for (String key : main.getArenasConfig().getConfig().getConfigurationSection("arenas").getKeys(false)) {
- Create a ticketCreate a ticket
Method onCommand
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if (!(commandSender instanceof Player)) {
commandSender.sendMessage(main.prefix + "Only players can use this command!");
return true;
}
- Create a ticketCreate a ticket
Method onCommand
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if (!(commandSender instanceof Player)) {
commandSender.sendMessage(main.prefix + "Only players can use this command!");
return true;
}
- Create a ticketCreate a ticket
Method hideArenaBlocks
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private void hideArenaBlocks(final DArena a) {
for (Location loc : a.getPossibleGeneratorLocations()) {
removeShulker(loc, a);
}
- 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 addToMatchmaking
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public boolean addToMatchmaking(Player p, String playType) {
//Check if there are any available games
if (waitingGames.isEmpty()) {
//Try and create a new game
DGame game = main.getGameManager().createNewGame();
- 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 toggleEditing
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public void toggleEditing(Player p, String arena) {
DArena a = main.getArenaManager().isArena(arena);
if (a == null) {
p.sendMessage("Not a valid arena!");
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"