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

Summary

Maintainability
F
6 days
Test Coverage

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

    private void renderValue(Object value) {
        if (value == null || value instanceof String) {
            renderValue((String) value);
            return;
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.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 renderValue has 166 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    File JsContentRenderer.java has 361 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      JsContentRenderer has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class JsContentRenderer implements ContentRenderer {
          private final StringBuilder _buf = new StringBuilder(128);
      
          public JsContentRenderer() {
          }
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 3 hrs to fix

        Method renderWidgetOverrides has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public void renderWidgetOverrides(Map<String, String> overrides) {
                if (overrides == null || overrides.isEmpty())
                    return;
        
                renderName("overrides");
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Avoid too many return statements within this method.
        Open

                    return;
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return;
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return;
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return;
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return;
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return;
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return;
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return;
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return;
                          Severity: Major
                          Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return;
                            Severity: Major
                            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return;
                              Severity: Major
                              Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return;
                                Severity: Major
                                Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return;
                                  Severity: Major
                                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return;
                                    Severity: Major
                                    Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                  return;
                                      Severity: Major
                                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return;
                                        Severity: Major
                                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return;
                                          Severity: Major
                                          Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 30 mins to fix

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

                                                    switch (value) {
                                                    case '\'':
                                                    case '\\':
                                                        _buf.append('\\');
                                                        break;
                                            Severity: Major
                                            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java and 1 other location - About 1 hr to fix
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 254..275

                                            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 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/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 329..339

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

                                            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/JsContentRenderer.java on lines 252..262
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 263..273
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 274..284
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 285..295
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 296..306
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 307..317
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 318..328

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

                                            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
                                            Severity: Major
                                            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java and 1 other location - About 1 hr to fix
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 133..141

                                            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());
                                                        }
                                            Severity: Minor
                                            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java and 1 other location - About 40 mins to fix
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 148..152

                                            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 it = attrs.entrySet().iterator(); it.hasNext();) {
                                                        final Map.Entry me = (Map.Entry) it.next();
                                                        renderValue(me.getKey()); //allow ':' or others
                                                        _buf.append(':');
                                                        renderValue(me.getValue());
                                            Severity: Minor
                                            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java and 1 other location - About 35 mins to fix
                                            zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java on lines 381..387

                                            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