Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                    if (Object.prototype.hasOwnProperty.call(data, key)) {
                        newData[key] = _deconstructPacket(data[key] as never, buffers);
                    }
Severity: Major
Found in zk/src/main/resources/web/js/zk/au.ts - About 45 mins to fix

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

    function optgroup$mold$(out) {
        const visible = this.isVisible();
        if (visible) out.push('<optgroup', this.domAttrs_(), '>');
        for (let w = this.nextSibling; w; w = w.nextSibling) {
            if ((w instanceof zul.sel.Optgroup))
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/sel/mold/optgroup.js - 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 (!localeFamilies[config.parentLocale]) {
                                localeFamilies[config.parentLocale] = [];
                            }
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 45 mins to fix

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

      function _getTextSize(zkc: zk.JQZK, zkp: zk.JQZK, zkpOffset: zk.Offset): zk.Offset {
          let $zkc = zkc.jq,
              $prev = $zkc.prev(),
              pos: zk.Offset = [0, 0],
              coldVal: Record<string, string>,
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/flex.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

                              do {
                                  if (id = data[j] && data[j]!.$u)
                                      data[j] = zk.Widget.$(id) as never;
                              } while (j--);
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/au.ts - About 45 mins to fix

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

        function mtBL(): void {
            for (; ;) {
                if (zk.loading) {
                    zk.afterLoad(mtBL); //later
                    return;
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/mount.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 (purejdot < 0)
                                purejdot = pure.length;
        Severity: Major
        Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 45 mins to fix

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

                  sync(el?: HTMLElement): void {
                      if (el === undefined || !zk(el).isVisible(true)) {
                          this.hide();
                          return;
                      }
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/effect.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

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

          export function depends(a: string, b: string): void {
              if (a && b) {//a depends on b
                  if (_loaded[a])
                      zk.load(b);
                  else {
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/pkg.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

                      } else if (cc == '.') { //.xxx or . // B50-3297864
                          break;
                      }
          Severity: Major
          Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!cwgt.ignoreFlexSize_(o)) {
                                        let c = cwgt.$n();
                                        if (c) { //node might not exist if rod on
                                            //Skip absolute or fixed DOM element size
                                            const cpos = c.style.position;
            Severity: Major
            Found in zk/src/main/resources/web/js/zk/flex.ts - About 45 mins to fix

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

              export function load(pkg: string, dt?: zk.Desktop | CallableFunction, func?: CallableFunction): boolean {
                  if (typeof dt == 'function') {
                      if (func)
                          throw 'At most one function allowed';
                      else {
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/pkg.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

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

              function mtBL1(): void {
                  if (_crInfBL0.length || _crInfBL1.length)
                      return; //another page started
              
                  zk.booted = true;
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/mount.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

                                      for (; c; c = c.nextSibling) {
                                          //Skip absolute or fixed DOM element size
                                          isText = c.nodeType == 3; // Bug ZK-2275, we need to update c.nodeType
                                          if (!isText) {
                                              const cpos = (c as HTMLElement).style.position;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/flex.ts - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (jdot < 0)
                                        jdot = ret.length;
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 45 mins to fix

                  Function on has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      on: function (this: JQuery, type: string, selector, data: unknown, fn: unknown, ...rest: unknown[]) {
                  Severity: Minor
                  Found in zk/src/main/resources/web/js/zk/domtouch.ts - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (p == document.body) 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 (p2 && !_loaded[p2]) { //yes, more
                                              var a1 = a, b1 = b;
                                              b = function () {
                                                  zk.afterLoad(a1, b1, front); //check again
                                              };
                      Severity: Major
                      Found in zk/src/main/resources/web/js/zk/pkg.ts - About 45 mins to fix

                        Function zkver has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            export function zkver(ver: string, build: string, ctxURI: string, updURI: string, modVers: Record<string, string>, opts: Record<string, unknown>): void {
                        Severity: Minor
                        Found in zk/src/main/resources/web/js/zk/mount.ts - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if (cc == '.' && j > ++k)
                                              sb = sb.substring(0, k) + sb.substring(j);
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language