zul/src/main/resources/web/js/zul/WScroll.ts

Summary

Maintainability
F
1 mo
Test Coverage

Function _mouseDown has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
Open

    _mouseDown(evt: zk.Event): void {
        var cls = evt.target.className,
            index = cls.lastIndexOf('-'),
            key = cls.substring(index + 1),
            $drag = jq(this.edrag);
Severity: Minor
Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 2 days 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

File WScroll.ts has 600 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* WScroll.ts

    Purpose:

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

    Function starteffect has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

    function starteffect(dg: zk.Draggable): void {
        var ctrl = dg.control as unknown as zul.WScroll,
            opts = ctrl.opts;
    
        dg._steps = opts.startStep;
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function _mouseDown has 141 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _mouseDown(evt: zk.Event): void {
            var cls = evt.target.className,
                index = cls.lastIndexOf('-'),
                key = cls.substring(index + 1),
                $drag = jq(this.edrag);
    Severity: Major
    Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 5 hrs to fix

      Function syncSize has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          syncSize(opts?: Record<string, unknown>): void {
              if (opts) {
                  this.opts = zk.copy(this.opts, opts);
              }
              this.edrag.style.display = '';
      Severity: Minor
      Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 4 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 starteffect has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function starteffect(dg: zk.Draggable): void {
          var ctrl = dg.control as unknown as zul.WScroll,
              opts = ctrl.opts;
      
          dg._steps = opts.startStep;
      Severity: Major
      Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 3 hrs to fix

        Function syncSize has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            syncSize(opts?: Record<string, unknown>): void {
                if (opts) {
                    this.opts = zk.copy(this.opts, opts);
                }
                this.edrag.style.display = '';
        Severity: Major
        Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 3 hrs to fix

          Function _mousewheelX has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              _mousewheelX(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                  if (deltaX) {
                      evt.stop();
                      var opts = this.opts,
                          steps = opts.startStep,
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/WScroll.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 snap has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          function snap(dg: zk.Draggable, pointer: zk.Offset): zk.Offset {
              var x = pointer[0],
                  y = pointer[1];
              if (dg._isVer) {
                  var move = y;
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/WScroll.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 _mousewheelY has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              _mousewheelY(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                  if (deltaY) {
                      evt.stop();
                      var opts = this.opts,
                          steps = opts.startStep,
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/WScroll.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 running has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  running = function (orient: 'top' | 'left'): void {
                      var norient = zk.parseFloat(dg.node!.style[orient]),
                          diff = norient - zk.parseFloat(dg._epos!.style[orient]);
                      if (lastP == norient) {
                          lastS.push(dg._lastSteps);
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 hr to fix

            Function _mousewheelY has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _mousewheelY(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                    if (deltaY) {
                        evt.stop();
                        var opts = this.opts,
                            steps = opts.startStep,
            Severity: Minor
            Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 hr to fix

              Function _mousewheelX has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _mousewheelX(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                      if (deltaX) {
                          evt.stop();
                          var opts = this.opts,
                              steps = opts.startStep,
              Severity: Minor
              Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 hr to fix

                Function snap has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function snap(dg: zk.Draggable, pointer: zk.Offset): zk.Offset {
                    var x = pointer[0],
                        y = pointer[1];
                    if (dg._isVer) {
                        var move = y;
                Severity: Minor
                Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 hr to fix

                  Function easing has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function easing(x: number, t: number, b: number, c: number, d: number): number {
                  Severity: Minor
                  Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 35 mins to fix

                    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 _mouseOver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _mouseOver(evt: zk.Event): void {
                            var cls = evt.target.className,
                                index = cls.lastIndexOf('-'),
                                key = cls.substring(index + 1),
                                $drag = jq(this.edrag);
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/WScroll.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

                        _mousewheelY(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                            if (deltaY) {
                                evt.stop();
                                var opts = this.opts,
                                    steps = opts.startStep,
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 days to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 679..712

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

                    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

                        _mousewheelX(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                            if (deltaX) {
                                evt.stop();
                                var opts = this.opts,
                                    steps = opts.startStep,
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 days to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 643..676

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

                    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

                            } else {
                                const opts = this.opts,
                                    left = opts.startPosition,
                                    start = opts.startStep,
                                    view = opts.viewport,
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 days to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 335..371

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

                    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 (this._isVer) {
                                const opts = this.opts,
                                    top = opts.startPosition,
                                    start = opts.startStep,
                                    view = opts.viewport,
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 days to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 371..408

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

                    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 (this._isVer) {
                                            var end;
                                            if (zk(this.eend).isVisible()) {
                                                end = this.eend.offsetTop;
                                            } else {
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 days to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 569..604

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

                    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 (this._isVer) {
                                            var end;
                                            if (zk(this.eend).isVisible()) {
                                                end = this.eend.offsetTop;
                                            } else {
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 days to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 524..559

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

                    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

                                        } else {
                                            let moving: number;
                                            if (zk(this.eend).isVisible()) {
                                                moving = this.eend.offsetLeft - (this.edrag.offsetWidth - this._gap);
                                            } else {
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 1 day to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 612..623

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

                    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 (this._isVer) {
                                            let moving: number;
                                            if (zk(this.eend).isVisible()) {
                                                moving = this.eend.offsetTop - (this.edrag.offsetHeight - this._gap);
                                            } else {
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 1 day to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 623..634

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

                    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

                        } else {
                            dg._isVer = false;
                            dg._start = opts.startPosition;
                            if (zk(ctrl.eend).isVisible()) {
                                dg._end = ctrl.eend.offsetLeft + Math.ceil(dg.handle!.offsetWidth / 2);
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 1 day to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 62..73

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

                    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 (ctrl._isVer) {
                            dg._isVer = true;
                            dg._start = opts.startPosition;
                            if (zk(ctrl.eend).isVisible()) {
                                dg._end = ctrl.eend.offsetTop + Math.ceil(dg.handle!.offsetHeight / 2);
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 1 day to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 73..84

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

                    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

                        } else {
                            var move = x;
                    
                            if (move - dg._start < 0) {
                                move = pointer[0] = dg._start;
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 4 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 19..34

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

                    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 (dg._isVer) {
                            var move = y;
                    
                            if (move - dg._start < 0) {
                                move = pointer[1] = dg._start;
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 4 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 34..49

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

                    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

                                        } else {
                                            const moving = opts.startPosition + 'px';
                                            this.epos.style.left = moving;
                                        $drag.animate({left: moving}, 500);
                                            if (typeof this.opts.onScrollX == 'function')
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 3 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 504..510

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

                    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 (this._isVer) {
                                            const moving = opts.startPosition + 'px';
                                            this.epos.style.top = moving;
                                        $drag.animate({top: moving}, 500);
                                            if (typeof this.opts.onScrollY == 'function')
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 3 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 510..516

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

                    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

                            $drag.children('div')
                                .on('mouseover', this._mouseOver.bind(this))
                                .on('mouseout', this._mouseOut.bind(this))
                                .on('mouseup', this._mouseUp.bind(this))
                                .on('mousedown', this._mouseDown.bind(this));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 3 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 440..444

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

                    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

                            $drag.children('div')
                                .off('mouseover', this._mouseOver.bind(this))
                                .off('mouseout', this._mouseOut.bind(this))
                                .off('mouseup', this._mouseUp.bind(this))
                                .off('mousedown', this._mouseDown.bind(this));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 3 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 422..426

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

                    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

                        } else {
                            move = zk.parseInt(dg._epos!.style.left);
                            end = dg._end;
                            if (move > end)
                                move = end;
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 157..164

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

                    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 (dg._isVer) {
                            move = zk.parseInt(dg._epos!.style.top);
                            end = dg._end;
                            if (move > end)
                                move = end;
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 164..171

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

                    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

                            var cls = evt.target.className,
                                index = cls.lastIndexOf('-'),
                                key = cls.substring(index + 1),
                                $drag = jq(this.edrag);
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 1 hr to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 490..493

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

                    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

                            var cls = evt.target.className,
                                index = cls.lastIndexOf('-'),
                                key = cls.substring(index + 1),
                                $drag = jq(this.edrag);
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts and 1 other location - About 1 hr to fix
                    zul/src/main/resources/web/js/zul/WScroll.ts on lines 450..453

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

                    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