Showing 7,775 of 7,775 total issues

Method fixSiblings has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixSiblings(boolean checked, boolean byclient) {
        final Radiogroup group = getRadiogroup();
        if (group != null) {
            if (checked) {
                final Radio sib = group.getSelectedItem();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radio.java - About 1 hr 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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static int getGroupIndex(List<int[]> groupInfo, int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = groupInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listgroup.java - About 1 hr 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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ int getGroupIndex(int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 1 hr 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 getGroupIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    /* package */int getGroupIndex(int index) {
        int j = 0, gindex = -1;
        int[] g = null;
        for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext(); ++j) {
            g = it.next();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 onEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public void onEvent(Event event) throws Exception {
            if (_modelInitListener != null) {
                Listbox.this.removeEventListener("onInitModel", _modelInitListener);
                _modelInitListener = null;
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 fixSelectedIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixSelectedIndex(int j) {
        if (!_selItems.isEmpty()) {
            int realj = getRealIndex(j);
            if (realj < 0)
                realj = 0;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 readObject has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("rawtypes")
    private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        _model = (ListModel) s.readObject();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 compare0 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private int compare0(Object o1, Object o2, String fieldname, boolean asc, String func)
            throws NoSuchMethodException {
        // Bug B50-3183438: Access to bean shall be consistent
        final Object f1 = o1 instanceof Map ? ((Map) o1).get(fieldname)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/FieldComparator.java - About 1 hr 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 equals has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public final boolean equals(Object o) {
            if (_entry != null)
                return _entry.equals(o);

            if (!(o instanceof Map.Entry))
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 1 hr 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 forward has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static final void forward(ServletContext ctx, ServletRequest request, ServletResponse response, String uri,
            Map params, int mode) throws IOException, ServletException {
        //        if (log.isDebugEnabled()) log.debug("Forwarding "+uri);

        //include or foward depending whether this page is included or not
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 1 hr 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 hbox$mold$ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function hbox$mold$(out) {
    let w;
    delete this._splitterKid;
    for (w = this.firstChild; w; w = w.nextSibling)
        if ((w instanceof zul.box.Splitter)) {
Severity: Minor
Found in zul/src/main/resources/web/js/zul/box/mold/hbox.js - About 1 hr 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 select$mold$ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function select$mold$(out) {
    out.push('<select', this.domAttrs_(), '>');

    let w;
    if (this.hasGroup())
Severity: Minor
Found in zul/src/main/resources/web/js/zul/sel/mold/select.js - About 1 hr 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 setHost has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function setHost(host: string, resURI: string, pkgs: string[]): void {
    var hostRes = host + resURI;
    if (!_defhost.length)
        for (var scs = document.getElementsByTagName('script'), j = 0, len = scs.length;
        j < len; ++j) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/pkg.ts - About 1 hr 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 zkdt has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    export function zkdt(dtid?: string, contextURI?: string, updateURI?: string, resourceURI?: string, reqURI?: string): zk.Desktop {
        var dt = zk.Desktop.$(dtid);
        if (dt == null) {
            dt = new zk.Desktop(dtid!, contextURI, updateURI, resourceURI, reqURI);
            if (zk.pfmeter) zAu._pfrecv(dt, dtid);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/mount.ts - About 1 hr 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 _dblTapStart has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    _dblTapStart(evt: JQuery.TouchStartEvent) {
        var tevt = evt.originalEvent as TouchEvent;
        if (tevt.touches.length > 1) return;
        if (!this._tapValid) {
            this._startTap!(this);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/domtouch.ts - About 1 hr 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 init has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    init(sel: string | zk.Widget | HTMLElement, ctx, ...rest: unknown[]): JQuery {
        if (ctx === zk) {
            if (typeof sel == 'string'
            && zUtl.isChar(sel.charAt(0), {digit: 1, upper: 1, lower: 1, '_': 1})) {
                var el = document.getElementById(sel);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 hr 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 on has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

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

        static isEqualObject(a: unknown, b: unknown): boolean {
            // Identical objects are equal. `0 === -0`, but they aren't identical.
            // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
            if (a === b) return a !== 0 || 1 / (a as number) === 1 / (b as number);
            // `null` or `undefined` only equal to itself (strict comparison).
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - About 1 hr 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 _onSizeTarget has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function _onSizeTarget(wgt: zk.Widget): zk.Widget {
    var r1 = wgt, p1: zk.Widget | undefined = r1,
        j1 = -1;
    for (; p1 && p1._hflex == 'min'; p1 = p1.parent) {
        delete p1._hflexsz;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - About 1 hr 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 debounce has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        static debounce<T, A extends unknown[], R>(func: (this: T, ...args: A) => R, wait: number,
                                        immediate?: boolean): (this: T, ...args: A) => R {
            var timeout, args, context, timestamp, result;
            if (null == wait) wait = 100;

Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - About 1 hr 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