SquirrelJME/SquirrelJME

View on GitHub

Showing 132 of 203 total issues

Method __unfilter has a Cognitive Complexity of 28 (exceeds 24 allowed). Consider refactoring.
Open

    private byte[] __unfilter(InputStream __in, int __bpp)
        throws IOException, NullPointerException
    {
        if (__in == null)
            throw new NullPointerException("NARG");

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 (x >= 0 && y >= 0 && z >= 0)
                                        return (x << 6) | (y << 3) | (z);

    Avoid deeply nested control flow statements.
    Open

                            if (buf[gap] == '\n')
                                rp = ln + 2;
                            
                            // Otherwise do not
                            else
    Severity: Major
    Found in modules/cldc-compact/src/main/java/java/io/BufferedReader.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if ((hex[i] = this.__read()) < 0)
                                          throw new JsonParsingException(
                                              "ueof", jl);
      Severity: Major
      Found in modules/json/src/main/java/net/multiphasicapps/jsr353/ReaderInput.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (viewObject.readValue(thread, fieldId, value))
                                        return viewThread.fromBracket(value.get());

          Avoid deeply nested control flow statements.
          Open

                                              if (x >= 0 && y >= 0)
                                                  return (x << 4) | (y);

            Avoid deeply nested control flow statements.
            Open

                                            if (dig < 0)
                                                throw new JsonParsingException(
                                                    String.format("bx", hex[i]), jl);
            Severity: Major
            Found in modules/json/src/main/java/net/multiphasicapps/jsr353/ReaderInput.java - About 45 mins to fix

              Method __specifier has a Cognitive Complexity of 27 (exceeds 24 allowed). Consider refactoring.
              Open

                  private static int __specifier(__PrintFState__ __pf, int __base,
                      String __fmt)
                      throws IllegalArgumentException, NullPointerException
                  {
                      if (__pf == null || __fmt == null)
              Severity: Minor
              Found in modules/cldc-compact/src/main/java/java/util/Formatter.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

                                      for (JDWPPacket copy : deferred)
                                          try (JDWPPacket packet = copy)
                                          {
                                              // Set sizes
                                              packet.setIdSizes(sizes);

                Avoid deeply nested control flow statements.
                Open

                                                if (file.endsWith(csvType.rootedFileName))
                                                {
                                                    targetCsv = csvType;
                                                    break;
                                                }

                  Consider simplifying this complex logical expression.
                  Open

                              if (__show && (__form != null && current == __form) ||
                                  (__form == null && frame.isVisible() && current == null))
                                  return;

                    Consider simplifying this complex logical expression.
                    Open

                                        if ((includeMain && isMain) ||
                                            (includeDaemon && isDaemon) ||
                                            (!isMain && !isDaemon))
                                            count++;

                      Consider simplifying this complex logical expression.
                      Open

                              if (__r < 0 || __r > 255 || __g < 0 || __g > 255 || __b < 0 ||
                                  __b > 255)
                                  throw new IllegalArgumentException(String.format("DA01 %d %d %d",
                                      __r, __g, __b));
                      Severity: Major
                      Found in modules/meep-lui/src/main/java/javax/microedition/lui/DisplayColor.java - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (__o != SocketConnection.KEEPALIVE || __o != SocketConnection.LINGER || __o != SocketConnection.SNDBUF ||
                                    __o != SocketConnection.RCVBUF || __o != SocketConnection.DELAY || __o != SocketConnection.TIMEOUT)
                                    throw new IllegalArgumentException("EC0n " + __o);

                          Consider simplifying this complex logical expression.
                          Open

                                  if (__jar == null || __jarOffset < 0 || __b == null ||
                                      __o < 0 || __l < 0 || (__o + __l) > __b.length)
                                      throw new MLECallError("Invalid parameters.");

                            Consider simplifying this complex logical expression.
                            Open

                                    if (superClass != null || parent != null ||
                                        (interfaceClasses != null && !interfaceClasses.isEmpty()) ||
                                        (childrenClasses != null && !childrenClasses.isEmpty()))
                                    {
                                        __writer.listStart();

                              Consider simplifying this complex logical expression.
                              Open

                                          if (c == ',' || c == '"' ||
                                              (c <= ' ' && i == 0) || (c <= ' ' && i == (n - 1)))
                                              return true;
                              Severity: Major
                              Found in modules/csv/src/main/java/cc/squirreljme/csv/CsvWriter.java - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if (!(__v instanceof SpringObject) &&
                                            !(__v instanceof Boolean) &&
                                            !(__v instanceof Integer) &&
                                            !(__v instanceof Long) &&
                                            !(__v instanceof Float) &&

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (__srcOff < 0 || (__srcOff + __len) < 0 ||
                                                  (__srcOff + __len) > srcLen ||
                                              __destOff < 0 || (__destOff + __len) < 0 ||
                                                  (__destOff + __len) > destLen)
                                              throw new IndexOutOfBoundsException("IOOB");

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if (__aotSettings == null || __settings == null ||
                                                __archive == null || __csv == null || __fileName == null ||
                                                __romSource == null)
                                                throw new NullPointerException("NARG");
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language