fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/buffer/Buffer.java

Summary

Maintainability
F
4 days
Test Coverage

File Buffer.java has 462 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.buffer;

/*
NetworkParser
The MIT License
Severity: Minor
Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 7 hrs to fix

    Buffer has 36 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public abstract class Buffer implements BufferItem {
        public static final String STOPCHARSJSON = ",:]}/\\\"[{;=# ";
        public static final String STOPCHARSXML = ",]}/\\\"[{;=# ";
        public static final char[] STOPCHARSXMLEND = new char[] { '"', ',', ']', '}', '/', '\\', '[', '{', ';', '=', '#',
                '>', '\r', '\n', ' ' };
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 4 hrs to fix

      Method parseString has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          protected CharacterBuffer parseString(CharacterBuffer sc, boolean allowQuote, boolean nextStep, char... quotes) {
              sc.with(getCurrentChar());
              if (quotes == null) {
                  return sc;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 skipTo has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public boolean skipTo(String search, boolean order, boolean notEscape) {
              if (position() < 0) {
                  return false;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 nextValue has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public Object nextValue(BaseItem creator, boolean allowQuote, boolean allowDuppleMark, char c) {
              CharacterBuffer value = nextValue(c, allowDuppleMark);
              if (value.length() < 1) {
                  return null;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 parseString has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected CharacterBuffer parseString(CharacterBuffer sc, boolean allowQuote, boolean nextStep, char... quotes) {
              sc.with(getCurrentChar());
              if (quotes == null) {
                  return sc;
              }
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 2 hrs to fix

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

            protected CharacterBuffer nextValue(char c, boolean allowDuppleMark) {
                CharacterBuffer sb = new CharacterBuffer();
                if (allowDuppleMark) {
                    while (c >= ' ' && STOPCHARSXML.indexOf(c) < 0) {
                        sb.with(c);
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 nextValue has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public Object nextValue(BaseItem creator, boolean allowQuote, boolean allowDuppleMark, char c) {
                CharacterBuffer value = nextValue(c, allowDuppleMark);
                if (value.length() < 1) {
                    return null;
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 1 hr to fix

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

              @Override
              public boolean skipTo(String search, boolean order, boolean notEscape) {
                  if (position() < 0) {
                      return false;
                  }
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 1 hr to fix

            Method array has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public byte[] array(int len, boolean current) {
                    if (len == -1) {
                        len = remaining();
                    } else if (len == -2) {
                        len = length();
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 skipChar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public char skipChar(char... quotes) {
                    char c = getCurrentChar();
                    if (quotes == null) {
                        return c;
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 skipTo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public boolean skipTo(char search, boolean notEscape) {
                    int len = length();
                    char lastChar = 0;
                    if (this.position() > 0 && this.position() < len) {
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 skipIf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean skipIf(boolean allowSpace, char... quotes) {
                    char c = getCurrentChar();
                    if (quotes == null) {
                        return true;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 nextString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public CharacterBuffer nextString(CharacterBuffer sc, boolean allowQuote, boolean nextStep, char... quotes) {
                    if (getCurrentChar() == 0 || quotes == null) {
                        return sc;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 getStringList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public SimpleList<String> getStringList() {
                    SimpleList<String> list = new SimpleList<String>();
                    CharacterBuffer sc = new CharacterBuffer();
                    do {
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.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 null;
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return myLong;
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return Integer.valueOf(myLong.intValue());
                Severity: Major
                Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return value;
                  Severity: Major
                  Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return d;
                    Severity: Major
                    Found in src/main/java/de/uniks/networkparser/buffer/Buffer.java - About 30 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status