zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java

Summary

Maintainability
F
5 days
Test Coverage

PageDefinition has 82 methods (exceeds 20 allowed). Consider refactoring.
Open

public class PageDefinition implements NodeInfo {
    /** A list of a children ({@link NodeInfo}). */
    private final List<NodeInfo> _children = new LinkedList<NodeInfo>();
    private final LanguageDefinition _langdef;
    private final Locator _locator;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 1 day to fix

    File PageDefinition.java has 554 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* PageDefinition.java
    
        Purpose:
            
        Description:
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 1 day to fix

      Method imports has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          public void imports(PageDefinition pgdef, String[] directives) {
              if (directives == null || contains(directives, "import"))
                  _clsresolver.addAll(pgdef._clsresolver);
      
              if (pgdef._initdefs != null && (directives == null || contains(directives, "init")))
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method preInit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public void preInit(Page page) {
              page.addClassResolver(_clsresolver);
      
              page.addFunctionMapper(getTaglibMapper());
      
      
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method init has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void init(final Page page, final boolean evalHeaders) {
              final PageCtrl pageCtrl = (PageCtrl) page;
              pageCtrl.init(new PageConfig() {
                  public String getId() {
                      return _id;
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 2 hrs to fix

        Method imports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void imports(PageDefinition pgdef, String[] directives) {
                if (directives == null || contains(directives, "import"))
                    _clsresolver.addAll(pgdef._clsresolver);
        
                if (pgdef._initdefs != null && (directives == null || contains(directives, "init")))
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 1 hr to fix

          Method init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public void init(final Page page, final boolean evalHeaders) {
                  final PageCtrl pageCtrl = (PageCtrl) page;
                  pageCtrl.init(new PageConfig() {
                      public String getId() {
                          return _id;
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 55 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method addHeaderInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public void addHeaderInfo(HeaderInfo header, boolean before) {
                  if (header == null)
                      throw new IllegalArgumentException();
          
                  if (before) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method setRootAttribute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public void setRootAttribute(String name, String value) {
                  if (name == null || name.length() == 0)
                      throw new IllegalArgumentException();
          
                  if (_rootAttrs == null) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

                  if (_mapperdefs != null)
                      for (Iterator it = _mapperdefs.iterator(); it.hasNext();) {
                          final FunctionMapperInfo def = (FunctionMapperInfo) it.next();
                          try {
                              FunctionMapper mapper = def.newFunctionMapper(this, page);
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 958..968

          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

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

                  if (_resolvdefs != null)
                      for (Iterator it = _resolvdefs.iterator(); it.hasNext();) {
                          final VariableResolverInfo def = (VariableResolverInfo) it.next();
                          try {
                              VariableResolver resolver = def.newVariableResolver(this, page);
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 946..956

          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

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

              public ComponentDefinition getComponentDefinition(String name, boolean recurse) {
                  ComponentDefinition compdef = _compdefs.get(name);
                  if (!recurse || compdef != null)
                      return compdef;
          
          
          zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 1149..1158
          zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 1160..1169
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 802..811

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

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

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

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

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

          Refactorings

          Further Reading

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

              public ComponentDefinition getComponentDefinition(Class cls, boolean recurse) {
                  ComponentDefinition compdef = _compdefs.get(cls);
                  if (!recurse || compdef != null)
                      return compdef;
          
          
          zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 1149..1158
          zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 1160..1169
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 782..791

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

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

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

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

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

          Refactorings

          Further Reading

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

                  if (pgdef._hdAftDefs != null && directives != null && contains(directives, "meta")) {
                      for (HeaderInfo hi : pgdef._hdAftDefs)
                          addHeaderInfo(hi, false);
                  }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 1 other location - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 317..320

          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

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

                  if (pgdef._hdBfrDefs != null && directives != null && contains(directives, "meta")) {
                      for (HeaderInfo hi : pgdef._hdBfrDefs)
                          addHeaderInfo(hi, true);
                  }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 1 other location - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 321..324

          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

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

                  if (pgdef._resolvdefs != null && directives != null && contains(directives, "variable-resolver")) {
                      for (VariableResolverInfo vri : pgdef._resolvdefs)
                          addVariableResolverInfo(vri);
                  }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 2 other locations - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 308..311
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 326..329

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

                  if (pgdef._hdResDefs != null && directives != null && contains(directives, "header")) {
                      for (ResponseHeaderInfo rhi : pgdef._hdResDefs)
                          addResponseHeaderInfo(rhi);
                  }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 2 other locations - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 303..306
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 308..311

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

                  if (pgdef._mapperdefs != null && directives != null && contains(directives, "function-mapper")) {
                      for (FunctionMapperInfo fmi : pgdef._mapperdefs)
                          addFunctionMapperInfo(fmi);
                  }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 2 other locations - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 303..306
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 326..329

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

              public void addFunctionMapperInfo(FunctionMapperInfo mapper) {
                  if (mapper == null)
                      throw new IllegalArgumentException("null");
          
                  if (_mapperdefs == null)
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 4 other locations - About 30 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 378..385
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 410..417
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 546..553
          zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Node.java on lines 40..46

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

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

              public void addForwardInfo(ForwardInfo forward) {
                  if (forward == null)
                      throw new IllegalArgumentException("null");
          
                  if (_forwdefs == null)
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 4 other locations - About 30 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 378..385
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 410..417
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 422..429
          zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Node.java on lines 40..46

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

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

              public void addInitiatorInfo(InitiatorInfo init) {
                  if (init == null)
                      throw new IllegalArgumentException("null");
          
                  if (_initdefs == null)
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 4 other locations - About 30 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 410..417
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 422..429
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 546..553
          zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Node.java on lines 40..46

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

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

              public void addVariableResolverInfo(VariableResolverInfo resolver) {
                  if (resolver == null)
                      throw new IllegalArgumentException("null");
          
                  if (_resolvdefs == null)
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 4 other locations - About 30 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 378..385
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 422..429
          zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 546..553
          zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Node.java on lines 40..46

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

          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 void addResponseHeaderInfo(ResponseHeaderInfo header) {
                  if (header == null)
                      throw new IllegalArgumentException();
                  if (_hdResDefs == null)
                      _hdResDefs = new LinkedList<ResponseHeaderInfo>();
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 1 other location - About 30 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java on lines 122..129

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

          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