SquirrelJME/SquirrelJME

View on GitHub
modules/json/src/main/java/net/multiphasicapps/jsr353/ReaderInput.java

Summary

Maintainability
F
3 days
Test Coverage

Method __nextInternal has a Cognitive Complexity of 142 (exceeds 24 allowed). Consider refactoring.
Open

    private Data __nextInternal()
        throws IOException
    {
        // Reading loop
        for (;;)
Severity: Minor
Found in modules/json/src/main/java/net/multiphasicapps/jsr353/ReaderInput.java - About 2 days 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 __nextInternal has 156 lines of code (exceeds 100 allowed). Consider refactoring.
Open

    private Data __nextInternal()
        throws IOException
    {
        // Reading loop
        for (;;)

    Consider simplifying this complex logical expression.
    Open

                        if (c == '-' || c == '+' || (c >= '0' && c <= '9') ||
                            c == 'e' || c == 'E' || c == '.')
                        {
                            // Make big E, a little e
                            if (c == 'E')

      Consider simplifying this complex logical expression.
      Open

                          if (!(c == '-' || c == '+' || (c >= '0' && c <= '9') ||
                              c == 'e' || c == 'E' || c == '.'))
                              throw new JsonParsingException(String.format(
                                  "illgnum", (char)c), jl);

        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 (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

            There are no issues that match your filters.

            Category
            Status