Showing 7,775 of 7,775 total issues

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

    public void setSelectedText(int start, int end, String newtxt, boolean isHighLight) {
        if (start <= end) {
            final String txt = getText();
            final int len = txt.length();
            if (start < 0)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.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 onClose has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public void onClose(Event evt) {
        try {
            if (evt.getData() == null)
                _result.clear();
            else {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/FileuploadDlg.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 setThreadLocals has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private void setThreadLocals() {
        if (_threadLocals != null) {
            try {
                Class cls = Classes

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

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

    public static final String getContentType(String path) {
        if (path == null)
            return null;

        int j = path.lastIndexOf('.');
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/Interpreter.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 _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 _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 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 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 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 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 _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 _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 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 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 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 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

Severity
Category
Status
Source
Language