fujaba/NetworkParser

View on GitHub
src/test/java/de/uniks/ludo/model/util/PlayerSet.java

Summary

Maintainability
F
1 wk
Test Coverage

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;
Severity: Major
Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 day to fix

    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,
    Severity: Minor
    Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 3 hrs to fix

      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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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()]);
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.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 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;
              }
      Severity: Minor
      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

        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;
                }
        Severity: Minor
        Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr 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 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;
                }
        Severity: Minor
        Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr 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 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;
                }
        Severity: Minor
        Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

          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()]);
          Severity: Minor
          Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

            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()]);
            Severity: Minor
            Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

              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()]);
              Severity: Minor
              Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                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()]);
                Severity: Minor
                Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                  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()]);
                  Severity: Minor
                  Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                    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()]);
                    Severity: Minor
                    Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                      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()]);
                      Severity: Minor
                      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                        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()]);
                        Severity: Minor
                        Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                          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()]);
                          Severity: Minor
                          Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 1 hr to fix

                            Avoid too many return statements within this method.
                            Open

                                    return null;
                            Severity: Major
                            Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return true;
                              Severity: Major
                              Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return true;
                                Severity: Major
                                Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return element.getWonGame();
                                  Severity: Major
                                  Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return true;
                                    Severity: Major
                                    Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return true;
                                      Severity: Major
                                      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return element.setColor((String) value);
                                        Severity: Major
                                        Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                  return false;
                                          Severity: Major
                                          Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return element.getMeeple();
                                            Severity: Major
                                            Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return element.getStart();
                                              Severity: Major
                                              Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                            return element.getTarget();
                                                Severity: Major
                                                Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return element.getColor();
                                                  Severity: Major
                                                  Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                return element.getName();
                                                    Severity: Major
                                                    Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return true;
                                                      Severity: Major
                                                      Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return element.setName((String) value);
                                                        Severity: Major
                                                        Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                      return element.getPrev();
                                                          Severity: Major
                                                          Found in src/test/java/de/uniks/ludo/model/util/PlayerSet.java - About 30 mins to fix

                                                            There are no issues that match your filters.

                                                            Category
                                                            Status