Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                            if (cc == 'm') min = nv;
                            else if (cc == 's') sec = nv;
                            else msec = nv;
Severity: Major
Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (token && token.length > len) {
                                    ts[--i] = token.substring(len);
                                    token = token.substring(0, len);
                                }
    Severity: Major
    Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

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

          getRuleNames: function (func: TSESTree.Node): string[] {
      
              // Unwrap the possible call expression.
              if (func.type === 'CallExpression')
                  func = func.callee;
      Severity: Minor
      Found in eslint-plugin-zk/src/tree.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 (len == 3)
                                      symbols = localizedSymbols.SMON!;
                                  else if (len == 4)
                                      symbols = localizedSymbols.FMON!;
                                  else
      Severity: Major
      Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                } else if (len <= 2) {
                                    if (nosep && token && token.length > 2) {//Bug 2560497 : if no separator, token must be assigned.
                                        ts[--i] = token.substring(2);
                                        token = token.substring(0, 2);
                                    }
        Severity: Major
        Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          while (f == fmt.charAt(i - 1) && f) {
                              f = fmt.charAt(++i);
                          }
          Severity: Major
          Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (key)
                                            tmp.push(key);
            Severity: Major
            Found in zk/src/main/resources/web/js/zk/utl.ts - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (ydelta === 0 && newY < 100) { // only handle twoDigitYearStart with ISO calendar for now
                                              // ZK-4235: Datefmt parseDate always return date between 1930-2029 when using yy format
                                              var twoDigitYearStart = zk.TDYS,
                                                  lowerBoundary = (Math.floor(twoDigitYearStart / 100) * 100) + newY,
                                                  upperBoundary = lowerBoundary + 100;
              Severity: Major
              Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (callee.property.name === 'attr') {
                                                    visitedNode[parent.range.toString()] = true;
                                                    // ignore for .attr(key, null);
                                                    return;
                                                }
                Severity: Major
                Found in eslint-plugin-zk/src/rules/noNull.ts - About 45 mins to fix

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

                      @Listen("onClick = #rebuildButton")
                      public void rebuildModel() {
                          //backup open paths
                          int[][] openPaths = treeModel.getOpenPaths();
                          treeModel.clearOpen();
                  Severity: Major
                  Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java and 3 other locations - About 45 mins to fix
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 68..78
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 83..95
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 109..121

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

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

                          protected void removeRange(int fromIndex, int toIndex) {
                              ListIterator<Component> it = listIterator(toIndex);
                              for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                                  it.previous();
                                  it.remove();
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Rows.java and 2 other locations - About 45 mins to fix
                  zul/src/main/java/org/zkoss/zul/Listbox.java on lines 417..423
                  zul/src/main/java/org/zkoss/zul/Listbox.java on lines 483..489

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

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

                          protected void removeRange(int fromIndex, int toIndex) {
                              ListIterator<Component> it = listIterator(toIndex);
                              for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                                  it.previous();
                                  it.remove();
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 45 mins to fix
                  zul/src/main/java/org/zkoss/zul/Listbox.java on lines 417..423
                  zul/src/main/java/org/zkoss/zul/Rows.java on lines 678..684

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

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

                      @Listen("onClick = #rebuildButton")
                      public void rebuildModel() {
                          //backup open paths
                          int[][] openPaths = treeModel.getOpenPaths();
                          treeModel.clearOpen();
                  Severity: Major
                  Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java and 3 other locations - About 45 mins to fix
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 68..78
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 68..78
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 109..121

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

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

                              protected void removeRange(int fromIndex, int toIndex) {
                                  ListIterator<Listitem> it = listIterator(toIndex);
                                  for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                                      it.previous();
                                      it.remove();
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 45 mins to fix
                  zul/src/main/java/org/zkoss/zul/Listbox.java on lines 483..489
                  zul/src/main/java/org/zkoss/zul/Rows.java on lines 678..684

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

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

                      @Listen("onClick = #rebuildButton")
                      public void rebuildModel() {
                          //backup open paths
                          int[][] openPaths = treeModel.getOpenPaths();
                          treeModel.clearOpen();
                  Severity: Major
                  Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java and 3 other locations - About 45 mins to fix
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 68..78
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 83..95
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 109..121

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

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

                      @Listen("onClick = #rebuildButton")
                      public void rebuildModel() {
                          //backup open paths
                          int[][] openPaths = treeModel.getOpenPaths();
                          treeModel.clearOpen();
                  Severity: Major
                  Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java and 3 other locations - About 45 mins to fix
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 68..78
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 68..78
                  zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 83..95

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

                  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

                      @Command
                      public void remove() {
                          model_l.remove(model_l.getSize() - 1);
                          model_m.remove(model_m.getElementAt(model_m.getSize() - 1).getKey());
                          model_s.remove(model_s.getElementAt(model_s.getSize() - 1));
                  zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/ForEachListModelVM.java on lines 219..224

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

                  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

                      private static class AuxInfo implements java.io.Serializable, Cloneable {
                          /** The error message. Not null if users entered a wrong data (and
                           * not correct it yet).
                           */
                          private String errmsg;
                  Severity: Minor
                  Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.java and 1 other location - About 45 mins to fix
                  zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 519..544

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

                  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

                      private void collectSavePropertyAfter(Component comp, String command, Event evt, Set<Property> validates) {
                          final List<SavePropertyBinding> bindings = _infoProvider.getSaveAfterBindings().get(command); //_saveAfterBindings.get(command);
                          if (bindings != null) {
                              for (SavePropertyBinding binding : bindings) {
                                  collectSavePropertyBinding(comp, binding, command, evt, validates);
                  Severity: Major
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java and 3 other locations - About 45 mins to fix
                  zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java on lines 76..83
                  zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java on lines 86..93
                  zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java on lines 112..119

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

                  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

                      private <T> Set<T> collectUnselectedObjects(Set<T> previousSelection, Set<T> currentSelection) {
                          Set<T> prevSeldItems = previousSelection != null ? new LinkedHashSet<T>(previousSelection)
                                  : new LinkedHashSet<T>();
                          if (currentSelection != null && prevSeldItems.size() > 0)
                              prevSeldItems.removeAll(currentSelection);
                  Severity: Minor
                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 45 mins to fix
                  zul/src/main/java/org/zkoss/zul/Tree.java on lines 2763..2769

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language