SquirrelJME/SquirrelJME

View on GitHub

Showing 164 of 178 total issues

Method toString has 223 lines of code (exceeds 100 allowed). Consider refactoring.
Open

    @SuppressWarnings("MagicNumber")
    public static String toString(int __code)
    {
        // Wide codes
        switch (__code & 0xFFFF)

    Method deserialize has 223 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

        public static Object deserialize(Graphics __g, GraphicsFunction __func,
            Object... __args)
            throws IllegalArgumentException, NullPointerException
        {
            if (__g == null || __func == null)

      Method toString has 221 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

          public static String toString(int __op)
          {
              switch (__op)
              {
                  case InstructionIndex.NOP: return "NOP";

        File NativeCPU.java has 1009 lines of code (exceeds 850 allowed). Consider refactoring.
        Open

        // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
        // ---------------------------------------------------------------------------
        // SquirrelJME
        //     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
        // ---------------------------------------------------------------------------

          File AdvancedGraphics.java has 1004 lines of code (exceeds 850 allowed). Consider refactoring.
          Open

          // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
          // ---------------------------------------------------------------------------
          // SquirrelJME
          //     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
          // ---------------------------------------------------------------------------

            Method __translateCode has a Cognitive Complexity of 56 (exceeds 24 allowed). Consider refactoring.
            Open

                private byte[] __translateCode(NativeCode __rc)
                    throws IOException, NullPointerException
                {
                    if (__rc == 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 infoPointer has 212 lines of code (exceeds 100 allowed). Consider refactoring.
            Open

                public final int infoPointer()
                {
                    // If it has already been initialized use it
                    int rv = this._classdata;
                    if (rv >= 0)

              Method toChar has 200 lines of code (exceeds 100 allowed). Consider refactoring.
              Open

                  public static final int toChar(String __n)
                      throws NullPointerException
                  {
                      if (__n == null)
                          throw new NullPointerException("NARG");

                Method minimize has a Cognitive Complexity of 52 (exceeds 24 allowed). Consider refactoring.
                Open

                    public static void minimize(OutputStream __os, String __boot,
                        String[] __initcp, String __mainbc, boolean __ismid,
                        VMClassLibrary... __libs)
                        throws IOException, NullPointerException
                    {

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

                    public static void main(String... __args)
                    {
                        // Poke the VM to initialize some probably important parts of it
                        Poking.poke();
                        

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

                    @Override
                    public final int read(byte[] __b, int __o, int __l)
                        throws IndexOutOfBoundsException, IOException, NullPointerException
                    {
                        if (__b == null)
                Severity: Minor
                Found in modules/io/src/main/java/net/multiphasicapps/io/Base64Decoder.java - About 4 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method createVM has 185 lines of code (exceeds 100 allowed). Consider refactoring.
                Open

                    @Override
                    protected VirtualMachine createVM(ProfilerSnapshot __ps,
                        JDWPFactory __jdwp, VMThreadModel __threadModel, VMSuiteManager __sm,
                        VMClassLibrary[] __cp, String __maincl, Map<String, String> __sprops,
                        String[] __args)

                  Method decode has 184 lines of code (exceeds 100 allowed). Consider refactoring.
                  Open

                      public static DualClassRuntimePool decode(byte[] __b,
                          int __co, int __cl, int __ro, int __rl)
                          throws InvalidClassFormatException, IOException, NullPointerException
                      {
                          if (__b == null)

                    Method decode has a Cognitive Complexity of 47 (exceeds 24 allowed). Consider refactoring.
                    Open

                        public static DualClassRuntimePool decode(byte[] __b,
                            int __co, int __cl, int __ro, int __rl)
                            throws InvalidClassFormatException, IOException, NullPointerException
                        {
                            if (__b == null)

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

                        public final JavaStackResult doTransition(JavaStackState __ts)
                            throws NullPointerException
                        {
                            if (__ts == 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 __updateState has a Cognitive Complexity of 46 (exceeds 24 allowed). Consider refactoring.
                    Open

                            private void __updateState(int __w, int __h)
                            {
                                // Needed for cycling    
                                Random random = this.random;
                                

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

                        public String readLine()
                            throws IOException
                        {
                            // Has this been closed?
                            char[] buf = this._buf;
                    Severity: Minor
                    Found in modules/cldc-compact/src/main/java/java/io/BufferedReader.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 decode has 165 lines of code (exceeds 100 allowed). Consider refactoring.
                    Open

                        @Deprecated
                        public static MinimizedPool decode(int __n, byte[] __is, int __o,
                            int __l)
                            throws IndexOutOfBoundsException, InvalidClassFormatException,
                                NullPointerException

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public static int parseInt(String __v, int __r)
                              throws NumberFormatException
                          {
                              // {@squirreljme.error ZZ19 The radix is out of bounds. (The radix)}
                              if (__r < Character.MIN_RADIX || __r > Character.MAX_RADIX)
                      Severity: Major
                      Found in modules/cldc-compact/src/main/java/java/lang/Integer.java and 1 other location - About 3 hrs to fix
                      modules/cldc-compact/src/main/java/java/lang/Long.java on lines 212..263

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 305.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public static long parseLong(String __v, int __radix)
                              throws NumberFormatException
                          {
                              // {@squirreljme.error ZZ25 The radix is out of bounds. (The radix)}
                              if (__radix < Character.MIN_RADIX || __radix > Character.MAX_RADIX)
                      Severity: Major
                      Found in modules/cldc-compact/src/main/java/java/lang/Long.java and 1 other location - About 3 hrs to fix
                      modules/cldc-compact/src/main/java/java/lang/Integer.java on lines 460..511

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 305.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language