zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java

Summary

Maintainability
D
2 days
Test Coverage

File SimpleCharStream.java has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package org.zkoss.zel.impl.parser;

/**
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 4 hrs to fix

    SimpleCharStream has 25 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @SuppressWarnings("all") // Ignore warnings in generated code
    public class SimpleCharStream
    {
    /** Whether parser is static. */
      public static final boolean staticFlag = false;
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 2 hrs to fix

      Method FillBuff has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        protected void FillBuff() throws java.io.IOException
        {
          if (maxNextCharInd == available)
          {
            if (available == bufsize)
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.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 FillBuff has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        protected void FillBuff() throws java.io.IOException
        {
          if (maxNextCharInd == available)
          {
            if (available == bufsize)
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 1 hr to fix

        Method ExpandBuff has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          protected void ExpandBuff(boolean wrapAround)
          {
            char[] newbuffer = new char[bufsize + 2048];
            int newbufline[] = new int[bufsize + 2048];
            int newbufcolumn[] = new int[bufsize + 2048];
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 1 hr to fix

          Method adjustBeginLineColumn has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public void adjustBeginLineColumn(int newLine, int newCol)
            {
              int start = tokenBegin;
              int len;
          
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 1 hr to fix

            Method UpdateLineColumn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              protected void UpdateLineColumn(char c)
              {
                column++;
            
                if (prevCharIsLF)
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 1 hr to fix

              Method adjustBeginLineColumn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                public void adjustBeginLineColumn(int newLine, int newCol)
                {
                  int start = tokenBegin;
                  int len;
              
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.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 ReInit has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                public void ReInit(java.io.InputStream dstream, String encoding, int startline,
                                        int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status