Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                        if (jq(p).css('position') == 'absolute') {
                            isAbsolute = true;
                            break;
                        }
Severity: Major
Found in zk/src/main/resources/web/js/zk/dom.ts - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (!jq('#zk_proc').length) //B65-ZK-1431: check if progressbox exists
                            zUtl.progressbox('zk_proc', window.msgzk ? msgzk.PLEASE_WAIT : 'Processing...', true);
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/mount.ts - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (_afterKD(w, wevt))
                                  return;
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/mount.ts - About 45 mins to fix

        Function isChar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                static isChar(cc: string, opts: Partial<IsCharOptions>): boolean {
                    return !!((opts.digit && cc >= '0' && cc <= '9')
                        || (opts.upper && cc >= 'A' && cc <= 'Z')
                        || (opts.lower && cc >= 'a' && cc <= 'z')
                        || (opts.whitespace && (cc == ' ' || cc == '\t' || cc == '\n' || cc == '\r'))
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/utl.ts - 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 (newY < 100 && newY === (y + ydelta) % 100) break; // assume yy is not modified
        Severity: Major
        Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

          Function _createWrapper has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                  _createWrapper(element: JQuery): JQuery {
                      // ZK-5354: Update animation implementation to avoid iframe reloading
                      if (element.find('iframe').length) {
                          return element;
                      }
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/anima.ts - 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 (txt.trim().length) {
                              const w = new zk.Native();
                              w.prolog = txt;
                              wgt.appendChild(w);
                          } else if (wgt.blankPreserved)
          Severity: Major
          Found in zk/src/main/resources/web/js/zk/zuml/Parser.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        for (var index = symbols.length, brkswch; --index >= 0;) {
                                            var monStr = symbols[index].toLowerCase();
            
                                            if ((nonLenient && mon == monStr) || (!nonLenient && mon.startsWith(monStr))) {
                                                var monStrLen = monStr.length;
            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 (ary.length) {
                                      ts.push(ary.join(''));
                                      ary = [];
                                  }
              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 (len < 3) len = 2;
                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 (fmt.charAt(k) == 'r') k++; // ZK-2964: for nl local uur
                  Severity: Major
                  Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

                    Function parseDate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        parseDate(
                            txt: string,
                            fmt: string,
                            strict?: boolean,
                            refval?: DateImpl,
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - 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 (isNaN(nv = _parseInt(token)))
                                                    return; // failed, B50-3314513
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

                      Function constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          constructor(widget: zk.Widget, currentTarget: object) {
                              super(); // FIXME: params?
                              this.$view = widget;
                              this.$currentTarget = currentTarget;
                              this._aftercmd = {};
                      Severity: Minor
                      Found in zkbind/src/main/resources/web/js/zkbind/Binder.ts - 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 (nosep)
                                                      token = _parseToken(token, ts, --i, token.length);//token.length: the length of French month is 4
                      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 (!eraName) return; // no era match
                        Severity: Major
                        Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

                          Function _doAnique has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function _doAnique(id: string): void {
                              var ary = zk._anique[id];
                              if (ary) {
                                  var al = ary.length, data: Anima | undefined;
                                  while (data = ary.shift()) {
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/anima.ts - 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 (s2) s = s2 + s.substring(j);
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/zuml/Parser.ts - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (brkswch)
                                                            break;
                            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 (d < 0 || d > 31) //restrict since user might input year for day (ok to allow 0 and 31 for easy entry)
                                                              return; //failed
                              Severity: Major
                              Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language