zul/src/main/java/org/zkoss/zul/impl/XulElement.java

Summary

Maintainability
D
2 days
Test Coverage

XulElement has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class XulElement extends HtmlBasedComponent {
    /** AuxInfo: use a class (rather than multiple member) to save footprint */
    private AuxInfo _auxinf;

    /** Returns what keystrokes to intercept.
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java - About 3 hrs to fix

    File XulElement.java has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* XulElement.java
    
        Purpose:
            
        Description:
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java - About 2 hrs to fix

      Method getValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

              public Object getValue() {
                  if (popupString != null) {
                      return popupString;
                  } else if (popup != null) {
                      String uuidString = "uuid(" + popup.getUuid() + ")";
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.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 setPopupAttributes has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void setPopupAttributes(Popup popup, String position, String x, String y, String type) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java - About 35 mins to fix

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

            public void setContextAttributes(Popup popup, String position, String x, String y, String type) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java - About 35 mins to fix

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

              public void setTooltipAttributes(Popup popup, String position, String x, String y, Integer delay) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java - About 35 mins to fix

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

                    public boolean equals(Object obj) {
            
                        if (obj instanceof String) {
                            return Objects.equals(popupString, obj);
                        } else if (obj instanceof Popup) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.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 hashCode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                    public int hashCode() {
                        if (popupString != null) {
                            return popupString.hashCode();
                        } else if (popup != null) {
                            return popup.hashCode();
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.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 3 locations. Consider refactoring.
            Open

                public void setPopupAttributes(Popup popup, String position, String x, String y, String type) {
                    setPopup(popup);
                    if (_auxinf != null && _auxinf.popup != null) {
                        DeferedUuid pp = (DeferedUuid) _auxinf.popup;
                        pp.setPosition(position);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 209..218
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 402..411

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

            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

                public void setContextAttributes(Popup popup, String position, String x, String y, String type) {
                    setContext(popup);
                    if (_auxinf != null && _auxinf.context != null) {
                        DeferedUuid pp = (DeferedUuid) _auxinf.context;
                        pp.setPosition(position);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 302..311
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 402..411

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

            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

                public void setTooltipAttributes(Popup popup, String position, String x, String y, Integer delay) {
                    setTooltip(popup);
                    if (_auxinf != null && _auxinf.tooltip != null) {
                        DeferedUuid pp = (DeferedUuid) _auxinf.tooltip;
                        pp.setPosition(position);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 209..218
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 302..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 82.

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

                public void setCtrlKeys(String ctrlKeys) throws UiException {
                    if (ctrlKeys != null && ctrlKeys.length() == 0)
                        ctrlKeys = null;
                    if (!Objects.equals(_auxinf != null ? _auxinf.ctrlKeys : null, ctrlKeys)) {
                        initAuxInfo().ctrlKeys = ctrlKeys;
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 6 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/A.java on lines 163..171
            zul/src/main/java/org/zkoss/zul/Button.java on lines 214..222
            zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 232..240
            zul/src/main/java/org/zkoss/zul/impl/InputElement.java on lines 181..188
            zul/src/main/java/org/zkoss/zul/impl/InputElement.java on lines 755..762
            zul/src/main/java/org/zkoss/zul/impl/InputElement.java on lines 778..785

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

            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

                    _properties.put("context", new ObjectPropertyAccess() {
                        public void setValue(Component cmp, Object context) {
                            if (context instanceof Popup)
                                ((XulElement) cmp).setContext((Popup) context);
                            else if (context != null)
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 440..451
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 453..464

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 73.

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

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

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

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

            Refactorings

            Further Reading

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

                    _properties.put("tooltip", new ObjectPropertyAccess() {
                        public void setValue(Component cmp, Object tooltip) {
                            if (tooltip instanceof Popup)
                                ((XulElement) cmp).setTooltip((Popup) tooltip);
                            else if (tooltip != null)
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 428..439
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 440..451

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 73.

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

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

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

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

            Refactorings

            Further Reading

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

                    _properties.put("popup", new ObjectPropertyAccess() {
                        public void setValue(Component cmp, Object popup) {
                            if (popup instanceof Popup)
                                ((XulElement) cmp).setPopup((Popup) popup);
                            else if (popup != null)
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 428..439
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 453..464

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 73.

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

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

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

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

            Refactorings

            Further Reading

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

                public void setPopup(Popup popup) {
                    if (!Objects.equals(_auxinf != null ? _auxinf.popup : null, popup)) {
                        initAuxInfo().popup = new DeferedUuid(popup);
                        smartUpdate("popup", _auxinf.popup);
                    }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 5 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 173..178
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 189..194
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 267..272
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 365..371
            zul/src/main/java/org/zkoss/zul/impl/XulElement.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 52.

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

                public void setTooltip(Popup popup) {
                    // ZK-816, component keep wrong tooltip reference if set tooltip before tooltip attached
                    if (!Objects.equals(_auxinf != null ? _auxinf.tooltip : null, popup)) {
                        initAuxInfo().tooltip = new DeferedUuid(popup);
                        smartUpdate("tooltip", _auxinf.tooltip);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 5 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 173..178
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 189..194
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 267..272
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 282..287
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 365..371

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

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

                public void setContext(String context) {
                    if (!Objects.equals(_auxinf != null ? _auxinf.context : null, context)) {
                        initAuxInfo().context = new DeferedUuid(context);
                        smartUpdate("context", _auxinf.context);
                    }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 5 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 189..194
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 267..272
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 282..287
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 365..371
            zul/src/main/java/org/zkoss/zul/impl/XulElement.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 52.

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

                public void setTooltip(String tooltip) {
                    // ZK-816
                    if (!Objects.equals(_auxinf != null ? _auxinf.tooltip : null, tooltip)) {
                        initAuxInfo().tooltip = new DeferedUuid(tooltip);
                        smartUpdate("tooltip", _auxinf.tooltip);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 5 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 173..178
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 189..194
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 267..272
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 282..287
            zul/src/main/java/org/zkoss/zul/impl/XulElement.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 52.

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

                public void setPopup(String popup) {
                    if (!Objects.equals(_auxinf != null ? _auxinf.popup : null, popup)) {
                        initAuxInfo().popup = new DeferedUuid(popup);
                        smartUpdate("popup", _auxinf.popup);
                    }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 5 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 173..178
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 189..194
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 282..287
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 365..371
            zul/src/main/java/org/zkoss/zul/impl/XulElement.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 52.

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

                public void setContext(Popup popup) {
                    if (!Objects.equals(_auxinf != null ? _auxinf.context : null, popup)) {
                        initAuxInfo().context = new DeferedUuid(popup);
                        smartUpdate("context", _auxinf.context);
                    }
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 5 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 173..178
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 267..272
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 282..287
            zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 365..371
            zul/src/main/java/org/zkoss/zul/impl/XulElement.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 52.

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

                public Object clone() {
                    final XulElement clone = (XulElement) super.clone();
                    if (_auxinf != null)
                        clone._auxinf = (AuxInfo) _auxinf.clone();
                    return clone;
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 10 other locations - About 30 mins to fix
            zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 1057..1062
            zul/src/main/java/org/zkoss/zul/Button.java on lines 282..287
            zul/src/main/java/org/zkoss/zul/Cell.java on lines 112..117
            zul/src/main/java/org/zkoss/zul/Label.java on lines 188..193
            zul/src/main/java/org/zkoss/zul/Listcell.java on lines 60..65
            zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 278..283
            zul/src/main/java/org/zkoss/zul/Textbox.java on lines 223..228
            zul/src/main/java/org/zkoss/zul/Treecell.java on lines 125..130
            zul/src/main/java/org/zkoss/zul/impl/InputElement.java on lines 1114..1119
            zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 503..508

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

            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