fujaba/NetworkParser

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

Summary

Maintainability
D
2 days
Test Coverage

File Pattern.java has 325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.graph;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
Severity: Minor
Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 3 hrs to fix

    Method finding has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        private boolean finding(boolean save) {
            /* Backwards */
            
            if (findCondition(null) == false) {
                /* Not found */
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Pattern.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

    Pattern has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Pattern implements Iterator<Object>, Iterable<Object>, ObjectCondition {
        public static final String MODIFIER_SEARCH = "search";
        public static final String MODIFIER_CHANGE = "change";
        public static final String MODIFIER_ADD = "add";
        public static final String MODIFIER_REMOVE = "remove";
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 3 hrs to fix

      Method appling has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean appling() {
              if (condition instanceof PatternCondition == false) {
                  return false;
              }
              PatternCondition patternCondition = (PatternCondition) condition;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Pattern.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 findCondition has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private boolean findCondition(String modifier) {
              if(condition == null) {
                  return false;
              }
              if(condition instanceof Pattern) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Pattern.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 appling has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean appling() {
              if (condition instanceof PatternCondition == false) {
                  return false;
              }
              PatternCondition patternCondition = (PatternCondition) condition;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 1 hr to fix

        Method finding has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private boolean finding(boolean save) {
                /* Backwards */
                
                if (findCondition(null) == false) {
                    /* Not found */
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 1 hr to fix

          Method update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public boolean update(Object value) {
                  if(value == null) {
                      return false;
                  }
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 1 hr to fix

            Method update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public boolean update(Object value) {
                    if(value == null) {
                        return false;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 55 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/de/uniks/networkparser/graph/Pattern.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return false;
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/graph/Pattern.java - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status