Showing 4,841 of 7,782 total issues

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 (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 (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 (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

          Avoid deeply nested control flow statements.
          Open

                                      if (cc == 'm') min = nv;
                                      else if (cc == 's') sec = nv;
                                      else msec = nv;
          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 (token && token.length > len) {
                                              ts[--i] = token.substring(len);
                                              token = token.substring(0, len);
                                          }
              Severity: Major
              Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

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

                    getRuleNames: function (func: TSESTree.Node): string[] {
                
                        // Unwrap the possible call expression.
                        if (func.type === 'CallExpression')
                            func = func.callee;
                Severity: Minor
                Found in eslint-plugin-zk/src/tree.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 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 (len == 3)
                                                symbols = localizedSymbols.SMON!;
                                            else if (len == 4)
                                                symbols = localizedSymbols.FMON!;
                                            else
                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 (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

                    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 (ydelta === 0 && newY < 100) { // only handle twoDigitYearStart with ISO calendar for now
                                                    // ZK-4235: Datefmt parseDate always return date between 1930-2029 when using yy format
                                                    var twoDigitYearStart = zk.TDYS,
                                                        lowerBoundary = (Math.floor(twoDigitYearStart / 100) * 100) + newY,
                                                        upperBoundary = lowerBoundary + 100;
                    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 (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

                          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 (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

                            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 (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

                              Avoid deeply nested control flow statements.
                              Open

                                                      } else if (len <= 2) {
                                                          if (nosep && token && token.length > 2) {//Bug 2560497 : if no separator, token must be assigned.
                                                              ts[--i] = token.substring(2);
                                                              token = token.substring(0, 2);
                                                          }
                              Severity: Major
                              Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language