Showing 7,775 of 7,775 total issues

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

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

export function afterMount(fn?: () => void, delay?: number): boolean { //part of zk
    if (fn) {
        if (!jq.isReady)
            jq(function () {
                zk.afterMount(fn);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/mount.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 newInstance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        newInstance(param?: number | DateImpl | Parameters<DateConstructor['UTC']>, tz?: string): DateImpl {
            let m: Moment;
            if (tz)
                tz = parseTzId(tz);
            else
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dateImpl.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 fireSized has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        static fireSized(wgt: zk.Widget, bfsz?: number): void {
            // ignore delayed rerendering case, like Bug ZK-2281
            if (wgt.desktop) {
                if (zk.clientinfo) { // Fix ZK-5017, not to use setTimeout here
                    zk.afterAuResponse(() => this.fireSized(wgt, bfsz));
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 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 destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    destroy(): void {
        var cave = this.cave;
        jq(cave)
            //unbind scroll event for input tab scroll
            .off('scroll', this.proxy(this._fixScroll))
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 _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 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 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 _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 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 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 defaultAnimaOpts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        defaultAnimaOpts(wgt: zk.Widget, opts: zk.SlideOptions, prop: string[], visible?: boolean): this {
            var self = this;
            jq.timers.push(function () {
                if (!visible)
                    zWatch.fireDown('onHide', wgt);
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 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

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    @Command
    public void postGlobalCmdOuterMyQueue() {
        Map<String, Object> args = new HashMap<>();
        args.put("arg1", 2);
        args.put("arg2", "outerMyQueue");
zktest/src/main/java/org/zkoss/zktest/bind/databinding/binder/BinderGlobalCommandModel.java on lines 64..70
zktest/src/main/java/org/zkoss/zktest/bind/databinding/binder/OuterBinderGlobalCommandModel.java on lines 44..50
zktest/src/main/java/org/zkoss/zktest/bind/databinding/binder/OuterBinderGlobalCommandModel.java on lines 60..66

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    static {
        _properties.put("value", new IntegerPropertyAccess() {
            public void setValue(Component cmp, Integer value) {
                ((Intbox) cmp).setValue(value);
            }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Intbox.java and 3 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Timebox.java on lines 353..363
zul/src/main/java/org/zkoss/zul/impl/FormatInputElement.java on lines 74..84
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 77..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if (control != null) {
                Clients.response(new AuInvoke(this, "$doService", new Object[] { cmd, new JSONAware() {
                    public String toJSONString() {
                        return String.valueOf(control.isSelectAll());
                    }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3931..3937

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    static {
        _properties.put("buttonVisible", new BooleanPropertyAccess() {
            public void setValue(Component cmp, Boolean value) {
                ((Timebox) cmp).setButtonVisible(value);
            }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Timebox.java and 3 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Intbox.java on lines 96..106
zul/src/main/java/org/zkoss/zul/impl/FormatInputElement.java on lines 74..84
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 77..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    @Command
    public void postGlobalCmdInner() {
        Map<String, Object> args = new HashMap<>();
        args.put("arg1", 3);
        args.put("arg2", "inner");
zktest/src/main/java/org/zkoss/zktest/bind/databinding/binder/BinderGlobalCommandModel.java on lines 40..46
zktest/src/main/java/org/zkoss/zktest/bind/databinding/binder/BinderGlobalCommandModel.java on lines 56..62
zktest/src/main/java/org/zkoss/zktest/bind/databinding/binder/OuterBinderGlobalCommandModel.java on lines 36..42

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language