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

Summary

Maintainability
F
1 wk
Test Coverage

File Scrollbar.ts has 709 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Scrollbar.ts

    Purpose:

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

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

        _mouseDown(evt: JQuery.MouseDownEvent<never, never, HTMLElement>): void {
            if (this._pressTimer) {
                clearInterval(this._pressTimer);
                this._pressTimer = undefined;
            }
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/Scrollbar.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 syncSize has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

        syncSize(showScrollbar?: boolean): void {
            this._checkBarRequired();
    
            var wgt = this.widget,
                frozen = wgt.frozen, froenScrollWidth = 0,
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 5 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 syncSize has 116 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        syncSize(showScrollbar?: boolean): void {
            this._checkBarRequired();
    
            var wgt = this.widget,
                frozen = wgt.frozen, froenScrollWidth = 0,
    Severity: Major
    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 4 hrs to fix

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

          _checkBarRequired(): void {
              var cave = this.cave,
                  scroller = this.scroller,
                  frozen = this.widget.frozen;
              //check if horizontal scroll-bar required
      Severity: Minor
      Found in zul/src/main/resources/web/js/zul/Scrollbar.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

      Scrollbar has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @zk.WrapClass('zul.Scrollbar')
      export class Scrollbar extends zk.Object {
          /** The container object for this scrolling that user can scroll the whole content
           * @type DOMElement
           */
      Severity: Minor
      Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 3 hrs to fix

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

            _mouseDown(evt: JQuery.MouseDownEvent<never, never, HTMLElement>): void {
                if (this._pressTimer) {
                    clearInterval(this._pressTimer);
                    this._pressTimer = undefined;
                }
        Severity: Major
        Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 3 hrs to fix

          Function _syncPosition has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              _syncPosition(orient: string, pos: number): void {
                  if (!this._pos)
                      return;
          
                  var isH = orient == 'hor',
          Severity: Minor
          Found in zul/src/main/resources/web/js/zul/Scrollbar.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

          Consider simplifying this complex logical expression.
          Open

                  if (((domRight >= viewLeft && domRight <= viewRight)
                          || (domLeft >= viewLeft && domLeft <= viewRight)
                          || (domLeft <= viewLeft && domRight >= viewRight))
                      && ((domTop >= viewTop && domTop <= viewBottom)
                          || (domBottom >= viewTop && domBottom <= viewBottom)
          Severity: Critical
          Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 2 hrs to fix

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

                scrollToElement(dom: HTMLElement): void {
                    var cave = this.cave,
                        domTop = jq(dom).offset()!.top,
                        domBottom = domTop + dom.offsetHeight,
                        domLeft = jq(dom).offset()!.left,
            Severity: Minor
            Found in zul/src/main/resources/web/js/zul/Scrollbar.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 scrollToElement has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                scrollToElement(dom: HTMLElement): void {
                    var cave = this.cave,
                        domTop = jq(dom).offset()!.top,
                        domBottom = domTop + dom.offsetHeight,
                        domLeft = jq(dom).offset()!.left,
            Severity: Minor
            Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 1 hr to fix

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

                  _checkBarRequired(): void {
                      var cave = this.cave,
                          scroller = this.scroller,
                          frozen = this.widget.frozen;
                      //check if horizontal scroll-bar required
              Severity: Minor
              Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 1 hr to fix

                Function _syncPosition has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _syncPosition(orient: string, pos: number): void {
                        if (!this._pos)
                            return;
                
                        var isH = orient == 'hor',
                Severity: Minor
                Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((this.needV && domBottom <= viewBottom && domTop >= viewTop)
                              || (this.needH && domRight <= viewRight && domLeft >= viewLeft))
                              return true;
                          else
                              return false;
                  Severity: Major
                  Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 40 mins to fix

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

                    function _showScrollbar(wgt: Scrollbar, orient: string, opacity: number): void {
                        var isHide = opacity == 0,
                            bar = wgt.$n(orient),
                            embed = wgt.$n(orient + '-embed'),
                            style: CSSStyleDeclaration;
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.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 _dragMove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _dragMove(evt: JQuery.DragEvent<never, {orient: string; point: number; pos: number}>): void {
                            var data = evt.data,
                                orient = data.orient,
                                point = data.point,
                                pos = data.pos,
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.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 _mousewheelX has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _mousewheelX(evt: zk.Event, delta: number, deltaX: number, deltaY: number): void {
                            var opts = this.opts,
                                step = opts.step * opts.wheelAmountStep,
                                pos = this._pos![0];
                    
                    
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.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

                            var self = this,
                                cave = self.cave,
                                isH = orient == 'hor',
                                bar = self.$n(orient),
                                ind = self.$n(orient + '-indicator'),
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 4 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 526..533

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

                    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

                            var self = this,
                                cave = self.cave,
                                isH = orient == 'hor',
                                bar = self.$n(orient),
                                ind = self.$n(orient + '-indicator'),
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 4 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 496..503

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

                    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.needH) {
                                if (hbar) {
                                    this._unbindMouseEvent('hor');
                                    this._syncPosition('hor', 0);
                                    jq(hbar).remove();
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 3 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 475..491

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

                    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.needV) {
                                if (vbar) {
                                    this._unbindMouseEvent('ver');
                                    this._syncPosition('ver', 0);
                                    jq(vbar).remove();
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 3 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 455..471

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

                    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 (isH && !zk.opera) {//IE and Opera does not support mouse wheel
                                jq(cave).mousewheel(self._mousewheelX.bind(self) as never);
                            } else {
                                jq(cave).mousewheel(self._mousewheelY.bind(self) as never);
                            }
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 535..539

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

                    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 (isH && !zk.opera) {//IE and Opera does not support mouse wheel
                                jq(cave).unmousewheel(self._mousewheelX.bind(self) as never);
                            } else {
                                jq(cave).unmousewheel(self._mousewheelY.bind(self) as never);
                            }
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 505..509

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

                    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.needV) {
                                //set and check if exceed scrolling limit
                                posY = _setScrollPos(posY, 0, this.vLimit);
                                barPos = posY / this.vRatio;
                                //sync scroll position
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 397..405

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

                    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.needH) {
                                //set and check if exceed scrolling limit
                                posX = _setScrollPos(posX, 0, this.hLimit);
                                barPos = posX / this.hRatio;
                                //sync scroll position
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 388..396

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

                    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

                            jq(cave)
                                //bind scroll event for input tab key scroll
                                .on('scroll', this.proxy(this._fixScroll))
                                //bind mouse enter / mouse leave
                                .on('mouseenter', this.proxy(this._mouseEnter))
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 160..165

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

                    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

                            jq(cave)
                                //unbind scroll event for input tab scroll
                                .off('scroll', this.proxy(this._fixScroll))
                                //unbind mouse enter / mouse leave
                                .off('mouseenter', this.proxy(this._mouseEnter))
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 150..155

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

                    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.needH) {
                                x = _setScrollPos(x, 0, this.hLimit);
                                var barPos = x / this.hRatio;
                                this._syncPosition('hor', x);
                                this._syncBarPosition('hor', barPos);
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 341..347

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

                    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.needV) {
                                y = _setScrollPos(y, 0, this.vLimit);
                                var barPos = y / this.vRatio;
                                this._syncPosition('ver', y);
                                this._syncBarPosition('ver', barPos);
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 334..340

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

                    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 (!isH && this.needH) {
                                    this.$n('hor').style.bottom = -pos + 'px';
                                    if (embed)
                                        this.$n('hor-embed').style.bottom = -pos + 'px';
                                }
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 1 hr to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 837..841

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

                    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 (isH && this.needV) {
                                    this.$n('ver').style.right = -pos + 'px';
                                    if (embed)
                                        this.$n('ver-embed').style.right = -pos + 'px';
                                }
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 1 hr to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 842..846

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

                    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

                                var indicator = this.$n('ver-indicator'),
                                    whgh = wrapper.offsetHeight,
                                    ihgh = Math.round(whgh * hgh / shgh),
                                    ihgh = ihgh > 15 ? ihgh : 15;
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 1 hr to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 247..250

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

                    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

                                var indicator = this.$n('hor-indicator'),
                                    wwdh = wrapper.offsetWidth,
                                    iwdh = Math.round(wwdh * wdh / swdh),
                                    iwdh = iwdh > 15 ? iwdh : 15;
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 1 hr to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 302..305

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

                    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 (limit <= 0) {
                                    this.vBarLimit = 0;
                                    indicator.style.display = 'none';
                                } else {
                                    this.vBarLimit = limit;
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 55 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 259..264

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

                    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 (limit <= 0) {
                                    this.hBarLimit = 0;
                                    indicator.style.display = 'none';
                                } else {
                                    this.hBarLimit = limit;
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 55 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 314..319

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

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

                            jq(arrow2)
                                .off('mousedown', self.proxy(self._mouseDown))
                                .off('mouseup', self.proxy(self._mouseUp));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 513..515
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 516..518
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 519..521
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 543..545
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 546..548
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 608..610

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

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

                            jq(arrow1)
                                .on('mousedown', self.proxy(self._mouseDown))
                                .on('mouseup', self.proxy(self._mouseUp));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 513..515
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 519..521
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 543..545
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 546..548
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 549..551
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 608..610

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

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

                            jq(rail)
                                .off('mousedown', self.proxy(self._mouseDown))
                                .off('mouseup', self.proxy(self._mouseUp));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 513..515
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 516..518
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 519..521
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 546..548
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 549..551
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 608..610

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

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

                            jq(arrow2)
                                .on('mousedown', self.proxy(self._mouseDown))
                                .on('mouseup', self.proxy(self._mouseUp));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 513..515
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 516..518
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 543..545
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 546..548
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 549..551
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 608..610

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

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

                            jq(document)
                                .off('mousemove', self.proxy(self._dragMove))
                                .off('mouseup', self.proxy(self._dragEnd));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 513..515
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 516..518
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 519..521
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 543..545
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 546..548
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 549..551

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

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

                            jq(rail)
                                .on('mousedown', self.proxy(self._mouseDown))
                                .on('mouseup', self.proxy(self._mouseUp));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 516..518
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 519..521
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 543..545
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 546..548
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 549..551
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 608..610

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

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

                            jq(arrow1)
                                .off('mousedown', self.proxy(self._mouseDown))
                                .off('mouseup', self.proxy(self._mouseUp));
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 6 other locations - About 40 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 513..515
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 516..518
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 519..521
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 543..545
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 549..551
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 608..610

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

                    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

                                && ((domTop >= viewTop && domTop <= viewBottom)
                                    || (domBottom >= viewTop && domBottom <= viewBottom)
                                    || (domTop <= viewTop && domBottom >= viewBottom))) {
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 30 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 367..369

                    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 (((domRight >= viewLeft && domRight <= viewRight)
                                    || (domLeft >= viewLeft && domLeft <= viewRight)
                                    || (domLeft <= viewLeft && domRight >= viewRight))
                    Severity: Minor
                    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 30 mins to fix
                    zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 370..372

                    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