fujaba/NetworkParser

View on GitHub
src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java

Summary

Maintainability
D
1 day
Test Coverage

Method getValue has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public Object getValue(Object entity, String attrName) {
        if (attrName == null || entity instanceof Student == false) {
            return null;
        }

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 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public Object getValue(Object entity, String attrName) {
        if (attrName == null || entity instanceof Student == false) {
            return null;
        }

    Method setValue has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public boolean setValue(Object entity, String attribute, Object value, String typ) {
            if (attribute == null || entity instanceof Student == false) {
                return false;
            }

      Method setValue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public boolean setValue(Object entity, String attribute, Object value, String typ) {
              if (attribute == null || entity instanceof Student == false) {
                  return false;
              }

      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/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return student.getIn().get(attrName.substring(pos + 1));
        Severity: Major
        Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return student.getItem();
          Severity: Major
          Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return student.getUniversity();
            Severity: Major
            Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return student.getCredits();
              Severity: Major
              Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.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/networkparser/test/model/util/StudentCreator.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/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return student.getDynamicValues();
                    Severity: Major
                    Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return student.getIn();
                      Severity: Major
                      Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return student.getFirstName();
                        Severity: Major
                        Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.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/networkparser/test/model/util/StudentCreator.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/networkparser/test/model/util/StudentCreator.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/networkparser/test/model/util/StudentCreator.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/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return student.getLastName();
                                  Severity: Major
                                  Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            return student.getDynamicValue(attrName);
                                    Severity: Major
                                    Found in src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java - About 30 mins to fix

                                      There are no issues that match your filters.

                                      Category
                                      Status