fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/list/AbstractArray.java

Summary

Maintainability
F
2 wks
Test Coverage

File AbstractArray.java has 1224 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.list;

/*
 * NetworkParser The MIT License Copyright (c) 2010-2016 Stefan Lindel
 * https://www.github.com/fujaba/NetworkParser/
Severity: Major
Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 3 days to fix

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

      public Object getValue(Object key) {
        int pos = indexOf(key);
        if (pos >= 0) {
          if ((flag & MAP) == MAP) {
            return this.getByIndex(SMALL_VALUE, pos + index, size);
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 day 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

    AbstractArray has 78 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public abstract class AbstractArray<V> implements BaseItem {
      /** Is Allow Duplicate Items in List */
      public static final byte ALLOWDUPLICATE = 0x01;
      /** Is Allow Empty Value in List (null) */
      public static final byte ALLOWEMPTYVALUE = 0x02;
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 day to fix

      Method removeItem has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

        protected Object removeItem(int index, int offset, int oldIndex) {
          if (elements == null) {
            return null;
          }
          Object[] items;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 5 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 grow has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        int grow(int minCapacity) {
          int arrayFlag = getArrayFlag(minCapacity);
          if (elements == null) {
            /* Init List */
            int newSize = minCapacity + minCapacity / 2 + 5;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 getPosition has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

        int getPosition(Object o, int offset, boolean last) {
          if (o == null || elements == null) {
            return REMOVED;
          }
          Object[] hashCodes;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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

      Method getValue has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public Object getValue(Object key) {
          int pos = indexOf(key);
          if (pos >= 0) {
            if ((flag & MAP) == MAP) {
              return this.getByIndex(SMALL_VALUE, pos + index, size);
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 3 hrs to fix

        Method removeItem has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          protected Object removeItem(int index, int offset, int oldIndex) {
            if (elements == null) {
              return null;
            }
            Object[] items;
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 2 hrs to fix

          Method removeByIndex has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

            protected Object removeByIndex(int index, int offset, int offsetIndex) {
              Object item = removeItem(index, offset, offsetIndex);
              if (item != null) {
                size--;
                if (shrink(size) == false) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 addKey has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

            protected int addKey(int pos, Object element, int size) {
              Object[] keys;
          
              if (isComplex(size)) {
                keys = (Object[]) elements[SMALL_KEY];
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 containsAny has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            public boolean containsAny(Object... c) {
              if (c == null || c.length < 1)
                return false;
              if (c.length > 1) {
                for (Object e : c) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 hashKeyPos has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

            final int hashKeyPos(Object element, int size) {
              if (element == null || isReadOnly()) {
                return REMOVED;
              }
              if (isComparator()) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 shrink has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

            boolean shrink(int minCapacity) {
              /* Shrink the Array */
              if (minCapacity == 0) {
                elements = null;
                this.index = 0;
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 grow has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            int grow(int minCapacity) {
              int arrayFlag = getArrayFlag(minCapacity);
              if (elements == null) {
                /* Init List */
                int newSize = minCapacity + minCapacity / 2 + 5;
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 2 hrs to fix

            Method getPosition has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              int getPosition(Object o, int offset, boolean last) {
                if (o == null || elements == null) {
                  return REMOVED;
                }
                Object[] hashCodes;
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 2 hrs to fix

              Method addKeyValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                protected int addKeyValue(int pos, Object key, Object value) {
                  Object[] keys = (Object[]) elements[SMALL_KEY];
                  Object[] values = (Object[]) elements[SMALL_VALUE];
                  if (pos == 0 && this.size > 0) {
                    if (this.index == 0) {
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 withList has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                public AbstractArray<V> withList(Collection<?> list) {
                  if (list == null || this.size + list.size() == 0) {
                    return this;
                  }
                  int newSize = this.size + list.size();
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 addKey has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                protected int addKey(int pos, Object element, int size) {
                  Object[] keys;
              
                  if (isComplex(size)) {
                    keys = (Object[]) elements[SMALL_KEY];
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

                Method shrink has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  boolean shrink(int minCapacity) {
                    /* Shrink the Array */
                    if (minCapacity == 0) {
                      elements = null;
                      this.index = 0;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

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

                    public boolean move(int from, int to) {
                      if (from == to) {
                        return true;
                      }
                      if (from < 0 || to < 0 || from > size() || to > size()) {
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

                    Method getByIndex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      protected Object getByIndex(int offset, int index, int size) {
                        if (size == 0 || elements == null) {
                          return null;
                        }
                        if (index < 0) {
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 search has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      int search(Object[] items, Object o) {
                        int pos = this.index;
                        if (pos == 0) {
                          while (pos < this.size) {
                            if (checkValue(o, items[pos])) {
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 hasKeyAndPos has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      protected int hasKeyAndPos(Object element) {
                        if (element == null || isReadOnly())
                          return REMOVED;
                        if (isComparator()) {
                          for (int i = 0; i < this.size; i++) {
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 addKeyValue has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      protected int addKeyValue(int pos, Object key, Object value) {
                        Object[] keys = (Object[]) elements[SMALL_KEY];
                        Object[] values = (Object[]) elements[SMALL_VALUE];
                        if (pos == 0 && this.size > 0) {
                          if (this.index == 0) {
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

                      Method clear has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        public void clear() {
                          int arrayFlag = getArrayFlag(size);
                          if (arrayFlag < 1) {
                            this.elements = null;
                            return;
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

                        Method toString has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          public String toString() {
                            StringBuilder sb = new StringBuilder();
                            if ((flag & BIDI) > 0) {
                              sb.append("BIDI-Map ");
                            } else if ((flag & MAP) > 0) {
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

                          Method removeByIndex has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            protected Object removeByIndex(int index, int offset, int offsetIndex) {
                              Object item = removeItem(index, offset, offsetIndex);
                              if (item != null) {
                                size--;
                                if (shrink(size) == false) {
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 1 hr to fix

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

                              public String toString() {
                                StringBuilder sb = new StringBuilder();
                                if ((flag & BIDI) > 0) {
                                  sb.append("BIDI-Map ");
                                } else if ((flag & MAP) > 0) {
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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

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

                              public boolean move(int from, int to) {
                                if (from == to) {
                                  return true;
                                }
                                if (from < 0 || to < 0 || from > size() || to > size()) {
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 fireProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              protected boolean fireProperty(String type, Object oldElement, Object newElement, Object beforeElement, int index,
                                  Object value) {
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 45 mins to fix

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

                                public void clear() {
                                  int arrayFlag = getArrayFlag(size);
                                  if (arrayFlag < 1) {
                                    this.elements = null;
                                    return;
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                @Override
                                public boolean add(Object... values) {
                                  if (values == null || values.length < 1) {
                                    return false;
                                  }
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 transformIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                private int transformIndex(int index, int size) {
                                  if (elements[DELETED] != null) {
                                    Object[] items = (Object[]) elements[DELETED];
                                    for (int i = 0; i < items.length; i++) {
                                      if (((Integer) items[i]) > index) {
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 parseItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                protected String parseItem(EntityStringConverter converter) {
                                  CharacterBuffer sb = new CharacterBuffer();
                                  int len = this.size();
                                  for (int i = 0; i < len; i++) {
                                    Object key = getKeyByIndex(i);
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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/list/AbstractArray.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                      return REMOVED;
                                Severity: Major
                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return child;
                                  Severity: Major
                                  Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                        return minCapacity;
                                    Severity: Major
                                    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

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

                                        Avoid too many return statements within this method.
                                        Open

                                                  return newSize * 2;
                                        Severity: Major
                                        Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                    return newSize * 2;
                                          Severity: Major
                                          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                return size;
                                            Severity: Major
                                            Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return ((SimpleKeyValueList<?, ?>) list.get(id)).getValue(keyString.substring(end + 1));
                                              Severity: Major
                                              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                        return ((AbstractArray<?>) child).getValue(keyString.substring(end + 1));
                                                Severity: Major
                                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return list.get(id);
                                                  Severity: Major
                                                  Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                        return indexItem;
                                                    Severity: Major
                                                    Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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/list/AbstractArray.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                            return 1;
                                                        Severity: Major
                                                        Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                  return REMOVED;
                                                          Severity: Major
                                                          Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                        return result;
                                                            Severity: Major
                                                            Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                  return null;
                                                              Severity: Major
                                                              Found in src/main/java/de/uniks/networkparser/list/AbstractArray.java - About 30 mins to fix

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

                                                                  private int retransformIndex(int index, int size) {
                                                                    if (elements[DELETED] != null) {
                                                                      Object[] items = (Object[]) elements[DELETED];
                                                                      for (int i = 0; i < items.length; i++) {
                                                                        if (((Integer) items[i]) > index) {
                                                                Severity: Minor
                                                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 toArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  public <T> T[] toArray(T[] a) {
                                                                    if (a == null) {
                                                                      return null;
                                                                    }
                                                                    Object[] elementData;
                                                                Severity: Minor
                                                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 getArrayFlag has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  final int getArrayFlag(int size) {
                                                                    if (size == 0) {
                                                                      return 0;
                                                                    }
                                                                    if ((flag & BIDI) > 0) {
                                                                Severity: Minor
                                                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 subList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  public BaseItem subList(int fromIndex, int toIndex) {
                                                                    BaseItem newInstance = getNewList(false);
                                                                    if (fromIndex < 0) {
                                                                      fromIndex += size;
                                                                    }
                                                                Severity: Minor
                                                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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 pack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  public void pack() {
                                                                    if (elements == null) {
                                                                      return;
                                                                    }
                                                                    boolean complex = isComplex(size);
                                                                Severity: Minor
                                                                Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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

                                                                These nested if statements could be combined
                                                                Open

                                                                      if (indexOf(element, size) >= 0) {
                                                                        return REMOVED;
                                                                      }

                                                                CollapsibleIfStatements

                                                                Since: PMD 3.1

                                                                Priority: Medium

                                                                Categories: Style

                                                                Remediation Points: 50000

                                                                Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                                                                Example:

                                                                void bar() {
                                                                 if (x) { // original implementation
                                                                 if (y) {
                                                                 // do stuff
                                                                 }
                                                                 }
                                                                }
                                                                
                                                                void bar() {
                                                                 if (x && y) { // optimized implementation
                                                                 // do stuff
                                                                 }
                                                                }

                                                                These nested if statements could be combined
                                                                Open

                                                                      if (a instanceof String && b instanceof String) {
                                                                        return ((String) a).equalsIgnoreCase((String) b);
                                                                      }

                                                                CollapsibleIfStatements

                                                                Since: PMD 3.1

                                                                Priority: Medium

                                                                Categories: Style

                                                                Remediation Points: 50000

                                                                Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                                                                Example:

                                                                void bar() {
                                                                 if (x) { // original implementation
                                                                 if (y) {
                                                                 // do stuff
                                                                 }
                                                                 }
                                                                }
                                                                
                                                                void bar() {
                                                                 if (x && y) { // optimized implementation
                                                                 // do stuff
                                                                 }
                                                                }

                                                                These nested if statements could be combined
                                                                Open

                                                                      if ("size".equalsIgnoreCase(keyString)) {
                                                                        return this.size();
                                                                      }

                                                                CollapsibleIfStatements

                                                                Since: PMD 3.1

                                                                Priority: Medium

                                                                Categories: Style

                                                                Remediation Points: 50000

                                                                Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                                                                Example:

                                                                void bar() {
                                                                 if (x) { // original implementation
                                                                 if (y) {
                                                                 // do stuff
                                                                 }
                                                                 }
                                                                }
                                                                
                                                                void bar() {
                                                                 if (x && y) { // optimized implementation
                                                                 // do stuff
                                                                 }
                                                                }

                                                                These nested if statements could be combined
                                                                Open

                                                                      if (minCapacity > elements.length) {
                                                                        int newSize = minCapacity + minCapacity / 2 + 5;
                                                                        resizeSmall(newSize);
                                                                        return newSize;
                                                                      }

                                                                CollapsibleIfStatements

                                                                Since: PMD 3.1

                                                                Priority: Medium

                                                                Categories: Style

                                                                Remediation Points: 50000

                                                                Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                                                                Example:

                                                                void bar() {
                                                                 if (x) { // original implementation
                                                                 if (y) {
                                                                 // do stuff
                                                                 }
                                                                 }
                                                                }
                                                                
                                                                void bar() {
                                                                 if (x && y) { // optimized implementation
                                                                 // do stuff
                                                                 }
                                                                }

                                                                These nested if statements could be combined
                                                                Open

                                                                        if (child instanceof AbstractList) {
                                                                          if (end == len + 2) {
                                                                            /* Get List */
                                                                            BaseItem result = this.getNewList(true);
                                                                            AbstractList<?> items = (AbstractList<?>) child;

                                                                CollapsibleIfStatements

                                                                Since: PMD 3.1

                                                                Priority: Medium

                                                                Categories: Style

                                                                Remediation Points: 50000

                                                                Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

                                                                Example:

                                                                void bar() {
                                                                 if (x) { // original implementation
                                                                 if (y) {
                                                                 // do stuff
                                                                 }
                                                                 }
                                                                }
                                                                
                                                                void bar() {
                                                                 if (x && y) { // optimized implementation
                                                                 // do stuff
                                                                 }
                                                                }

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status