fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/graph/Method.java

Summary

Maintainability
C
1 day
Test Coverage

Method has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Method extends GraphMember {
    public static final String PROPERTY_RETURNTYPE = "returnType";
    public static final String PROPERTY_PARAMETER = "parameter";
    public static final String PROPERTY_PARAMETERNAME = "parameterName";
    public static final String PROPERTY_NODE = "node";
Severity: Minor
Found in src/main/java/de/uniks/networkparser/graph/Method.java - About 2 hrs to fix

    Method getParameterString has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        CharacterBuffer getParameterString(boolean shortName, boolean removeParameterNames, boolean optimizeArray) {
            CharacterBuffer sb = new CharacterBuffer().with("(");
            GraphSimpleSet collection = this.getChildren();
            for (int i = 0; i < collection.size(); i++) {
                if ((collection.get(i) instanceof Parameter) == false) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Method.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 with has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public Method with(Annotation value) {
            if (this.children != null) {
                if (this.children instanceof Annotation) {
                    this.children = null;
                } else if (this.children instanceof GraphSimpleSet) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Method.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 getParameters has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public ParameterSet getParameters(Condition<?>... filters) {
            ParameterSet collection = new ParameterSet();
            if (children == null) {
                return collection;
            }
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Method.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 getParameterString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        CharacterBuffer getParameterString(boolean shortName, boolean removeParameterNames, boolean optimizeArray) {
            CharacterBuffer sb = new CharacterBuffer().with("(");
            GraphSimpleSet collection = this.getChildren();
            for (int i = 0; i < collection.size(); i++) {
                if ((collection.get(i) instanceof Parameter) == false) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Method.java - About 1 hr to fix

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

          public SimpleSet<Throws> getThrows() {
              SimpleSet<Throws> collection = new SimpleSet<Throws>();
              if (children == null) {
                  return collection;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Method.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

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

          @Override
          public Object getValue(String attribute) {
              if (PROPERTY_RETURNTYPE.equalsIgnoreCase(attribute)) {
                  return this.getReturnType();
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Method.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 isValidReturn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean isValidReturn() {
              if (getReturnType() == null || DataType.VOID.equals(getReturnType())) {
                  return true;
              }
              if (this.body == null) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Method.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 false;
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/graph/Method.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return this.getNodes();
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/graph/Method.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return super.getValue(attribute);
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/graph/Method.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return this.getBody();
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/graph/Method.java - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status