Showing 4,841 of 7,782 total issues

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))))
                    warnWrongZkAttr(attr);
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 (this == comp || comp._parent != null || comp._next != null || comp._prev != null || comp._chdinf != null
                    || comp._page != null)
                throw new IllegalStateException();
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (ownerPage == null //detached
                              || (_pgInvalid != null && _pgInvalid.contains(ownerPage))
                              || isAncestor(_invalidated, owner, true) || isAncestor(_attached, owner, true)
                              || isAncestor(removed, owner, true)) {
                          addPageRemoved(page);
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if (_recovering || _disabled || page == null || page instanceof VolatilePage || !_exec.isAsyncUpdate(page)
                        || isCUDisabled(comp))
                    return; //nothing to do
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                              if ((val == null || (val instanceof Serializable) || (val instanceof Externalizable))
                                      && !(val instanceof Component) && (filter == null || filter.accept(nm, val))) {
                                  s.writeObject(nm);
                                  s.writeObject(val);
                              }
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.java - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if (parent != null && !(parent instanceof Window) && !(parent instanceof Groupbox) && !(parent instanceof Panel)
                            && !(parent instanceof Tab) && !(parent instanceof LayoutRegion))
                        throw new UiException("Wrong parent: " + parent);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Caption.java - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                              if (!_multiple || (!paging && isAllRendered() && (curSeldItems == null || curSeldItems.size() <= 1))) {
                                  final Treeitem item = curSeldItems != null && curSeldItems.size() > 0
                                          ? curSeldItems.iterator().next() : null;
                                  selectItem(item);
                                  if (_model instanceof TreeSelectableModel) {
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        if (Double.compare(lowerBound, _lowerBound) != 0 || Double.compare(upperBound, _upperBound) != 0
                                || Double.compare(startAngle, _startAngle) != 0 || Double.compare(extent, _extent) != 0
                                || Double.compare(majorTickInterval, _majorTickInterval) != 0
                                || Double.compare(minorTickCount, _minorTickCount) != 0) {
                            _lowerBound = lowerBound;
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (!"horizontal".equals(orient) && !"top".equals(orient) && !"bottom".equals(orient)
                                  && !"vertical".equals(orient) && !"right".equals(orient) && !"left".equals(orient))
                              throw new WrongValueException("Unknow orient : " + orient);
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                else if (!"rect".equals(shape) && !"rectangle".equals(shape) && !"circle".equals(shape)
                                        && !"circ".equals(shape) && !"polygon".equals(shape) && !"poly".equals(shape))
                                    throw new WrongValueException("Unknown shape: " + shape);
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/Area.java - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                                  if (firstItemIndex <= index && index <= lastItemIndex // ZK-2658
                                                          && !curSeldItems.contains(item)
                                                          && (!paging || (from <= index && index < to))
                                                  ) {
                                                      removeItemFromSelection(item);
                      Severity: Major
                      Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ( !rneedsContext.test( selectors ) ) {
                                    for ( ; i < l; i++ ) {
                                        cur = this[ i ];
                                        let wgt = (hasZTag || hasZID) ? cur[zk.Widget._TARGET] || zk.Widget.$(cur, {exact: 1}) : false;
                                        for ( ; cur && cur !== context; cur = ((hasZTag || hasZID) && wgt ? wgt.$n() : cur.parentNode)) {
                        Severity: Major
                        Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                          if ( !support.focusin ) {
                              jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
                          
                                  // Attach a single capturing handler on the document while someone wants focusin/focusout
                                  var handler = function( event ) {
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
                                        context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
                            
                                        context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
                                            .replace( runescape, funescape ), context ) || [] )[ 0 ];
                            Severity: Major
                            Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if ( matcher[ expando ] ) {
                              
                                              // Find the next relative operator (if any) for proper handling
                                              j = ++i;
                                              for ( ; j < len; j++ ) {
                              Severity: Major
                              Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if (0 < f[1]) {
                                                var k = a.substr(e, f[1] - e),
                                                    l = [],
                                                    l = k.match(/([\x09\x0a\x0d\x20-\x7e]{5,})/g);
                                                if (null == l) l = [];
                                Severity: Major
                                Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ( support.qsa &&
                                                  !nonnativeSelectorCache[ selector + " " ] &&
                                                  ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
                                  
                                                  // Support: IE 8 only
                                  Severity: Major
                                  Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                          if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
                                            serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
                                          }
                                    Severity: Major
                                    Found in zk/src/main/resources/web/js/zk/ext/purify.js - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if (
                                                  !(
                                                      (milliseconds >= 0 && days >= 0 && months >= 0) ||
                                                      (milliseconds <= 0 && days <= 0 && months <= 0)
                                                  )
                                      Severity: Major
                                      Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 40 mins to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                  } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
                                                    return false;
                                                  } else ;
                                        Severity: Major
                                        Found in zk/src/main/resources/web/js/zk/ext/purify.js - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language