Showing 4,841 of 7,782 total issues

Function _removeWrapper has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        _removeWrapper(element: JQuery): JQuery {
            var active = document.activeElement,
                wrapped = element.children('.ui-effects-wrapper');
            if (wrapped.length) {
                var children = wrapped.contents();
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

Function vparentNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    vparentNode(real?: boolean): HTMLElement | undefined {
        var el = this.jq[0];
        if (el) {
            let v = el['z_vp'] as undefined | string; //might be empty
            if (v) return jq('#' + v)[0];
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 vflexHeight has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    vflexHeight(): number {
        var el = this.jq[0],
            parent = el.parentElement,
            hgh = parent ? zk(parent).clientHeightDoubleValue() : 0,
            zkp: undefined | zk.JQZK;
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 _redoCSS0 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _redoCSS0(): void {
    if (_rdcss.length) {
        for (var el: HTMLElement | undefined; el = _rdcss.pop();)
            try {
                zjq._fixCSS(el);
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 getAnimationSpeed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        getAnimationSpeed(defaultValue?: 'slow' | 'fast' | number): 'slow' | 'fast' | number {
            var animationSpeed = jq(this.$().$n()).closest('[data-animationspeed]').data('animationspeed') as string | number,
                jqSpeed = jq.fx.speeds;

            if (typeof animationSpeed === 'string') {
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

Function endeffect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function endeffect(dg: zk.Draggable): void {
    var ctrl = dg.control as unknown as zul.WScroll;
    if (dg._timer) {
        clearTimeout(dg._timer);
    }
Severity: Minor
Found in zul/src/main/resources/web/js/zul/WScroll.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 renType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    renType(url: string, type: string): string {
        var j = url.lastIndexOf(';'),
            suffix;
        if (j >= 0) {
            suffix = url.substring(j);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/xml/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 getParentFunctionIdentifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getParentFunctionIdentifier: function (node: TSESTree.Node): TSESTree.Node | null {

        // We'll want to get the closest function.
        let func: TSESTree.Node | undefined = node;

Severity: Minor
Found in eslint-plugin-zk/src/tree.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 destroyProgressbox has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        static destroyProgressbox(id: string, opts?: Partial<ProgressboxOptions>): void {
            if (opts?.busy && --zk.busy < 0)
                zk.busy = 0;
            var $n = jq(id, zk), n: HTMLElement & {z_mask?: zk.eff.Effect} | zk.eff.Effect;
            if ($n.length) {
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 _mousewheelY has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    _mousewheelY(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
        var opts = this.opts,
            step = opts.step * opts.wheelAmountStep,
            pos = this._pos![1],
            barPos: number;
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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    create(context) {
        const sourceCode = context.getSourceCode();
        return {
            CallExpression(node) {
                const { callee } = node;
Severity: Minor
Found in eslint-plugin-zk/src/rules/preferNativeInstanceof.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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    create(context) {
        return {
            PropertyDefinition(node) {

                // for zk.$void case
Severity: Minor
Found in eslint-plugin-zk/src/rules/noPropertyFunction.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

Avoid too many return statements within this method.
Open

                return negative ? (sec1 - sec2) : (sec2 - sec1);
Severity: Major
Found in zcommon/src/main/java/org/zkoss/util/Dates.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                if (v1[j] > v2[j]) return 1;
    Severity: Major
    Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  if (v1[j] < v2[j]) return -1;
      Severity: Major
      Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return rtn;
        Severity: Major
        Found in zcommon/src/main/java/org/zkoss/util/Locales.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              if (v1[j] < 0) return -1;
          Severity: Major
          Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return negative ? 
                                 (date1.getTime() - date2.getTime()): 
                                 (date2.getTime() - date1.getTime());
            Severity: Major
            Found in zcommon/src/main/java/org/zkoss/util/Dates.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return 0;
              Severity: Major
              Found in zcommon/src/main/java/org/zkoss/util/Utils.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return negative ? -days : days;
                Severity: Major
                Found in zcommon/src/main/java/org/zkoss/util/Dates.java - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language