ursinn/DeadByDaylightMC

View on GitHub

Showing 103 of 213 total issues

Avoid deeply nested control flow statements.
Open

                        if (eItem.getItem().getItemMeta().getDisplayName().equalsIgnoreCase(meta.getDisplayName())) {
                            item = eItem;
                        }
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 45 mins to fix

Method initConnection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public void initConnection() {
        loadValues();
        if (!main.getToggles().usingSQL) {
            return;
        }
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/mysql/MySQL_Connect.java - About 45 mins 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

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;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/signs/SignEvents.java - About 45 mins to fix

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);
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/DGameManager.java - About 35 mins 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 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())) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 35 mins 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 reInitConnection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean reInitConnection() {
        loadValues();

        try {
            if (connection != null && !connection.isClosed()) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/utils/mysql/MySQL_Connect.java - About 35 mins 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 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) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/game/DGame.java - About 35 mins 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 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")) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/signs/SignEvents.java - About 35 mins 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 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()) {
Severity: Minor
Found in src/main/java/noahnok/dbdl/files/DeadByDaylight.java - About 35 mins 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

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/commands/ArenaCommands.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/commands/ArenaCommands.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/commands/ArenaCommands.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/commands/ArenaCommands.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/mysql/MySQL_Connect.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return true;
Severity: Major
Found in src/main/java/noahnok/dbdl/files/utils/editor/item/EditorEvents.java - About 30 mins to fix
Severity
Category
Status
Source
Language