ursinn/DeadByDaylightMC

View on GitHub

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) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/events/MainEvents.java - About 5 hrs to fix

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);
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/events/MainEvents.java - About 5 hrs to fix

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());
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/events/MainEvents.java - About 5 hrs to fix

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;
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/ArenaEditor.java - About 4 hrs to fix

DGame has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

public class DGame {

    @Getter
    private final String id;
    @Getter
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/DGame.java - About 3 hrs to fix

PlayerStateManager has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

public class PlayerStateManager {

    private final DeadByDaylight main;

    public PlayerStateManager(DeadByDaylight main) {

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)) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/DArenaManager.java - About 3 hrs to fix

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;
        }
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 3 hrs to fix

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;
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/DGame.java - About 3 hrs to fix

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)) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/signs/SignEvents.java - About 3 hrs to fix

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);
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/ArenaEditor.java - About 3 hrs to fix

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;
        }
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/commands/ArenaCommands.java - About 3 hrs to fix

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;
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/events/MainEvents.java - About 3 hrs to fix

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 {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 3 hrs to fix

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)) {
Severity: Major
Found in src/main/java/noahnok/dbdl/files/game/DArenaManager.java - About 2 hrs to fix

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;
        }
Severity: Major
Found in src/main/java/noahnok/dbdl/files/commands/ArenaCommands.java - About 2 hrs to fix

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;
        }
Severity: Major
Found in src/main/java/noahnok/dbdl/files/commands/MainCommands.java - About 2 hrs to fix

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);
        }

Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/ArenaEditor.java - About 2 hrs to fix

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();
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/MatchMaking.java - About 2 hrs to fix

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;
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/ArenaEditor.java - About 2 hrs to fix

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

Severity
Category
Status
Source
Language