zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java

Summary

Maintainability
F
1 wk
Test Coverage

Method renderValue has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

    private String renderValue(Object value) {
        if (value == null || value instanceof String) {
            return renderValue((String) value);
        }
        if (value instanceof Date) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - 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

Method toString has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    public String toString() {
        StringBuilder sb = new StringBuilder(64);
        Map<String, List<Object>> result = new LinkedHashMap<String, List<Object>>(_stack);
        List<Map<String, String>> listeners = Generics.cast(result.remove("listeners0"));
        List<Map<String, String>> overrides = Generics.cast(result.remove("overrides"));
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 7 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 renderValue has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private String renderValue(Object value) {
        if (value == null || value instanceof String) {
            return renderValue((String) value);
        }
        if (value instanceof Date) {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 5 hrs to fix

    File JSCumulativeContentRenderer.java has 341 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /** JSCumulativeContentRenderer.java.
    
        Purpose:
            
        Description:
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 4 hrs to fix

      Method toString has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public String toString() {
              StringBuilder sb = new StringBuilder(64);
              Map<String, List<Object>> result = new LinkedHashMap<String, List<Object>>(_stack);
              List<Map<String, String>> listeners = Generics.cast(result.remove("listeners0"));
              List<Map<String, String>> overrides = Generics.cast(result.remove("overrides"));
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 3 hrs to fix

        JSCumulativeContentRenderer has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class JSCumulativeContentRenderer implements ContentRenderer {
        
            private Map<String, List<Object>> _stack = new LinkedHashMap<String, List<Object>>();
        
            private List<Object> fetch(String name) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 2 hrs to fix

          Method renderValue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private String renderValue(char value) {
                  StringBuilder buf = new StringBuilder();
                  buf.append('\'');
                  switch (value) {
                  case '\'':

            Avoid deeply nested control flow statements.
            Open

                                    if (v.length() != 0 && ((cc = v.charAt(v.length() - 1)) == ';' || cc == ','
                                            || (v.indexOf("function") < 0 && v.indexOf(';') >= 0)))
                                        throw new UiException("Illegal client override: " + v
                                                + (name.startsWith("on")
                                                        ? "\nTo listen an event, remember to captalize the third letter, such as onClick"
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 45 mins to fix

              Avoid too many return statements within this method.
              Open

                          return renderValue(value.toString());
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return buf.toString();
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return buf.toString();
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return buf.toString();
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return buf.toString();
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return buf.toString();
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return buf.toString();
                          Severity: Major
                          Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return buf.toString();
                            Severity: Major
                            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return ((JSONAware) value).toJSONString();
                              Severity: Major
                              Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return buf.toString();
                                Severity: Major
                                Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return buf.toString();
                                  Severity: Major
                                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return buf.toString();
                                    Severity: Major
                                    Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 30 mins to fix

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

                                              switch (value) {
                                              case '\'':
                                              case '\\':
                                                  buf.append('\\');
                                                  break;
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 376..397

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

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

                                              if (value instanceof float[]) {
                                                  buf.append('[');
                                                  final float[] ary = (float[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

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

                                              if (value instanceof Object[]) {
                                                  buf.append('[');
                                                  final Object[] ary = (Object[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

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

                                              if (value instanceof byte[]) {
                                                  buf.append('[');
                                                  final byte[] ary = (byte[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

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

                                              if (value instanceof long[]) {
                                                  buf.append('[');
                                                  final long[] ary = (long[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

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

                                              if (value instanceof char[]) {
                                                  buf.append('[');
                                                  final char[] ary = (char[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233

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

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

                                              if (value instanceof int[]) {
                                                  buf.append('[');
                                                  final int[] ary = (int[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

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

                                              if (value instanceof short[]) {
                                                  buf.append('[');
                                                  final short[] ary = (short[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 212..222
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

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

                                              if (value instanceof double[]) {
                                                  buf.append('[');
                                                  final double[] ary = (double[]) value;
                                                  for (int j = 0; j < ary.length; ++j) {
                                                      if (j > 0)
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 157..167
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 168..178
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 179..189
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 190..200
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 201..211
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 223..233
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 234..244

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

                                      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

                                                  for (Iterator it = ((Map) value).entrySet().iterator(); it.hasNext();) {
                                                      final Map.Entry me = (Map.Entry) it.next();
                                                      if (first)
                                                          first = false;
                                                      else
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 228..236

                                      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

                                                  for (Iterator it = ((List) value).iterator(); it.hasNext(); j++) {
                                                      if (j > 0)
                                                          buf.append(',');
                                                      renderValue(it.next());
                                                  }
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 243..247

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

                                      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

                                                      for (Iterator itt = it.next().entrySet().iterator(); itt.hasNext();) {
                                                          final Map.Entry me = (Map.Entry) itt.next();
                                                          renderValue(me.getKey()); //allow ':' or others
                                                          sb.append(':');
                                                          renderValue(me.getValue());
                                      zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 476..482

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

                                      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