SquirrelJME/SquirrelJME

View on GitHub

Showing 172 of 186 total issues

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

    public static final Collection<String> basicSplit(char[] __delim,
        String __s, Collection<String> __out)
        throws NullPointerException
    {
        if (__delim == null || __s == null || __out == null)
modules/strings/src/main/java/net/multiphasicapps/strings/StringUtils.java on lines 44..98

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 226.

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

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

    public static final Collection<String> basicSplit(char[] __delim,
        String __s, Collection<String> __out)
        throws NullPointerException
    {
        if (__delim == null || __s == null || __out == null)
modules/cldc-compact/src/main/java/cc/squirreljme/runtime/cldc/util/StringUtils.java on lines 43..98

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 226.

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

Method read has a Cognitive Complexity of 36 (exceeds 24 allowed). Consider refactoring.
Open

    @Override
    public int read(byte[] __b, int __o, int __l)
        throws IndexOutOfBoundsException, IOException, NullPointerException
    {
        // Check
Severity: Minor
Found in modules/io/src/main/java/net/multiphasicapps/io/ZLibDecompressor.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

Method eventKey has a Cognitive Complexity of 36 (exceeds 24 allowed). Consider refactoring.
Open

    @Override
    public void eventKey(UIFormBracket __form, UIItemBracket __item,
        int __event, int __keyCode, int __modifiers)
    {
        // Debug

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

    private byte[] __translateCode(NativeCode __rc)
        throws IOException, NullPointerException
    {
        if (__rc == null)
            throw new NullPointerException("NARG");

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

        LINE_BLEND_DOT
        {
            /**
             * {@inheritDoc}
             * @since 2019/03/24
    modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/gfx/AdvancedFunction.java on lines 305..343

    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 218.

    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

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

        LINE_BLEND_NODOT
        {
            /**
             * {@inheritDoc}
             * @since 2019/03/24
    modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/gfx/AdvancedFunction.java on lines 346..384

    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 218.

    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

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

        @Override
        public int read()
            throws IOException
        {
            // Lock

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

      // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
      // ---------------------------------------------------------------------------
      // SquirrelJME
      //     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
      // ---------------------------------------------------------------------------
      modules/collections/src/main/java/net/multiphasicapps/collections/UnmodifiableIterator.java on lines 1..155

      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 216.

      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

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

      // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
      // ---------------------------------------------------------------------------
      // SquirrelJME
      //     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
      // ---------------------------------------------------------------------------
      modules/cldc-compact/src/main/java/cc/squirreljme/runtime/cldc/util/UnmodifiableIterator.java on lines 1..155

      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 216.

      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

      Method equals has a Cognitive Complexity of 35 (exceeds 24 allowed). Consider refactoring.
      Open

          @Override
          @ImplementationNote("This method considers if the source and target " +
              "lists are RandomAccess, for more optimized comparison.")
          public boolean equals(Object __o)
          {
      Severity: Minor
      Found in modules/cldc-compact/src/main/java/java/util/AbstractList.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

      Method __undirty has 125 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

          private final void __undirty()
          {
              if (!this._dirty)
                  return;
              
      Severity: Major
      Found in modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Text.java - About 2 hrs to fix

        Method __update has a Cognitive Complexity of 34 (exceeds 24 allowed). Consider refactoring.
        Open

            private void __update(JavaStackResult __jsr)
                throws NullPointerException
            {
                if (__jsr == 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 __sysCall has a Cognitive Complexity of 34 (exceeds 24 allowed). Consider refactoring.
        Open

            private final long __sysCall(short __si, int... __args)
            {
                // Error state for the last call of this type
                int[] errors = this._syscallerrors;
                

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

            @Override
            public final void run()
            {
                List<TimerTask> tasks = this._tasks;
                
        Severity: Minor
        Found in modules/cldc-compact/src/main/java/java/util/__TimerThread__.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 connect has a Cognitive Complexity of 33 (exceeds 24 allowed). Consider refactoring.
        Open

            @Override
            public Connection connect(String __part, int __mode, boolean __timeouts,
                ConnectionOption<?>[] __opts)
                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 asVMObject has a Cognitive Complexity of 33 (exceeds 24 allowed). Consider refactoring.
        Open

            public final Object asVMObject(Object __in, boolean __noclassres)
            {
                // Null is converted to null
                if (__in == null)
                    return SpringNullObject.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 parse has a Cognitive Complexity of 32 (exceeds 24 allowed). Consider refactoring.
        Open

            public static final HTTPResponseHeader parse(InputStream __in)
                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

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

            public Image parse()
                throws IOException
            {
                DataInputStream in = this.in;
                

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

            private final void __process(OutputStream __sout)
                throws IOException, NullPointerException
            {
                if (__sout == 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

        Severity
        Category
        Status
        Source
        Language