Showing 7,775 of 7,775 total issues

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

    public final void setNamespace(Namespace ns) {
        if (ns == null) {
            if (_ns != null && _ns.getPrefix().length() == 0)
                return; //nothing to do
            ns = getNamespace("");
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/Element.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 nextToken has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static final Result nextToken(String src, int from,
    char[] separators, boolean escBackslash, boolean quotAsToken,
    boolean parenthesis)
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 45 mins to fix

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

        public static void escapeJavaScript(final char[] text, final int offset, final int len, final Writer writer,
                                            final JavaScriptEscapeType type, final JavaScriptEscapeLevel level)
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.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 joinAndInterrupt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static final void joinAndInterrupt(Thread thd, int timeout)
          throws InterruptedException {
              if (timeout == 0)
                  timeout = Integer.MAX_VALUE;
      
      
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/lang/Threads.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 escapeJavaScript has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static void escapeJavaScript(final char[] text, final int offset, final int len, final Writer writer,
                                              final JavaScriptEscapeType type, final JavaScriptEscapeLevel level)
                                              throws IOException {
      
              if (writer == null) {
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.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

      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

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

            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

            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

              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

                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 setValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void setValue(ELContext context, Object base, Object property,
                              Object value) {
                          if (context == null) {
                              throw new NullPointerException();
                          }
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/ArrayELResolver.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 > 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 > 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 > 10)
                                              kind = 10;
                      Severity: Major
                      Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

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

                            public static Class<?> forName(String name) throws ClassNotFoundException {
                                if (null == name || "".equals(name)) {
                                    return null;
                                }
                                Class<?> c = forNamePrimitive(name);
                        Severity: Minor
                        Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 > 1)
                                                kind = 1;
                        Severity: Major
                        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language