Showing 4,841 of 7,782 total issues

Avoid deeply nested control flow statements.
Open

                        while (f < (i + 4) && f < max) {
                            final char cf = text.charAt(f);
                            if (!((cf >= '0' && cf <= '9') || (cf >= 'A' && cf <= 'F') || (cf >= 'a' && cf <= 'f'))) {
                                break;
                            }
Severity: Major
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            while (f < (i + 4) && f < max) {
                                final char cf = text[f];
                                if (!((cf >= '0' && cf <= '9') || (cf >= 'A' && cf <= 'F') || (cf >= 'a' && cf <= 'f'))) {
                                    break;
                                }
    Severity: Major
    Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 45 mins to fix

      Method writeObject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private synchronized void writeObject(ObjectOutputStream s)
          throws IOException {
              s.defaultWriteObject();
      
              if (_m == null) {
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/lang/reflect/SerializableMethod.java - About 45 mins 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 match has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private static
          Method match(Class<?> cls, String name, Object[] args, boolean loosely) {
              final Method[] ms = cls.getMethods();
              for (int j = 0; j < ms.length; ++j) {
                  if (!ms[j].getName().equals(name)
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/lang/Classes.java - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                              if ((f - (i + 2)) < 2) {
                                  // We weren't able to consume the required two hexa chars, leave it as slash+'x', which
                                  // is invalid, and let the corresponding JavaScript engine fail.
                                  i++;
                                  continue;
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (node instanceof Element) {
                                        eOther = (Element) node;
                                        break;
                                    }
        Severity: Major
        Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractGroup.java - About 45 mins to fix

          Method nextSeparator has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static int nextSeparator(String src, int from, char[] separators,
              boolean escBackslash, boolean escQuot, boolean quotAsSeparator) {
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 45 mins to fix

            Method escape has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                static void escape(final char[] text, final int offset, final int len, final Writer writer,
                                   final JavaScriptEscapeType escapeType, final JavaScriptEscapeLevel escapeLevel)
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 45 mins to fix

              Method importClass has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void importClass(String name) throws org.zkoss.zel.ELException {
                      if (!name.contains(".")) {
                          throw new ELException(Util.message(
                                  null, "importHandler.invalidClassName", name));
                      }
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/ImportHandler.java - About 45 mins 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 coerce has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private static final int coerce(Object property) {
                      if (property instanceof Number) {
                          return ((Number) property).intValue();
                      }
                      if (property instanceof Character) {
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/ListELResolver.java - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                                   if (kind > 10)
                                      kind = 10;
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                Method isReadOnly has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public boolean isReadOnly(ELContext context, Object base, Object property) {
                        if (context == null) {
                            throw new NullPointerException();
                        }
                
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/ListELResolver.java - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                     if (kind > 57)
                                        kind = 57;
                Severity: Major
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                       if (kind > 1)
                                          kind = 1;
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                         if (kind > 56)
                                            kind = 56;
                    Severity: Major
                    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                           if (kind > 10)
                                              kind = 10;
                      Severity: Major
                      Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                    if (c.gen < jj_gen) c.first = null;
                        Severity: Major
                        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                               if (kind > 57)
                                                  kind = 57;
                          Severity: Major
                          Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                 if (kind > 56)
                                                    kind = 56;
                            Severity: Major
                            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

                              Method LexicalError has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
                              Severity: Minor
                              Found in zel/src/main/java/org/zkoss/zel/impl/parser/TokenMgrError.java - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language