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

Summary

Maintainability
F
1 wk
Test Coverage

File anima.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* anima.ts

    Purpose:

    Description:
Severity: Minor
Found in zk/src/main/resources/web/js/zk/anima.ts - About 3 hrs to fix

    Function _createWrapper has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _createWrapper(element: JQuery): JQuery {
                // ZK-5354: Update animation implementation to avoid iframe reloading
                if (element.find('iframe').length) {
                    return element;
                }
    Severity: Minor
    Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

      Function slideDown has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              slideDown(wgt: zk.Widget, opts?: zk.SlideOptions): this {
                  if (_checkAnimated(this, wgt, opts, 'slideDown'))
                      return this;
      
                  var anchor = opts ? opts.anchor || 't' : 't',
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

        Function slideUp has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                slideUp(wgt: zk.Widget, opts?: zk.SlideOptions): this {
                    if (_checkAnimated(this, wgt, opts, 'slideUp'))
                        return this;
        
                    var anchor = opts ? opts.anchor || 't' : 't',
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

          Function slideIn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  slideIn(wgt: zk.Widget, opts?: zk.SlideOptions): this {
                      if (_checkAnimated(this, wgt, opts, 'slideIn'))
                          return this;
          
                      var anchor = opts ? opts.anchor || 't' : 't',
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

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

                    slideOut(wgt: zk.Widget, opts?: zk.SlideOptions): this {
                        if (_checkAnimated(this, wgt, opts, 'slideOut'))
                            return this;
            
                        var anchor = opts ? opts.anchor || 't' : 't',
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/anima.ts - About 1 hr to fix

              Function _doAnique has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function _doAnique(id: string): void {
                  var ary = zk._anique[id];
                  if (ary) {
                      var al = ary.length, data: Anima | undefined;
                      while (data = ary.shift()) {
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts - About 45 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 _createWrapper has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      _createWrapper(element: JQuery): JQuery {
                          // ZK-5354: Update animation implementation to avoid iframe reloading
                          if (element.find('iframe').length) {
                              return element;
                          }
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                      getAnimationSpeed(defaultValue?: 'slow' | 'fast' | number): 'slow' | 'fast' | number {
                          var animationSpeed = jq(this.$().$n()).closest('[data-animationspeed]').data('animationspeed') as string | number,
                              jqSpeed = jq.fx.speeds;
              
                          if (typeof animationSpeed === 'string') {
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                      _removeWrapper(element: JQuery): JQuery {
                          var active = document.activeElement,
                              wrapped = element.children('.ui-effects-wrapper');
                          if (wrapped.length) {
                              var children = wrapped.contents();
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                      defaultAnimaOpts(wgt: zk.Widget, opts: zk.SlideOptions, prop: string[], visible?: boolean): this {
                          var self = this;
                          jq.timers.push(function () {
                              if (!visible)
                                  zWatch.fireDown('onHide', wgt);
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                          this._createWrapper(this.defaultAnimaOpts(wgt, opts, prop, true).jq)
                              // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
                              .css(css).show().animate(anima, {
                              queue: false, easing: opts.easing, duration: this.getAnimationSpeed(opts.duration === 0 ? 0 : opts.duration || 250),
                              always: opts.afterAnima
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 4 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 373..378

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

              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

                          this._createWrapper(this.defaultAnimaOpts(wgt, opts, prop, true).jq)
                              // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
                              .css(css).show().animate(anima, {
                              queue: false, easing: opts.easing, duration: this.getAnimationSpeed(opts.duration === 0 ? 0 : opts.duration || 350),
                              always: opts.afterAnima
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 4 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 206..211

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

              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

                          this._createWrapper(this.defaultAnimaOpts(wgt, opts, prop).jq)
                              // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
                              .css(css).animate(anima, {
                              queue: false, easing: opts.easing, duration: this.getAnimationSpeed(opts.duration === 0 ? 0 : opts.duration || 350),
                              always: opts.afterAnima
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 4 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 263..268

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

              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

                          this._createWrapper(this.defaultAnimaOpts(wgt, opts, prop).jq)
                              // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
                              .css(css).animate(anima, {
                              queue: false, easing: opts.easing, duration: this.getAnimationSpeed(opts.duration === 0 ? 0 : opts.duration || 250),
                              always: opts.afterAnima
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 4 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 316..321

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

              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

                          case 'b':
                              css.height = '0';
                              css.top = jq.px(dims.top + dims.height);
                              anima.height = jq.px0(dims.height);
                              anima.top = jq.px(dims.top);
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 2 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 198..203

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

              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

                          case 'r':
                              css.width = '0';
                              css.left = jq.px(dims.left + dims.width);
                              anima.width = jq.px0(dims.width);
                              anima.left = jq.px(dims.left);
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 2 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 188..193

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

              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 anchor = opts ? opts.anchor || 't' : 't',
                              prop = ['top', 'left', 'height', 'width', 'overflow', 'position', 'border', 'margin', 'padding'],
                              anima: Record<string, string> = {},
                              css: Record<string, string> = {overflow: 'hidden'},
                              dims = this.dimension();
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 2 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 174..178

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

              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 anchor = opts ? opts.anchor || 't' : 't',
                              prop = ['top', 'left', 'height', 'width', 'overflow', 'position', 'border', 'margin', 'padding'],
                              anima: Record<string, string> = {},
                              css: Record<string, string> = {overflow: 'hidden'},
                              dims = this.dimension();
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 2 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 235..239

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

              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 anchor = opts ? opts.anchor || 't' : 't',
                              prop = ['top', 'left', 'position', 'border', 'margin', 'padding'],
                              anima: Record<string, string> = {},
                              css: Record<string, string> = {},
                              dims = this.dimension();
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 2 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 292..296

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

              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 anchor = opts ? opts.anchor || 't' : 't',
                              prop = ['top', 'left', 'position', 'border', 'margin', 'padding'],
                              anima: Record<string, string> = {},
                              css: Record<string, string> = {},
                              dims = this.dimension();
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 2 hrs to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 345..349

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

              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

                          case 'r':
                              css.width = jq.px0(dims.width);
                              anima.width = 'hide';
                              anima.left = jq.px(dims.left + dims.width);
                              break;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 1 hr to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 248..252

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

              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

                          case 'b':
                              css.height = jq.px0(dims.height);
                              anima.height = 'hide';
                              anima.top = jq.px(dims.top + dims.height);
                              break;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 1 hr to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 256..260

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

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

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

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

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

              Refactorings

              Further Reading

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

                          case 'b':
                              css.top = jq.px(dims.top + dims.height);
                              anima.top = jq.px(dims.top);
                              break;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 3 other locations - About 1 hr to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 355..358
              zk/src/main/resources/web/js/zk/anima.ts on lines 363..366
              zk/src/main/resources/web/js/zk/anima.ts on lines 367..370

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

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

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

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

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

              Refactorings

              Further Reading

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

                          case 't':
                              css.top = jq.px(dims.top - dims.height);
                              anima.top = jq.px(dims.top);
                              break;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 3 other locations - About 1 hr to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 359..362
              zk/src/main/resources/web/js/zk/anima.ts on lines 363..366
              zk/src/main/resources/web/js/zk/anima.ts on lines 367..370

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

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

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

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

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

              Refactorings

              Further Reading

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

                          case 'l':
                              css.left = jq.px(dims.left - dims.width);
                              anima.left = jq.px(dims.left);
                              break;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 3 other locations - About 1 hr to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 355..358
              zk/src/main/resources/web/js/zk/anima.ts on lines 359..362
              zk/src/main/resources/web/js/zk/anima.ts on lines 367..370

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

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

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

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

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

              Refactorings

              Further Reading

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

                          case 'r':
                              css.left = jq.px(dims.left + dims.width);
                              anima.left = jq.px(dims.left);
                              break;
              Severity: Major
              Found in zk/src/main/resources/web/js/zk/anima.ts and 3 other locations - About 1 hr to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 355..358
              zk/src/main/resources/web/js/zk/anima.ts on lines 359..362
              zk/src/main/resources/web/js/zk/anima.ts on lines 363..366

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

              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 (active && (element[0] === active || jq.contains(element[0], active))) {
                                  jq(active).trigger('focus');
                              }
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 50 mins to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 473..475

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

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

                          if (active && (element[0] === active || jq.contains(element[0], active))) {
                              jq(active).trigger('focus');
                          }
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/anima.ts and 1 other location - About 50 mins to fix
              zk/src/main/resources/web/js/zk/anima.ts on lines 490..492

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status