SquirrelJME/SquirrelJME

View on GitHub
modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/image/PNGReader.java

Summary

Maintainability
B
4 hrs
Test Coverage

Consider simplifying this complex logical expression.
Open

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

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

        public void parse()
            throws IOException
        {
            DataInputStream in = this.in;
            NativeImageLoadCallback loader = this.loader;

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

        private void __parseHeader(DataInputStream __in)
            throws IOException, NullPointerException
        {
            // Check
            if (__in == 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 __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

    There are no issues that match your filters.

    Category
    Status