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

Summary

Maintainability
F
1 wk
Test Coverage

Function fixFlex has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
Open

        fixFlex(wgt: zk.Widget): void {
            let hflexWgt;
            if (wgt._flexFixed || (!wgt._nvflex && !wgt._nhflex)) { //other vflex/hflex sibliing has done it!
                delete wgt._flexFixed;
                return;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/flex.ts - About 2 days to fix

Cognitive Complexity

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

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

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

Further reading

Function applyCSSFlex has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
Open

        applyCSSFlex(this: zk.Widget): void {
            const wgt = this;
            if (!wgt._nvflex && !wgt._nhflex)
                return;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/flex.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

File flex.ts has 627 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* flex.ts

Purpose:

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

    Function fixFlex has 158 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            fixFlex(wgt: zk.Widget): void {
                let hflexWgt;
                if (wgt._flexFixed || (!wgt._nvflex && !wgt._nhflex)) { //other vflex/hflex sibliing has done it!
                    delete wgt._flexFixed;
                    return;
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/flex.ts - About 6 hrs to fix

      Function clearCSSFlex has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

              clearCSSFlex(wgt: zk.Widget, o: FlexOrient, clearAllSiblings?: boolean): void {
                  if (!wgt._cssFlexApplied) return;
      
                  const pwgt = wgt.parent;
                  if (!pwgt) return;
      Severity: Minor
      Found in zk/src/main/resources/web/js/zk/flex.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 _fixMinFlex has 147 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function _fixMinFlex(isVflex?): ((wgt: zk.Widget, wgtn: HTMLElement, o: FlexOrient,
                                        min?: number) => number) {
          let flexsz: string, sizePos: string, flex: string, offsetPos: string, marginPos: string, maxFlexPos: string, sumFlexPos: string,
              index: number, contentPos: string;
          if (isVflex) {
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/flex.ts - About 5 hrs to fix

        Function applyCSSFlex has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                applyCSSFlex(this: zk.Widget): void {
                    const wgt = this;
                    if (!wgt._nvflex && !wgt._nhflex)
                        return;
        
        Severity: Major
        Found in zk/src/main/resources/web/js/zk/flex.ts - About 3 hrs to fix

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

                  getFlexInfo(wgt: zk.Widget): { isFlexRow: boolean; flexContainerChildren: HTMLElement[]; childrenWidgets: zk.Widget[] } {
                      let pwgt = wgt.parent,
                          cwgt = pwgt!.firstChild,
                          fContainer = pwgt!.getFlexContainer_()!,
                          fcc = fContainer.firstElementChild as HTMLElement,
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/flex.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 getFlexInfo has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  getFlexInfo(wgt: zk.Widget): { isFlexRow: boolean; flexContainerChildren: HTMLElement[]; childrenWidgets: zk.Widget[] } {
                      let pwgt = wgt.parent,
                          cwgt = pwgt!.firstChild,
                          fContainer = pwgt!.getFlexContainer_()!,
                          fcc = fContainer.firstElementChild as HTMLElement,
          Severity: Minor
          Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

            Function clearCSSFlex has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    clearCSSFlex(wgt: zk.Widget, o: FlexOrient, clearAllSiblings?: boolean): void {
                        if (!wgt._cssFlexApplied) return;
            
                        const pwgt = wgt.parent;
                        if (!pwgt) return;
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

              Function beforeSize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                      beforeSize(this: zk.Widget, ctl: unknown, opts: unknown, cleanup: boolean): void {
                          let wgt = this, p;
                          if (cleanup)
                              wgt.clearCachedSize_();
              
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function _getTextSize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _getTextSize(zkc: zk.JQZK, zkp: zk.JQZK, zkpOffset: zk.Offset): zk.Offset {
                  let $zkc = zkc.jq,
                      $prev = $zkc.prev(),
                      pos: zk.Offset = [0, 0],
                      coldVal: Record<string, string>,
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if (vertical) {
                        hgh = ref._hgh ?? (ref._hgh = ref.top + ref.height);
                        wdh = ref._wdh ?? (ref._wdh = ref.left + ref.width);
                        return cur.top >= hgh || cur.left < wdh;
                    } else {
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

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

                  function _getTextSize(zkc: zk.JQZK, zkp: zk.JQZK, zkpOffset: zk.Offset): zk.Offset {
                      let $zkc = zkc.jq,
                          $prev = $zkc.prev(),
                          pos: zk.Offset = [0, 0],
                          coldVal: Record<string, string>,
                  Severity: Minor
                  Found in zk/src/main/resources/web/js/zk/flex.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

                  Avoid deeply nested control flow statements.
                  Open

                                          if (!cwgt.ignoreFlexSize_(o)) {
                                              let c = cwgt.$n();
                                              if (c) { //node might not exist if rod on
                                                  //Skip absolute or fixed DOM element size
                                                  const cpos = c.style.position;
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/flex.ts - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for (; c; c = c.nextSibling) {
                                                //Skip absolute or fixed DOM element size
                                                isText = c.nodeType == 3; // Bug ZK-2275, we need to update c.nodeType
                                                if (!isText) {
                                                    const cpos = (c as HTMLElement).style.position;
                    Severity: Major
                    Found in zk/src/main/resources/web/js/zk/flex.ts - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if ((wgt._vflex === undefined || (wgt._vflexsz && wgt._vflex == 'min'))
                                      && (wgt._hflex === undefined || (wgt._hflexsz && wgt._hflex == 'min')))
                                      return;
                      Severity: Major
                      Found in zk/src/main/resources/web/js/zk/flex.ts - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        if ((clearAllSiblings || isTargetWgt) && (isHorizontal && isRow) || (!isHorizontal && !isRow)) {
                                            fcc.style.flexGrow = '';
                                            jqFcc.removeClass(flexItemClass);
                                            if (fcc != c && !c.style[dim])
                                                c.style[dim] = '';
                        Severity: Major
                        Found in zk/src/main/resources/web/js/zk/flex.ts - About 40 mins to fix

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

                          function _isSameBaseline(ref: zk.Dimension & {_hgh?: number; _wdh?: number}, cur: zk.Dimension, vertical): boolean {
                              let hgh: number, wdh: number;
                              if (vertical) {
                                  hgh = ref._hgh ?? (ref._hgh = ref.top + ref.height);
                                  wdh = ref._wdh ?? (ref._wdh = ref.left + ref.width);
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.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 onFitSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  onFitSize(this: zk.Widget): void {
                                      const wgt = this,
                                          c = wgt.$n();
                                      if (c && zk(c).isVisible()) {
                                          // Bug ZK-3014: offsetWidth will be available only when wgt is real visible
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.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 domClass_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              domClass_(no?: zk.DomClassOptions): string {
                                  let domClass = /*safe*/ _xWidget.domClass_.call(this, no),
                                      n = this.$n() as HTMLElement | undefined;
                                  if (n) {
                                      const jqn = jq(n),
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.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

                              if (vertical) {
                                  hgh = ref._hgh ?? (ref._hgh = ref.top + ref.height);
                                  wdh = ref._wdh ?? (ref._wdh = ref.left + ref.width);
                                  return cur.top >= hgh || cur.left < wdh;
                              } else {
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 3 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 77..81

                          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

                              } else {
                                  hgh = ref._hgh ?? (ref._hgh = ref.top + ref.height);
                                  wdh = ref._wdh ?? (ref._wdh = ref.left + ref.width);
                                  return cur.left >= wdh || cur.top < hgh;
                              }
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 3 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 73..77

                          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

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

                                              if (fcc != c) {
                                                  let cMarginSize = isRow ? zk(c).marginHeight() : zk(c).marginWidth(),
                                                      cDimValue = cMarginSize > 0 ? 'calc(100% - ' + jq.px0(cMarginSize) + ')' : '100%'; //handle margin issue
                                                  c.style[dim] = cDimValue;
                                              } else
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 2 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 592..598

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 89.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                              if (fcc != c && !c.style[dim]) {
                                                  let cMarginSize = isRow ? zk(c).marginHeight() : zk(c).marginWidth(),
                                                      cDimValue = cMarginSize > 0 ? 'calc(100% - ' + jq.px0(cMarginSize) + ')' : '100%'; //handle margin issue
                                                  c.style[dim] = cDimValue;
                                              } else
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 2 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 611..616

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 89.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                          if (flex && flex > 0) {
                                              const marginSize = isRow ? zk(jqFcc).marginHeight() : zk(jqFcc).marginWidth(); //handle margin issue
                                              fcc.style[dim] = marginSize > 0 ? 'calc(100% - ' + jq.px0(marginSize) + ')' : '100%';
                                              if (fcc != c) {
                                                  let cMarginSize = isRow ? zk(c).marginHeight() : zk(c).marginWidth(),
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 2 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 587..603

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                                          if (flex && flex > 0) {
                                              isAllMin = false;
                                              jqFcc.addClass(flexItemClass);
                                              if (flex != 1 || fcc.style.flexGrow)
                                                  fcc.style.flexGrow = flex as unknown as string; //update flex
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 2 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 608..621

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

                          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 (wgt._hflex && wgt._hflex != 'min') {
                                              wgt.resetSize_('w');
                                              // Bug ZK-597
                                              delete wgt._flexFixed;
                                              if ((p = wgt.parent))
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 2 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 292..298

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

                          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 (wgt._vflex && wgt._vflex != 'min') {
                                              wgt.resetSize_('h');
                                              // Bug ZK-597
                                              delete wgt._flexFixed;
                                              if ((p = wgt.parent))
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 2 hrs to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 285..291

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                              } else {
                                  flexsz = '_hflexsz';
                                  sizePos = 'width';
                                  flex = '_hflex';
                                  offsetPos = 'offsetWidth';
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 1 hr to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 88..98

                          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 (isVflex) {
                                  flexsz = '_vflexsz';
                                  sizePos = 'height';
                                  flex = '_vflex';
                                  offsetPos = 'offsetHeight';
                          Severity: Major
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 1 hr to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 98..108

                          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

                                  pos[1] = zkpOffset[1] + zkp.sumStyles('t', jq.paddings) + zkp.sumStyles('t', jq.borders);
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 40 mins to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 53..53

                          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

                                  pos[0] = zkpOffset[0] + zkp.sumStyles('l', jq.paddings) + zkp.sumStyles('l', jq.borders);
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 40 mins to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 54..54

                          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

                                          if (wgt._vflex == 'min' && wgt._vflexsz === undefined && wgt.isRealVisible() && !wgt.ignoreFlexSize_('h'))
                                              zFlex.fixMinFlex(wgt, c, 'h');
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 35 mins to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 521..522

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 47.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                          if (wgt._hflex == 'min' && wgt._hflexsz === undefined && wgt.isRealVisible() && !wgt.ignoreFlexSize_('w'))
                                              zFlex.fixMinFlex(wgt, c, 'w');
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/flex.ts and 1 other location - About 35 mins to fix
                          zk/src/main/resources/web/js/zk/flex.ts on lines 524..525

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 47.

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

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

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

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

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status