Showing 4,829 of 7,767 total issues

Function domClass_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    domClass_(no?: zk.DomClassOptions): string {
        let domClass = /*safe*/ _xWidget.domClass_.call(this, no),
            n = this.$n() as HTMLElement | undefined;
        if (n) {
            const jqn = jq(n),
Severity: Minor
Found in zk/src/main/resources/web/js/zk/flex.ts - About 25 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 row$mold$ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function row$mold$(out) {
    out.push('<tr', this.domAttrs_(), '>');
    var /*safe*/ zcls = this.getZclass(),
        grid = this.getGrid(),
        head = grid.getHeadWidget();
Severity: Minor
Found in zul/src/main/resources/web/js/zul/grid/mold/row.js - About 25 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 echo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

            export function echo(dtid?: string | zk.Desktop): void {
                var dt = zk.Desktop.$(dtid),
                    aureqs = dt ? zAu.getAuRequests(dt) : [];
                // Bug ZK-2741
                for (var i = 0, j = aureqs.length; i < j; i++) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 25 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 onFitSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        onFitSize(this: zk.Widget): void {
            const wgt = this,
                c = wgt.$n();
            if (c && zk(c).isVisible()) {
                // Bug ZK-3014: offsetWidth will be available only when wgt is real visible
Severity: Minor
Found in zk/src/main/resources/web/js/zk/flex.ts - About 25 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 style$mold$ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function style$mold$(out) {
    var src, v;

    out.push('<div style="display:none" id="', this.uuid, '">&#160;');
    if ((src = this._src))
Severity: Minor
Found in zul/src/main/resources/web/js/zul/utl/mold/style.js - About 25 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 pushCmds has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function pushCmds(cmds: AuCommands, rs: [string, ({ $u?: string } & zk.Widget | undefined)[]][]): void {
    for (var j = 0, rl = rs ? rs.length : 0; j < rl; ++j) {
        var r = rs[j],
            cmd = r[0],
            data = r[1];
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 25 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 toolbarpanel$mold$ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function toolbarpanel$mold$(out) {
    let w;
    out.push('<div ', this.domAttrs_(), '><table id="', this.uuid,
        '-cave" class="', this.$s('content'), ' ', this.$s(this.getAlign()),
        '"', /*safe*/ zUtl.cellps0, '><tbody>');
Severity: Minor
Found in zul/src/main/resources/web/js/zul/wgt/mold/toolbarpanel.js - About 25 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 sendAhead has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        export function sendAhead(aureq: zk.Event, timeout = 0): void {
            const t = aureq.target;
            if (t) {
                const dt = t instanceof zk.Desktop ? t : t.desktop!;
                zAu.getAuRequests(dt).unshift(aureq);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 25 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 setScale has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    setScale(val: zk.BigDecimal, scale: number, rounding: number): zk.BigDecimal { //bug #3089502: setScale in decimalbox not working
        if (scale === undefined || scale < 0)
            return val;
        var valStr = val.$toString(),
            indVal = valStr.indexOf('.'),
Severity: Minor
Found in zk/src/main/resources/web/js/zk/fmt/numfmt.ts - About 25 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 _dragMove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _dragMove(evt: JQuery.DragEvent<never, {orient: string; point: number; pos: number}>): void {
        var data = evt.data,
            orient = data.orient,
            point = data.point,
            pos = data.pos,
Severity: Minor
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 25 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 $binder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    $binder(): zkbind.Binder | undefined {
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        var w: zk.Widget | undefined = this;
        for (; w; w = w.parent) {
            if (w.$ZKBINDER$)
Severity: Minor
Found in zkbind/src/main/resources/web/js/zkbind/Binder.ts - About 25 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 nodeName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    nodeName(el?: Element, ...tags: string[]): boolean {
        var tag = el && el.nodeName ? el.nodeName.toLowerCase() : '',
            j = arguments.length;
        if (j <= 1)
            return !!tag;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 25 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 scrollOffset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    scrollOffset(): zk.Offset {
        //Fix opera bug (see the page function)
        // If tag is "img" or "tr", the "div" element's scrollTop should be ignored.
        // Because the offsetTop of element "img" or "tr" is excluded its scrollTop.
        var node = this.jq![0],
Severity: Minor
Found in zk/src/main/resources/web/js/zk/domopera.ts - About 25 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 _showScrollbar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function _showScrollbar(wgt: Scrollbar, orient: string, opacity: number): void {
    var isHide = opacity == 0,
        bar = wgt.$n(orient),
        embed = wgt.$n(orient + '-embed'),
        style: CSSStyleDeclaration;
Severity: Minor
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 25 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 isAncestor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        static isAncestor(p?: zk.Widget, c?: zk.Widget & {getParent?(): zk.Widget}): boolean {
            if (!p) return true;
            for (; c; c = c.getParent ? c.getParent() : c.parent)
                if (p == c)
                    return true;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - About 25 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 _mouseOver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _mouseOver(evt: zk.Event): void {
        var cls = evt.target.className,
            index = cls.lastIndexOf('-'),
            key = cls.substring(index + 1),
            $drag = jq(this.edrag);
Severity: Minor
Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 25 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 _getWndScroll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _getWndScroll(w: Window): zk.Dimension {
        var T: number | undefined, L: number | undefined, W: number | undefined, H: number | undefined,
            doc = w.document,
            de = doc.documentElement;
        if (de && de.scrollTop) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.ts - About 25 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 $ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    $<T extends zk.Widget>(opts?: Partial<{exact: boolean; strict: boolean; child: boolean}>): T {
        const e = this.jq[0];
        if (e) {
            const target = e[zk.Widget._TARGET] as T;
            if (target) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 25 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 _tapHoldStart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _tapHoldStart(evt: JQuery.TouchEventBase) {
        var tevt = evt.originalEvent as TouchEvent;

        if (tevt.touches.length > 1)
            return;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/domtouch.ts - About 25 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 formatDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    formatDate(val: DateImpl, fmt?: string, localizedSymbols?: zk.LocalizedSymbols): string {
        var d: LeapDay | undefined;
        if (localizedSymbols) {
            var localeDateTimeFormat = new Intl.DateTimeFormat(localizedSymbols.LAN_TAG, { year: 'numeric' });
            this._offset = localizedSymbols.YDELTA || zk.fmt.Date.getYDelta(val._moment.toDate(), localeDateTimeFormat);
Severity: Minor
Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 25 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