zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java

Summary

Maintainability
F
5 days
Test Coverage

Method prepare has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private void prepare(Object o, final int begin) {
        if (begin > 0 && (o instanceof List)) {
            final List l = (List) o;
            final int size = l.size();
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 6 hrs to fix

    Method prepare has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

        @SuppressWarnings("unchecked")
        private void prepare(Object o, final int begin) {
            if (begin > 0 && (o instanceof List)) {
                final List l = (List) o;
                final int size = l.size();
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 6 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

    File ForEachImpl.java has 437 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* ForEachImpl.java
    
        Purpose:
            
        Description:
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 6 hrs to fix

      ForEachImpl has 42 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class ForEachImpl implements ForEach {
          private final EvaluatorRef _evalr;
          private final Page _page;
          private final Component _comp;
          private final ExValue[] _expr;
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 5 hrs to fix

        Method next has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            public boolean next() {
                if (_done)
                    throw new IllegalStateException("Iterate twice not allowed");
        
                if (_status == null) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 3 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method next has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public boolean next() {
                if (_done)
                    throw new IllegalStateException("Iterate twice not allowed");
        
                if (_status == null) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 1 hr to fix

          Method getInstance has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end,
                      ExValue step) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 45 mins to fix

            Method getInstance has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end,
                        ExValue step) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 45 mins to fix

              Method getInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 35 mins to fix

                Method getInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static ForEach getInstance(EvaluatorRef evalr, Component comp, String expr, String begin, String end) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 35 mins to fix

                  Method getInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static ForEach getInstance(EvaluatorRef evalr, Page page, String expr, String begin, String end) {
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 35 mins to fix

                    Method getInstance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 35 mins to fix

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

                              } else if (o instanceof short[]) {
                                  final short[] ary = (short[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

                              } else if (o instanceof char[]) {
                                  final char[] ary = (char[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

                              } else if (o instanceof float[]) {
                                  final float[] ary = (float[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

                              } else if (o instanceof byte[]) {
                                  final byte[] ary = (byte[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

                              } else if (o instanceof int[]) {
                                  final int[] ary = (int[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455

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

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

                              } else if (o instanceof double[]) {
                                  final double[] ary = (double[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

                              } else if (o instanceof long[]) {
                                  final long[] ary = (long[]) o;
                                  _it = new Iterator() {
                                      private int _j = begin;
                      
                      
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

                      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

                          public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end,
                                  ExValue step) {
                              if (expr == null || expr.length == 0)
                                  return null;
                              return new ForEachImpl(evalr, page, expr, begin, end, step);
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 1 other location - About 35 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 102..107

                      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

                          public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end,
                                  ExValue step) {
                              if (expr == null || expr.length == 0)
                                  return null;
                              return new ForEachImpl(evalr, comp, expr, begin, end, step);
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 1 other location - About 35 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 122..127

                      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

                          public static ForEach getInstance(EvaluatorRef evalr, Page page, String expr, String begin, String end) {
                              if (expr == null || expr.length() == 0)
                                  return null;
                              return new ForEachImpl(evalr, page, expr, begin, end);
                          }
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 1 other location - About 35 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 211..215

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

                      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

                          public static ForEach getInstance(EvaluatorRef evalr, Component comp, String expr, String begin, String end) {
                              if (expr == null || expr.length() == 0)
                                  return null;
                              return new ForEachImpl(evalr, comp, expr, begin, end);
                          }
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 1 other location - About 35 mins to fix
                      zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 224..228

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

                      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