fujaba/NetworkParser

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

Summary

Maintainability
D
1 day
Test Coverage

Method decode has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public Annotation decode(BufferItem tokener, char endTag, Annotation parent) {
        if (tokener == null) {
            return null;
        }
        char item = tokener.getCurrentChar();
Severity: Minor
Found in src/main/java/de/uniks/networkparser/graph/Annotation.java - About 4 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 decode has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Annotation decode(BufferItem tokener, char endTag, Annotation parent) {
        if (tokener == null) {
            return null;
        }
        char item = tokener.getCurrentChar();
Severity: Major
Found in src/main/java/de/uniks/networkparser/graph/Annotation.java - About 2 hrs to fix

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

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append(this.name);
            if (children == null) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Annotation.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 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public SimpleList<Annotation> getValue() {
            SimpleList<Annotation> list = new SimpleList<Annotation>();
            if (children != null) {
                if (children instanceof Annotation) {
                    list.add(children);
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Annotation.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 toString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append(this.name);
            if (children == null) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Annotation.java - About 1 hr to fix

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

          public static Annotation create(String value, String... values) {
              Annotation annotation = new Annotation();
              if (values == null || values.length < 1) {
                  annotation.decode(value);
              } else {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Annotation.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 too many return statements within this method.
      Open

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

        Method addValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            protected Annotation addValue(Annotation... values) {
                if (values == null) {
                    return this;
                }
                SimpleList<?> list;
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/graph/Annotation.java - About 25 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 withKeyValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public Annotation withKeyValue(String key, String value) {
                this.name = key;
                this.keyValue = true;
                SimpleList<Annotation> list = new SimpleList<Annotation>();
                if (value != null && value.length() > 0) {
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/graph/Annotation.java - About 25 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

        There are no issues that match your filters.

        Category
        Status