Showing 4,841 of 7,782 total issues

Method render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void render(ActionContext ac, boolean nested) throws DspException, IOException {
        if (!isEffective())
            return;

        final Map<String, Object> attrs = new HashMap<String, Object>();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/html/Box.java - About 35 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 renderWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderWith(ActionContext ac, Status st, Object[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = ary[j];
            if (_var != null)
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java - About 35 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 renderWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderWith(ActionContext ac, Status st, byte[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Byte(ary[j]);
            if (_var != null)
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java - About 35 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 trim has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static void trim(Node node) {
        for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
            final Object o = it.next();
            if (o instanceof TextNode) {
                final String s = ((TextNode) o).getText();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 35 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 nextSeparator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static int nextSeparator(Context ctx, int from, int to) {
        for (; from < to; ++from) {
            final char cc = ctx.content.charAt(from);
            if ((cc < '0' || cc > '9') && (cc < 'a' || cc > 'z') && (cc < 'A' || cc > 'Z') && cc != '_')
                break;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 35 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 renderWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderWith(ActionContext ac, Status st, long[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Long(ary[j]);
            if (_var != null)
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java - About 35 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 _bc_rec_mul has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

libbcmath._bc_rec_mul = function(a, b, c, d, e) {
    var g, f, h, k, l, m, n;
    if (b + d < libbcmath.MUL_BASE_DIGITS || b < libbcmath.MUL_SMALL_DIGITS || d <
        libbcmath.MUL_SMALL_DIGITS) return libbcmath._bc_simp_mul(a, b, c, d, e);
    e = Math.floor((libbcmath.MAX(b, d) + 1) / 2);
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 35 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 bc_num has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    bc_num: function() {
        this.n_value = this.n_scale = this.n_len = this.n_sign = null;
        this.toString = function() {
            var a, b;
            b = this.n_value.join("");
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 35 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 selectbox$mold$ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function selectbox$mold$(out) {
    out.push('<select', this.domAttrs_(), '>');
    var s = $eval(this.items) || [];
    for (var i = 0, j = s.length; i < j; i++) {
        out.push('<option');
Severity: Minor
Found in zul/src/main/resources/web/js/zul/wgt/mold/selectbox.js - About 35 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 _isSameBaseline has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _isSameBaseline(ref: zk.Dimension & {_hgh?: number; _wdh?: number}, cur: zk.Dimension, vertical): boolean {
    let hgh: number, wdh: number;
    if (vertical) {
        hgh = ref._hgh ?? (ref._hgh = ref.top + ref.height);
        wdh = ref._wdh ?? (ref._wdh = ref.left + ref.width);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/flex.ts - About 35 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 getHost has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function getHost(pkg: string, js: boolean): string {
    for (var p in _pkghosts)
        if (pkg.startsWith(p))
            return _pkghosts[p][js ? 1 : 0];
    return _defhost[js ? 1 : 0];
Severity: Minor
Found in zk/src/main/resources/web/js/zk/pkg.ts - About 35 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 afterMount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function afterMount(fn?: () => void, delay?: number): boolean { //part of zk
    if (fn) {
        if (!jq.isReady)
            jq(function () {
                zk.afterMount(fn);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/mount.ts - About 35 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 _respException has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        export function _respException(reqInf: AuRequestInfo, e: Error): boolean {
            if (!window.zAu)
                return true; //the doc has been unloaded

            zAu.ajaxReq = zAu.ajaxReqInf = undefined;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 35 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 $toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    $toString(): string { //toString is reserved keyword for IE
        if (this._value.length == 0) return '';
        var j = this._value.length - this._precision,
            valFixed = '';
        if (j < 0)
Severity: Minor
Found in zk/src/main/resources/web/js/zk/math.ts - About 35 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 newInstance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        newInstance(param?: number | DateImpl | Parameters<DateConstructor['UTC']>, tz?: string): DateImpl {
            let m: Moment;
            if (tz)
                tz = parseTzId(tz);
            else
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dateImpl.ts - About 35 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 off has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    off: function (this: JQuery, type: string, selector: unknown, fn: unknown, ...rest: unknown[]) {
        var evtType: string | undefined;
        if ((evtType = zjq.eventTypes[type])) {
            // refer to jquery on function for reassign args
            if (selector === false || typeof selector === 'function') {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/domtouch.ts - About 35 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 revisedOffset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    revisedOffset(ofs?: zk.Offset): zk.Offset {
        var el = this.jq[0];
        if (!ofs) {
            if (el.getBoundingClientRect) { // IE and FF3
                var elst: undefined | CSSStyleDeclaration, oldvisi: undefined | string,
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 35 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 fireSized has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        static fireSized(wgt: zk.Widget, bfsz?: number): void {
            // ignore delayed rerendering case, like Bug ZK-2281
            if (wgt.desktop) {
                if (zk.clientinfo) { // Fix ZK-5017, not to use setTimeout here
                    zk.afterAuResponse(() => this.fireSized(wgt, bfsz));
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - About 35 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 destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    destroy(): void {
        var cave = this.cave;
        jq(cave)
            //unbind scroll event for input tab scroll
            .off('scroll', this.proxy(this._fixScroll))
Severity: Minor
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 35 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 defaultAnimaOpts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        defaultAnimaOpts(wgt: zk.Widget, opts: zk.SlideOptions, prop: string[], visible?: boolean): this {
            var self = this;
            jq.timers.push(function () {
                if (!visible)
                    zWatch.fireDown('onHide', wgt);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/anima.ts - About 35 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