Showing 4,841 of 7,782 total issues

Method encodeURI0 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static final String encodeURI0(String s, char[] unsafes) throws UnsupportedEncodingException {
        if (s == null)
            return null;

        final String charset = Charsets.getURICharset();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Encodes.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 getMaxNodeSize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function getMaxNodeSize(node) {
    var cn = 0;
    if (node.children) {
        cn = node.children.length;
        var levelInfos = {depth: 0, nodeSizes: [cn]};
Severity: Minor
Found in zktest/src/main/webapp/js/dtree.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 _intval has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    _intval: function(a, b) {
        var c;
        c = typeof a;
        return "boolean" ===
            c ? +a : "string" === c ? (c = parseInt(a, b || 10), isNaN(c) || !isFinite(
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.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 _sprintf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    _sprintf: function() {
        var a = arguments,
            b = 0,
            c = function(a, b, c, d) {
                c || (c = " ");
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.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 encode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        export function encode(j: number, aureq: zk.Event, dt: zk.Desktop): string {
            var target = aureq.target,
                opts = aureq.opts || {},
                portlet2Namespace = '';

Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.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 loadAPIs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export function loadAPIs(wgt: zk.Widget, callback: () => void, msg: string, timeout: number): void {
    var opts = {
        condition(): boolean {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            return !!(window['google'] && window['google'].load);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/gapi/gapi.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 sync has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        sync(): boolean {
            var node = this.node, $node = jq(node);
            if (!node || !$node.zk.isVisible(true)) {
                if (this.opts.stackup && node) {
                    if (!this.stackup)
Severity: Minor
Found in zk/src/main/resources/web/js/zk/effect.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 mtAU has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function mtAU(): void {
    for (; ;) {
        if (zk.loading) {
            zk.afterLoad(mtAU);
            return;
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 caption$mold$ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function caption$mold$(out) {
    var p = this.parent,
        /*safe*/ cnt = this.domContent_(),
        tabi = this._tabindex || 0,
        btnRenderer = zul.wgt.ButtonRenderer;
Severity: Minor
Found in zul/src/main/resources/web/js/zul/wgt/mold/caption.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 ncols has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    ncols(visibleOnly?: boolean): number {
        var row = this.jq[0],
            cnt = 0;
        if (row instanceof HTMLTableRowElement) {
            var cells = row.cells;
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 addChd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

            export function addChd(wgt: zk.Widget, ...rargs: string[]): void {
                if (wgt) {
                    const onSizeChildren: zk.Widget[] = [],
                        fn = function (child: zk.Widget): void {
                            const act = _beforeAction(child, 'show') as never,
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.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 zk has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    zk(evt: JQuery.TriggeredEvent, wgt?: zk.Widget): zk.Event {
        var type = evt.type,
            target = zk.Widget.$(evt) ?? wgt,
            data;

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 _do has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    _do(): void {
        if (!zAu.processing()) {
            var doNow = !zAu.doneTime;
            if (!doNow) {
                var doneTime = zAu.doneTime || 0,
Severity: Minor
Found in zk/src/main/resources/web/js/zk/cpsp/serverpush.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 up has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function up(valStr: string, ri: number): string {
    var k = 1, val = '';
    for (var j = ri; k && --j >= 0;) {
        var ch = valStr.charAt(j);
        if (k == 1) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/fmt/numfmt.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 constructor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(value: number | string) {
        super();
    //Note: it shall work like parseInt:
    //1) consider '.' rather than zkDecimal
    //2) ignore unrecognized characters
Severity: Minor
Found in zk/src/main/resources/web/js/zk/math.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 _mousedown has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    _mousedown(devt: JQuery.TriggeredEvent): void {
        var node = this.node,
            evt = jq.Event.zk(devt),
            target = devt.target as HTMLElement;
        if (_actTmout || _dragging.has(node) || evt.which != 1
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.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 today has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        static today(fmt: boolean | string, tz?: string): DateImpl {
            var d = window.Dates.newInstance().tz(tz), hr = 0, min = 0, sec = 0, msec = 0;
            if (typeof fmt == 'string') {
                var fmt0 = fmt.toLowerCase();
                if (fmt0.includes('h') || fmt0.includes('k')) hr = d.getHours();
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 stringToInts has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        static stringToInts(text: string | undefined, defaultValue: number): number[] | undefined {
            if (text == null)
                return undefined;

            var list: number[] = [];
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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    create(context) {
        return {
            CallExpression(node) {
                const { parent, callee } = node;

Severity: Minor
Found in eslint-plugin-zk/src/rules/noTopLevelScopingIIFE.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

Method write has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void write(int b) throws IOException {
        if (_type != 0) {
            if (!"UTF-8".equals(_charset) || (b & 0xc0) == 0x80) {
                _bs[_cnt ++] = (byte)b;
                if (_cnt == _type) { //complete
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/WriterOutputStream.java - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language