SquirrelJME/SquirrelJME

View on GitHub

Showing 110 of 178 total issues

Method __drawText has a Cognitive Complexity of 32 (exceeds 24 allowed). Consider refactoring.
Open

    final void __drawText(Text __t, int __x, int __y, int __anchor)
        throws NullPointerException
    {
        if (__t == 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

Method asVMObject has 112 lines of code (exceeds 100 allowed). Consider refactoring.
Open

    public final Object asVMObject(Object __in, boolean __noclassres)
    {
        // Null is converted to null
        if (__in == null)
            return SpringNullObject.NULL;

    Method read has 111 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

        public static final PCFFont read(InputStream __in)
            throws IOException, NullPointerException
        {
            if (__in == null)
                throw new NullPointerException("NARG");

      Method __context has 110 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

          private boolean __context(JDWPController __controller, Object __thread,
              EventModContext __context, Object __on)
              throws NullPointerException
          {
              if (__controller == null || __context == null)

        Consider simplifying this complex logical expression.
        Open

                if (in.readUnsignedByte() != 137 ||
                    in.readUnsignedByte() != 80 ||
                    in.readUnsignedByte() != 78 ||
                    in.readUnsignedByte() != 71 ||
                    in.readUnsignedByte() != 13 ||

          Consider simplifying this complex logical expression.
          Open

                          if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
                              c == '-' || c == '.' || (isvsix && c == ':')))
                              throw new IllegalArgumentException("EC0f " + __h);
          Severity: Critical
          Found in modules/gcf/src/main/java/cc/squirreljme/runtime/gcf/IPAddress.java - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    else if (__in instanceof boolean[] ||
                        __in instanceof byte[] ||
                        __in instanceof short[] ||
                        __in instanceof char[] ||
                        __in instanceof int[] ||

              Consider simplifying this complex logical expression.
              Open

                      if (__ver == null || __cf == null || __tn == null ||
                          __in == null || __fs == null || __ms == null || __icl == null ||
                          __at == null)
                          throw new NullPointerException("NARG");

                Consider simplifying this complex logical expression.
                Open

                        if (__a < 0 || __a > 255 || __r < 0 || __r > 255 ||
                            __g < 0 || __g > 255 || __b < 0 || __b > 255)
                            throw new IllegalArgumentException(String.format(
                                "EB0f %d %d %d %d", __a, __r, __g, __b));

                  Consider simplifying this complex logical expression.
                  Open

                          if (__ver == null || __cf == null || __tn == null || __pool == null ||
                              __mf == null || __mn == null || __mt == null || __avs == null)
                              throw new NullPointerException("NARG");

                    Consider simplifying this complex logical expression.
                    Open

                            if (__x1 < clipsx || __x2 < clipsx || __y1 < clipsy || __y2 < clipsy ||
                                __x1 > clipex || __x2 > clipex || __y1 > clipey || __y2 > clipey)
                                return;

                      Method __drawText has 108 lines of code (exceeds 100 allowed). Consider refactoring.
                      Open

                          final void __drawText(Text __t, int __x, int __y, int __anchor)
                              throws NullPointerException
                          {
                              if (__t == null)
                                  throw new NullPointerException("NARG");

                        Method __keyCode has a Cognitive Complexity of 30 (exceeds 24 allowed). Consider refactoring.
                        Open

                            private static int __keyCode(int __keyCode, char __keyChar)
                            {
                                // Function keys, these come in two groups
                                if (__keyCode >= KeyEvent.VK_F1 && __keyCode <= KeyEvent.VK_F12)
                                    return NonStandardKey.F1 + (__keyCode - KeyEvent.VK_F1);

                        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 readUTF has a Cognitive Complexity of 30 (exceeds 24 allowed). Consider refactoring.
                        Open

                            public static final String readUTF(DataInput __in)
                                throws EOFException, IOException, NullPointerException,
                                    UTFDataFormatException
                            {
                                if (__in == null)
                        Severity: Minor
                        Found in modules/cldc-compact/src/main/java/java/io/DataInputStream.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 monitorWait has a Cognitive Complexity of 30 (exceeds 24 allowed). Consider refactoring.
                        Open

                            public final int monitorWait(SpringThread __by, long __ms, int __ns)
                                throws NullPointerException
                            {
                                if (__by == 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

                        Method __readPixels has a Cognitive Complexity of 30 (exceeds 24 allowed). Consider refactoring.
                        Open

                            private void __readPixels(Reader __cs, int __width, int __height,
                                int[] __data, int __pxchars, int[] __codes, int[] __palette)
                                throws IOException
                            {
                                // Read the XPM image data for each rows

                        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 getBytes has 104 lines of code (exceeds 100 allowed). Consider refactoring.
                        Open

                            public final byte[] getBytes()
                            {
                                Map<Object, Integer> pool = this._pool;
                                List<int[]> parts = this._parts;
                                

                          Method sqrt has 104 lines of code (exceeds 100 allowed). Consider refactoring.
                          Open

                              @ImplementationNote("Source: http://www.netlib.org/fdlibm/e_sqrt.c")
                              public static double sqrt(double __v)
                              {
                                  double z;
                                  int uur, uut1, uus1, uuix1, uuq1;

                            Method execute has 104 lines of code (exceeds 100 allowed). Consider refactoring.
                            Open

                                    @Override
                                    public JDWPPacket execute(JDWPController __controller,
                                        JDWPPacket __packet)
                                        throws JDWPException
                                    {

                              Method poll has a Cognitive Complexity of 29 (exceeds 24 allowed). Consider refactoring.
                              Open

                                  public boolean poll()
                                      throws JDWPException
                                  {
                                      // Read in any packets and process them as they come
                                      for (CommLink commLink = this.commLink;;)

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language