Showing 4,841 of 7,782 total issues

Method show has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static Button show(String message, String title, Button[] buttons, String[] btnLabels, String icon,
            Button focus, EventListener<ClickEvent> listener, Map<String, String> params) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Messagebox.java - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                if ((cc < '0' || cc > '9') && (cc < 'a' || cc > 'z') && (cc < 'A' || cc > 'Z') && cc != '_')
                    break;
    Severity: Major
    Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                                  if (m != e && !1 !== (l = this._array_search(k, this.textsubmodes[m]))) {
                                      (h + 1 == f || h + 1 < f && !1 !== this._array_search(this._ord(b.charAt(
                                          h + 1)), this.textsubmodes[e])) && (3 == m || 0 == m && 1 == e) ? 3
                                          == m ? g.push(29) : g.push(27): (g = g.concat(this.textlatch["" + e +
                                              m]), e = m);
      Severity: Major
      Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if ( support.matchesSelector && documentIsHTML &&
                !nonnativeSelectorCache[ expr + " " ] &&
                ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
        
        
        Severity: Major
        Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if (vertical) {
                  hgh = ref._hgh ?? (ref._hgh = ref.top + ref.height);
                  wdh = ref._wdh ?? (ref._wdh = ref.left + ref.width);
                  return cur.top >= hgh || cur.left < wdh;
              } else {
          Severity: Major
          Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

            Function showNotification has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                        export function showNotification(msg: string, type: zul.wgt.NotificationType, pid: string, ref: zk.Widget,
                            pos: string, off: zk.Offset, dur: number, closable: boolean): void {
            Severity: Major
            Found in zk/src/main/resources/web/js/zk/au.ts - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                              if (prej < 0
                                  && (cc == '#' || cc == '0' || cc == '.' || cc == '-' || cc == ',' || cc == 'E'))
                                  prej = ret.length;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if (((cc < '0' || cc > '9') && cc != '-' && cc != '+')
                                || (j && (cc == '-' || cc == '+')))
                                if (jdot < 0 && cc == '.') {
                                    jdot = j;
                                } else {
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/math.ts - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (_actTmout || _dragging.has(node) || evt.which != 1
                              || (zk.webkit && jq.nodeName(target, 'select'))
                              || (zk(target).isInput() && this.control != zk.Widget.$(target)))
                              return;
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (!wnd) {
                                const wnd = new zul.wnd.Window({
                                        id: 'aualert',
                                        closable: true,
                                        sclass: 'z-messagebox-window',
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/dom.ts - About 1 hr to fix

                      Method isIntersected has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final boolean isIntersected(Set<?> a, Set<?> b) {
                              final int sza = a != null ? a.size(): 0;
                              final int szb = b != null ? b.size(): 0;
                              if (sza == 0 || szb == 0)
                                  return false;
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/util/CollectionsX.java - About 55 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 getFormat has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final String getFormat(String ctype) {
                              if (ctype == null)
                                  throw new IllegalArgumentException();
                      
                              ctype = ctype.trim().toLowerCase(java.util.Locale.ENGLISH);
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/util/media/ContentTypes.java - About 55 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 load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void load(String prefix, String uri, Locator locator)
                          throws XelException {
                              if (prefix == null || uri == null)
                                  throw new IllegalArgumentException("null");
                              if (_mtds != null && _mtds.containsKey(prefix))
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/xel/util/TaglibMapper.java - About 55 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 load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          synchronized static final void load() {
                              if (_loaded)
                                  return;
                      
                              try {
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/xel/util/Evaluators.java - About 55 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 getTimeZone has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final TimeZone getTimeZone(int ofsmins) {
                              final StringBuffer sb = new StringBuffer(8).append("GMT");
                              if (ofsmins >= 0) {
                                  sb.append('+');
                              } else {
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/util/TimeZones.java - About 55 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 findAmbiguousComps has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static List<Element> findAmbiguousComps(Map<String, XMLResource> rcmap, Element el) {
                              List<Element> ambigComps = new ArrayList<Element>();
                              for (Map.Entry<String, XMLResource> entry: rcmap.entrySet()) { // find Ambiguous Components
                                  Element root = entry.getValue().document.getRootElement();
                                  if (root == null)
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/util/resource/ClassLocator.java - About 55 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 getDateTimeFormat has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final
                          String getDateTimeFormat(int dateStyle, int timeStyle, Locale locale,
                          String defaultFormat) {
                              if (locale == null)
                                  locale = Locales.getCurrent();
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/text/DateFormats.java - About 55 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 format has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static void format(Element e) {
                              //add proper spacing between consecutive elements
                              boolean elemFound = true;
                              for (final ListIterator<Item> it = e.getChildren().listIterator(); it.hasNext();) {
                                  final Object o = it.next();
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/idom/util/IDOMs.java - About 55 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 format has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static String format(String message, String pubId, String sysId,
                          int lineno, int colno) {
                              final StringBuffer sb = new StringBuffer();
                              final String inf = combine(pubId, sysId);
                              if (inf != null) {
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/xml/Locators.java - About 55 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 getTimeFormat has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final
                          String getTimeFormat(int style, Locale locale, String defaultFormat) {
                              if (locale == null)
                                  locale = Locales.getCurrent();
                      
                      
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/text/DateFormats.java - About 55 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

                      Severity
                      Category
                      Status
                      Source
                      Language