zk/src/main/resources/web/js/zk/drag.ts

Summary

Maintainability
F
6 days
Test Coverage

File drag.ts has 636 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* drag.ts

    Purpose:

    Description:
Severity: Major
Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 day to fix

    Function _finishDrag has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        _finishDrag(evt: zk.Event, success: boolean): void {
            this.dragging = false;
            if (this.stackup) {
                jq(this.stackup).remove();
                delete this.stackup;
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/drag.ts - About 3 hrs 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 _draw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        _draw(point: zk.Offset, evt?: zk.Event): void {
            var node = this.node!,
                $node = zk(node),
                pos = $node.cmOffset(),
                opts = this.opts;
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/drag.ts - About 3 hrs 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 _startDrag has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        _startDrag(evt: zk.Event): void {
            zWatch.fire('onStartDrag', this, evt as unknown as zk.FireOptions);
    
            //disable selection
            zk(document.body).disableSelection(); // Bug #1820433
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/drag.ts - About 3 hrs 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 _finishDrag has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _finishDrag(evt: zk.Event, success: boolean): void {
            this.dragging = false;
            if (this.stackup) {
                jq(this.stackup).remove();
                delete this.stackup;
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 hrs to fix

      Function _startDrag has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _startDrag(evt: zk.Event): void {
              zWatch.fire('onStartDrag', this, evt as unknown as zk.FireOptions);
      
              //disable selection
              zk(document.body).disableSelection(); // Bug #1820433
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 hrs to fix

        Function _updateDrag has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            _updateDrag(pt: zk.Offset, evt: zk.Event): void {
                if (!this.dragging) {
                    let v = this.opts.initSensitivity;
                    if (v && pt[0] <= _initPt[0] + v && pt[0] >= _initPt[0] - v
                    && pt[1] <= _initPt[1] + v && pt[1] >= _initPt[1] - v)
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 hrs 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 _scroll has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            _scroll(): void {
                var current = new Date(),
                    delta = current.valueOf() - this.lastScrolled!.valueOf();
                this.lastScrolled = current;
                if (this.opts.scroll == window) {
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
        Open

            constructor(control: zk.Object & {node?: HTMLElement} | undefined, node: HTMLElement | undefined, opts: DraggableOptions) {
                super();
                if (!_stackup) {
                //IE: if we don't insert stackup at beginning, dragging is slow
                    _stackup = jq.newStackup(undefined, 'z_ddstkup');
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 hrs 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 _draw has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _draw(point: zk.Offset, evt?: zk.Event): void {
                var node = this.node!,
                    $node = zk(node),
                    pos = $node.cmOffset(),
                    opts = this.opts;
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/drag.ts - About 2 hrs to fix

          Function constructor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor(control: zk.Object & {node?: HTMLElement} | undefined, node: HTMLElement | undefined, opts: DraggableOptions) {
                  super();
                  if (!_stackup) {
                  //IE: if we don't insert stackup at beginning, dragging is slow
                      _stackup = jq.newStackup(undefined, 'z_ddstkup');
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 hr to fix

            Function _updateDrag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _updateDrag(pt: zk.Offset, evt: zk.Event): void {
                    if (!this.dragging) {
                        let v = this.opts.initSensitivity;
                        if (v && pt[0] <= _initPt[0] + v && pt[0] >= _initPt[0] - v
                        && pt[1] <= _initPt[1] + v && pt[1] >= _initPt[1] - v)
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 hr to fix

              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 _scroll has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _scroll(): void {
                      var current = new Date(),
                          delta = current.valueOf() - this.lastScrolled!.valueOf();
                      this.lastScrolled = current;
                      if (this.opts.scroll == window) {
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                        if (_actTmout || _dragging.has(node) || evt.which != 1
                            || (zk.webkit && jq.nodeName(target, 'select'))
                            || (zk(target).isInput() && this.control != zk.Widget.$(target)))
                            return;
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((v = node?.clientWidth) && ofs[0] > (v + zkn.sumStyles('l', jqBorders)) && ofs[0] < (node.offsetWidth - zkn.sumStyles('r', jqBorders))
                          || (v = node?.clientHeight) && ofs[1] > (v + zkn.sumStyles('t', jqBorders)) && ofs[1] < (node.offsetHeight - zkn.sumStyles('b', jqBorders))) //scrollbar
                              return;
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/drag.ts - About 40 mins to fix

                    Function _getWndScroll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _getWndScroll(w: Window): zk.Dimension {
                            var T: number | undefined, L: number | undefined, W: number | undefined, H: number | undefined,
                                doc = w.document,
                                de = doc.documentElement;
                            if (de && de.scrollTop) {
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts - About 25 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 _docmouseup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function _docmouseup(devt: JQuery.TriggeredEvent): void {
                            if (_actTmout) {
                                clearTimeout(_actTmout);
                                _actTmout = undefined;
                            }
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts - About 25 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 2 locations. Consider refactoring.
                    Open

                            || (v = node?.clientHeight) && ofs[1] > (v + zkn.sumStyles('t', jqBorders)) && ofs[1] < (node.offsetHeight - zkn.sumStyles('b', jqBorders))) //scrollbar
                    Severity: Major
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 1 hr to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 838..838

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

                    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 2 locations. Consider refactoring.
                    Open

                            if ((v = node?.clientWidth) && ofs[0] > (v + zkn.sumStyles('l', jqBorders)) && ofs[0] < (node.offsetWidth - zkn.sumStyles('r', jqBorders))
                    Severity: Major
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 1 hr to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 839..839

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

                    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 2 locations. Consider refactoring.
                    Open

                                if (pt[0] > (p[2]! - v)) speed[0] = pt[0] - (p[2]! - v);
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 50 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 724..724

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

                    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 2 locations. Consider refactoring.
                    Open

                                if (pt[1] > (p[3]! - v)) speed[1] = pt[1] - (p[3]! - v);
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 50 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 723..723

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

                    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 2 locations. Consider refactoring.
                    Open

                        declare z_box?: {
                            top: number;
                            left: number;
                            height: number;
                            width: number;
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 35 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 248..255

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

                    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 2 locations. Consider refactoring.
                    Open

                                if (pt[1] < (p[1] + v)) speed[1] = pt[1] - (p[1] + v);
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 35 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 721..721

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

                    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 2 locations. Consider refactoring.
                    Open

                        declare _rootoffs?: {
                            maxs: number;
                            left: number;
                            right: number;
                            top: number;
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 35 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 235..242

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

                    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 2 locations. Consider refactoring.
                    Open

                                if (pt[0] < (p[0] + v)) speed[0] = pt[0] - (p[0] + v);
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 35 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 722..722

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

                    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 2 locations. Consider refactoring.
                    Open

                                if ((!opts.constraint) || (opts.constraint == 'vertical'))
                                    style.top = jq.px(p[1]);
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 30 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 921..922

                    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 2 locations. Consider refactoring.
                    Open

                                if ((!opts.constraint) || (opts.constraint == 'horizontal'))
                                    style.left = jq.px(p[0]);
                    Severity: Minor
                    Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 30 mins to fix
                    zk/src/main/resources/web/js/zk/drag.ts on lines 923..924

                    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

                    There are no issues that match your filters.

                    Category
                    Status