Showing 4,841 of 7,782 total issues

Avoid deeply nested control flow statements.
Open

                            if (!eraName) return; // no era match
Severity: Major
Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    if (callee.property.name === 'attr') {
                                        visitedNode[parent.range.toString()] = true;
                                        // ignore for .attr(key, null);
                                        return;
                                    }
    Severity: Major
    Found in eslint-plugin-zk/src/rules/noNull.ts - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

                  if ((cc < '0' || cc > '9') && (cc < 'a' || cc > 'z')
                  && (cc < 'A' || cc > 'Z'))
                      break;
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                        if((ch>='\u0000' && ch<='\u001F') || (ch>='\u007F' && ch<='\u009F') || (ch>='\u2000' && ch<='\u20FF')){
                            String ss=Integer.toHexString(ch);
                            sb.append("\\u");
                            for(int k=0;k<4-ss.length();k++){
                                sb.append('0');
        Severity: Major
        Found in zcommon/src/main/java/org/zkoss/json/JSONValue.java - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                                      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 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                                        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 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if (maxcnt > 0 || prefix.length() > 0) {
                          final int len = trace.length();
                          if (sb == null)
                               sb = new StringBuffer(len + 256);
                          if (maxcnt <= 0)
              Severity: Major
              Found in zcommon/src/main/java/org/zkoss/lang/Exceptions.java - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                                            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 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                                      } else if (c1 == '8' || c1 == '9' || c1 == '\n' || c1 == '\r' || c1 == '\u2028' || c1 == '\u2029') {
                  
                                          // '8' and '9' are not valid octal escape sequences, and the other four characters
                                          // are LineTerminators, which are not allowed as escape sequences. So we leave it as is
                                          // and expect the corresponding JavaScript engine to fail (except in the case of slash + '\n',
                  Severity: Major
                  Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                                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 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                          } else if (c1 == '8' || c1 == '9' || c1 == '\n' || c1 == '\r' || c1 == '\u2028' || c1 == '\u2029') {
                      
                                              // '8' and '9' are not valid octal escape sequences, and the other four characters
                                              // are LineTerminators, which are not allowed as escape sequences. So we leave it as is
                                              // and expect the corresponding JavaScript engine to fail (except in the case of slash + '\n',
                      Severity: Major
                      Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (_type == null && _id == null && _classes.isEmpty() && _pseudoClasses.isEmpty() && _attributes.isEmpty()
                                        && _pseudoElements.isEmpty())
                                    return "*";
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/SimpleSelectorSequence.java - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                              if ((cc >= 'a' && cc <= 'z') || (cc >= 'A' && cc <= 'Z')
                                                      || cc == '_' || cc == '$') {
                                                  for (; j < len; ++j) {
                                                      switch (cc = val.charAt(j)) {
                                                      case '(':
                          Severity: Major
                          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.java - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                            if ((cc < 'a' || cc > 'z') && (cc < 'A'
                                                                    || cc > 'Z') && (cc < '0' || cc > '9'))
                                                                return false;
                            Severity: Major
                            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.java - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                                  if ((cc < 'a' || cc > 'z') && (cc < 'A' || cc > 'Z') && (cc < '0' || cc > '9'))
                                                      throw new UiException(
                                                              message("Invalid extension; only letters and numbers are allowed: " + ext, elm));
                              Severity: Major
                              Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if (name == null || name.length() == 0 || namespace == null || namespace.length() == 0 || pageRenderer == null
                                                || locator == null)
                                            throw new IllegalArgumentException();
                                Severity: Major
                                Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                          if (!isZkAttr(langdef, attrns) && !isZKNamespace(attURI) && !"xmlns".equals(attPref)
                                                                  && !("xmlns".equals(attnm) && "".equals(attPref))
                                                                  && !"http://www.w3.org/2001/XMLSchema-instance".equals(attURI)) {
                                  
                                                              // Bug ZK-2995
                                  Severity: Major
                                  Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                                if (!bNativeContent && !bNative && (shouldIgnoreAnnotNamespace
                                                                        || (attURI.length() == 0 || LanguageDefinition.ZK_NAMESPACE.endsWith(attURI)))
                                                                        && AnnotationHelper.isAnnotation(attvaltrim)) {
                                                                    if (attrAnnHelper == null)
                                                                        attrAnnHelper = new AnnotationHelper();
                                    Severity: Major
                                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                      if (isZkElement(langdef, e, bNativeContent) && ("attribute".equals(n) || "custom-attributes".equals(n)
                                                              || "variables".equals(n) || "template".equals(n) || "zscript".equals(n))) { //we have to skip zscript because of B50-3259479
                                                          zkElem = n;
                                                          textAsAllowed = false;
                                                          //unable to handle them because EL/zscript might affect
                                      Severity: Major
                                      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 40 mins to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                        if (!"xmlns".equals(attnm) && !"xml".equals(attnm) && !attURI.contains("w3.org")
                                                                && (attPref == null || (!"xmlns".equals(attPref) && !"xml".equals(attPref))))
                                                            params.put(attnm, attval);
                                        Severity: Major
                                        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language