Showing 4,841 of 7,782 total issues

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

Function getForSourceFile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function getForSourceFile(sourceFilePath: string): TSDocConfigFile {
    const sourceFileFolder = path.dirname(path.resolve(sourceFilePath));
    // First, determine the file to be loaded. If not found, the configFilePath will be an empty string.
    const configFilePath = TSDocConfigFile.findConfigPathForFolder(sourceFileFolder);
    // If configFilePath is an empty string, then we'll use the folder of sourceFilePath as our cache key.
Severity: Minor
Found in eslint-plugin-zk/src/rules/tsdocConfigCache.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 toStringBuffer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static final StringBuffer
    toStringBuffer(StringBuffer sb, Map<? super String, ? super String> map, char quote, char separator, char pairSeparator) {
        if (separator == (char)0)
            throw new IllegalArgumentException("Separator cannot be 0");
        if (map.isEmpty())
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/Maps.java - About 1 hr to fix

    Method resolveClass has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public java.lang.Class<?> resolveClass(String name) {
            if (name == null || name.contains(".")) {
                return null;
            }
    
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/ImportHandler.java - About 1 hr to fix

      Method jjMoveStringLiteralDfa2_1 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      private int jjMoveStringLiteralDfa2_1(long old0, long active0)
      {
         if (((active0 &= old0)) == 0L)
            return jjStartNfa_1(0, old0);
         try { curChar = input_stream.readChar(); }

        Method jjMoveStringLiteralDfa2_2 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        private int jjMoveStringLiteralDfa2_2(long old0, long active0)
        {
           if (((active0 &= old0)) == 0L)
              return jjStartNfa_2(0, old0);
           try { curChar = input_stream.readChar(); }

          Method doSomething has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Listen("onCtrlKey = window#w")
              public void doSomething(KeyEvent evt) {
                  String msg = "";
                  int keyCode = evt.getKeyCode();
                  boolean ctrl = evt.isCtrlKey(),

            Method init has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Init
                public void init() {
                    countries = Arrays.asList(new B70_ZK_2024_ViewModel[] {
                            //
                            new B70_ZK_2024_ViewModel("AT", "\u00D6sterreich"), //

              Method updateCol has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void updateCol(Event event, int col) {
                      DefaultTreeNode<TestObject> rootNode;
                      String id = (String) event.getData();
                      if (id.startsWith("Row A") || id.startsWith("SubRow A")) {
                          rootNode = (DefaultTreeNode<TestObject>) mymodelA.getRoot();
                Severity
                Category
                Status
                Source
                Language