fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/EntityUtil.java

Summary

Maintainability
F
2 wks
Test Coverage

File EntityUtil.java has 1097 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser;

import java.io.File;
/*
NetworkParser
Severity: Major
Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 2 days to fix

    Method compareEntity has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
    Open

        public static final boolean compareEntity(Object entityA, Object entityB, TextDiff diffList, BaseItem sameObject) {
            if (sameObject == null) {
                if (entityA instanceof Entity) {
                    sameObject = ((BaseItem) entityA).getNewList(true);
                } else if (entityB instanceof Entity) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/EntityUtil.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

    EntityUtil has 60 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class EntityUtil {
        public static final String CLASS = "class";
        public static final String NON_FILE_CHARSSIMPLE = "[\\\\/\\:\\;\\*\\?\"<>\\|!&', \u001F\u0084\u0093\u0094\u0096\u2013\u201E\u201C\u03B1 ]";
        public static final String emfTypes = " EOBJECT EBIG_DECIMAL EBOOLEAN EBYTE EBYTE_ARRAY ECHAR EDATE EDOUBLE EFLOAT EINT EINTEGER ELONG EMAP ERESOURCE ESHORT ESTRING ";
        /**
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 day to fix

      Method getStringType has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          public static final String getStringType(byte type) {
              if (type == ByteTokener.DATATYPE_NULL) {
                  return "DATATYPE_NULL";
              }
              if (type == ByteTokener.DATATYPE_FIXED) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/EntityUtil.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 compareEntity has 118 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static final boolean compareEntity(Object entityA, Object entityB, TextDiff diffList, BaseItem sameObject) {
              if (sameObject == null) {
                  if (entityA instanceof Entity) {
                      sameObject = ((BaseItem) entityA).getNewList(true);
                  } else if (entityB instanceof Entity) {
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 4 hrs to fix

        Method getStringType has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static final String getStringType(byte type) {
                if (type == ByteTokener.DATATYPE_NULL) {
                    return "DATATYPE_NULL";
                }
                if (type == ByteTokener.DATATYPE_FIXED) {
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 3 hrs to fix

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

              public static String decode(String str) {
                  if (str == null) {
                      return null;
                  }
                  StringBuilder buf = new StringBuilder();
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/EntityUtil.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 containsAny has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final boolean containsAny(CharSequence cs, char[] searchChars) {
                  if (isEmpty(cs) || searchChars == null || searchChars.length == 0) {
                      return false;
                  }
          
          
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/EntityUtil.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 writeByteHeader has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final void writeByteHeader(ByteBuffer buffer, byte type, int valueLength) {
                  if (buffer == null) {
                      return;
                  }
                  if (valueLength > 0) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/EntityUtil.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

          Consider simplifying this complex logical expression.
          Open

                      if (object instanceof AbstractArray || object instanceof Byte || object instanceof Character
                              || object instanceof Short || object instanceof Integer || object instanceof Long
                              || object instanceof Boolean || object instanceof Float || object instanceof Double
                              || object instanceof String) {
                          return object;
          Severity: Critical
          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 2 hrs to fix

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

                public static final String unQuote(CharSequence value) {
                    if (value == null || value.length() == 0) {
                        return "";
                    }
                    StringBuilder sb = new StringBuilder(value.length());
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 compareValue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                protected static final Object compareValue(String key, Object valueA, Object valueB, TextDiff diffList,
                        BaseItem sameElement) {
                    BaseItem sameObject = null;
                    if (diffList == null) {
                        return null;
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 getValidChars has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static final String getValidChars(String source, int maxLen) {
                    if (source == null) {
                        return null;
                    }
                    int i = source.length() - 1;
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 getType has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static final byte getType(byte type, int len, boolean isLast) {
                    if (isGroup(type)) {
                        if (isLast) {
                            return getType(type, ByteTokener.LEN_LAST);
                        }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 valueToString has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public static final String valueToString(Object value, boolean simpleText, BaseItem reference,
                        Converter converter) {
                    if (value == null) {
                        return "null";
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 isValidJavaId has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static boolean isValidJavaId(String myRoleName) {
                    if (myRoleName == null || isModifier(myRoleName)) {
                        return false;
                    }
                    if (myRoleName.endsWith(".") || myRoleName.startsWith(".")) {
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 quote has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static final String quote(String string) {
                    if (string == null || string.length() == 0) {
                        return "\"\"";
                    }
            
            
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 valueToString has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static final String valueToString(Object value, boolean simpleText, BaseItem reference,
                        Converter converter) {
                    if (value == null) {
                        return "null";
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

              Method decode has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static String decode(String str) {
                      if (str == null) {
                          return null;
                      }
                      StringBuilder buf = new StringBuilder();
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

                Method getRelativePath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static String getRelativePath(String targetPath, String basePath, String separator) {
                        if (targetPath == null || basePath == null) {
                            return null;
                        }
                        String[] base = basePath.split(separator);
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/EntityUtil.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 getTypeLen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static final int getTypeLen(byte type, int len, boolean isLast) {
                        if (isGroup(type)) {
                            int ref = type % 16 - 10;
                            if (ref == 0) {
                                type = getType(type, len, isLast);
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/EntityUtil.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 getDefaultValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static final String getDefaultValue(String datatype) {
                        if (EntityUtil.isNumericType(datatype)) {
                            if ("Long".equals(datatype)) {
                                return "0L";
                            } else if ("Float".equals(datatype)) {
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/EntityUtil.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 basicUnQuote has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static final String basicUnQuote(String value) {
                        if (value == null || value.length() == 0) {
                            return "";
                        }
                        StringBuilder sb = new StringBuilder(value.length());
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/EntityUtil.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 unQuote has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static final String unQuote(CharSequence value) {
                        if (value == null || value.length() == 0) {
                            return "";
                        }
                        StringBuilder sb = new StringBuilder(value.length());
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

                  Method compareValue has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected static final Object compareValue(String key, Object valueA, Object valueB, TextDiff diffList,
                              BaseItem sameElement) {
                          BaseItem sameObject = null;
                          if (diffList == null) {
                              return null;
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

                    Method getRelativePath has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static String getRelativePath(String targetPath, String basePath, String separator) {
                            if (targetPath == null || basePath == null) {
                                return null;
                            }
                            String[] base = basePath.split(separator);
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

                      Method getValidChars has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static final String getValidChars(String source, int maxLen) {
                              if (source == null) {
                                  return null;
                              }
                              int i = source.length() - 1;
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

                        Method quote has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static final String quote(String string) {
                                if (string == null || string.length() == 0) {
                                    return "\"\"";
                                }
                        
                        
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

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

                              public static String getPath(String path, String separator) {
                                  if (path == null) {
                                      return null;
                                  }
                                  String[] base = path.split(separator);
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/EntityUtil.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 replaceAll has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static final CharacterBuffer replaceAll(String text, Object... args) {
                                  CharacterBuffer value = new CharacterBuffer().with(text);
                                  if (args == null || args[0] == null) {
                                      return value;
                                  }
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 1 hr to fix

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

                                public static final Object wrap(Object object, BaseItem reference) {
                                    try {
                                        if (object == null) {
                                            return null;
                                        }
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 encode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static String encode(String str) {
                                    if (str == null) {
                                        return "";
                                    }
                                    StringBuilder buf = new StringBuilder(); /* the output string buffer */
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 replaceAll has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static final CharacterBuffer replaceAll(String text, Object... args) {
                                    CharacterBuffer value = new CharacterBuffer().with(text);
                                    if (args == null || args[0] == null) {
                                        return value;
                                    }
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/EntityUtil.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 deeply nested control flow statements.
                            Open

                                                    if (sameObject != null) {
                                                        sameObject.add(key, oldValue);
                                                    }
                            Severity: Major
                            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (i < csLast && searchChars[j + 1] == cs.charAt(i + 1)) {
                                                          return true;
                                                      }
                              Severity: Major
                              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (type == ByteTokener.DATATYPE_CLAZZNAME || getSubGroup(type) == ByteTokener.LEN_LITTLE) {
                                                            buffer.put((byte) (valueLength + ByteTokener.SPLITTER));
                                                        } else {
                                                            buffer.put((byte) valueLength);
                                                        }
                                Severity: Major
                                Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 45 mins to fix

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

                                      public static final SimpleList<Pos> getExcelRange(String tag) {
                                          SimpleList<Pos> range = new SimpleList<Pos>();
                                          if (tag == null) {
                                              return range;
                                          }
                                  Severity: Minor
                                  Found in src/main/java/de/uniks/networkparser/EntityUtil.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 deeply nested control flow statements.
                                  Open

                                                          if (j == searchLast) {
                                                              /* missing low surrogate, fine, like String.indexOf(String) */
                                                              return true;
                                                          }
                                  Severity: Major
                                  Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 45 mins to fix

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

                                        public static final String doubleToString(double d) {
                                            if (Double.isInfinite(d) || Double.isNaN(d)) {
                                                return "null";
                                            }
                                            /* Shave off trailing zeros and decimal point, if possible. */
                                    Severity: Minor
                                    Found in src/main/java/de/uniks/networkparser/EntityUtil.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 compareValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        protected static final Object compareValue(String key, Object valueA, Object valueB, TextDiff diffList,
                                                BaseItem sameElement) {
                                    Severity: Minor
                                    Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 35 mins to fix

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

                                          public static final String valueToString(Number number) {
                                              if (number == null) {
                                                  return "";
                                              }
                                              /* Shave off trailing zeros and decimal point, if possible. */
                                      Severity: Minor
                                      Found in src/main/java/de/uniks/networkparser/EntityUtil.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 ((BaseItem) item).toString(converter);
                                      Severity: Major
                                      Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return item.toString(converter);
                                        Severity: Major
                                        Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return value.toString();
                                          Severity: Major
                                          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

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

                                              Avoid too many return statements within this method.
                                              Open

                                                          return "DATATYPE_CLAZZTYPELONG";
                                              Severity: Major
                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                return datatype.substring(0, datatype.length() - 2);
                                                Severity: Major
                                                Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                  return object.toString();
                                                  Severity: Major
                                                  Found in src/main/java/de/uniks/networkparser/EntityUtil.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/EntityUtil.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

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

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                            return ((XMLEntity) xmlA).getTag().equals(((XMLEntity) xmlB).getTag());
                                                        Severity: Major
                                                        Found in src/main/java/de/uniks/networkparser/EntityUtil.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/EntityUtil.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                        return "DATATYPE_ASSOC";
                                                            Severity: Major
                                                            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                          return "DATATYPE_CLAZZNAME";
                                                              Severity: Major
                                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

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

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                  return "DATATYPE_CLAZZID";
                                                                      Severity: Major
                                                                      Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                        return datatype.substring(0, datatype.length() - 3);
                                                                        Severity: Major
                                                                        Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return "DATATYPE_DOUBLE";
                                                                          Severity: Major
                                                                          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                        return "DATATYPE_DATE";
                                                                            Severity: Major
                                                                            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

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

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

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

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

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

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

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

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                          return "DATATYPE_FLOAT";
                                                                                              Severity: Major
                                                                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

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

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

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

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

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

                                                                                                          Avoid too many return statements within this method.
                                                                                                          Open

                                                                                                                                  return ((XMLEntity) xmlA).getTag().equals(((XMLEntity) xmlB).getTag());
                                                                                                          Severity: Major
                                                                                                          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                            Avoid too many return statements within this method.
                                                                                                            Open

                                                                                                                        return "DATATYPE_LONG";
                                                                                                            Severity: Major
                                                                                                            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                              Avoid too many return statements within this method.
                                                                                                              Open

                                                                                                                          return getType(type, ByteTokener.LEN_LITTLE);
                                                                                                              Severity: Major
                                                                                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                Avoid too many return statements within this method.
                                                                                                                Open

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

                                                                                                                  Avoid too many return statements within this method.
                                                                                                                  Open

                                                                                                                              return "DATATYPE_CHAR";
                                                                                                                  Severity: Major
                                                                                                                  Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this method.
                                                                                                                    Open

                                                                                                                                return quote(new String((byte[]) value));
                                                                                                                    Severity: Major
                                                                                                                    Found in src/main/java/de/uniks/networkparser/EntityUtil.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/EntityUtil.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/EntityUtil.java - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this method.
                                                                                                                          Open

                                                                                                                                      return "DATATYPE_CLAZZTYPE";
                                                                                                                          Severity: Major
                                                                                                                          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this method.
                                                                                                                            Open

                                                                                                                                        return "DATATYPE_BYTE";
                                                                                                                            Severity: Major
                                                                                                                            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this method.
                                                                                                                              Open

                                                                                                                                              return ((SimpleKeyValueList<?, ?>) reference.getNewList(false)).withMap((Map<?, ?>) object);
                                                                                                                              Severity: Major
                                                                                                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this method.
                                                                                                                                Open

                                                                                                                                            return colectionA.size() < 1 && colectionB.size() < 1;
                                                                                                                                Severity: Major
                                                                                                                                Found in src/main/java/de/uniks/networkparser/EntityUtil.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/EntityUtil.java - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this method.
                                                                                                                                    Open

                                                                                                                                                return item.toString(converter);
                                                                                                                                    Severity: Major
                                                                                                                                    Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this method.
                                                                                                                                      Open

                                                                                                                                              return quote(value.toString());
                                                                                                                                      Severity: Major
                                                                                                                                      Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this method.
                                                                                                                                        Open

                                                                                                                                                    return "DATATYPE_CLAZZNAMELONG";
                                                                                                                                        Severity: Major
                                                                                                                                        Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this method.
                                                                                                                                          Open

                                                                                                                                                      return "void";
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this method.
                                                                                                                                            Open

                                                                                                                                                        return "DATATYPE_CLAZZPACKAGE";
                                                                                                                                            Severity: Major
                                                                                                                                            Found in src/main/java/de/uniks/networkparser/EntityUtil.java - About 30 mins to fix

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

                                                                                                                                                  public static final String strZero(String value, int length, int max) {
                                                                                                                                                      if (max > 0 && max < length) {
                                                                                                                                                          length = max;
                                                                                                                                                      }
                                                                                                                                                      if (value == null) {
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.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 isNumericTypeContainer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                              Open

                                                                                                                                                  public static final boolean isNumericTypeContainer(String typeA, String typeB) {
                                                                                                                                                      if (typeA == null || typeB == null) {
                                                                                                                                                          return typeA == typeB;
                                                                                                                                                      }
                                                                                                                                                      if (typeA.startsWith(javaLang)) {
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in src/main/java/de/uniks/networkparser/EntityUtil.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