zul/src/main/java/org/zkoss/zul/Treecol.java

Summary

Maintainability
F
6 days
Test Coverage

Method setSort has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public void setSort(String type) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        if (type == null)
            return;
        if (type.startsWith("client")) {
            try {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File Treecol.java has 352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Treecol.java

    Purpose:
        
    Description:
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 4 hrs to fix

    Method writeObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
            s.defaultWriteObject();
    
            boolean written = false;
            if (_sortAsc instanceof TreeitemComparator) {
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    public class Treecol extends HeaderElement {
        private static final long serialVersionUID = 20110131122933L;
    
        private String _sortDir = "natural";
        private transient Comparator<?> _sortAsc, _sortDsc;
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 3 hrs to fix

      Method setSort has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void setSort(String type) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
              if (type == null)
                  return;
              if (type.startsWith("client")) {
                  try {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 1 hr to fix

        Method writeObject has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
                s.defaultWriteObject();
        
                boolean written = false;
                if (_sortAsc instanceof TreeitemComparator) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 1 hr to fix

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

              public void setSortDirection(String sortDir) throws WrongValueException {
                  if (sortDir == null
                          || (!"ascending".equals(sortDir) && !"descending".equals(sortDir) && !"natural".equals(sortDir)))
                      throw new WrongValueException("Unknown sort direction: " + sortDir);
                  if (!Objects.equals(_sortDir, sortDir)) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Treecol.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

          Method doSort has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @SuppressWarnings("unchecked")
              /*package*/ boolean doSort(boolean ascending) {
                  final Comparator cmpr = ascending ? _sortAsc : _sortDsc;
                  if (cmpr == null)
                      return false;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 1 hr to fix

            Method doSort has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                @SuppressWarnings("unchecked")
                /*package*/ boolean doSort(boolean ascending) {
                    final Comparator cmpr = ascending ? _sortAsc : _sortDsc;
                    if (cmpr == null)
                        return false;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Treecol.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

            Method fixClone has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                private void fixClone() {
                    if (_sortAsc instanceof TreeitemComparator) {
                        final TreeitemComparator c = (TreeitemComparator) _sortAsc;
                        if (c.getTreecol() == this && c.isAscending())
                            _sortAsc = new TreeitemComparator(this, true, c.shallIgnoreCase());
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 45 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 sort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean sort(boolean ascending) {
                    final String dir = getSortDirection();
                    if (ascending) {
                        if ("ascending".equals(dir))
                            return false;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Treecol.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

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

                private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                    s.defaultReadObject();
            
                    boolean b = s.readBoolean();
                    if (b) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Treecol.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

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

                public void setSort(String type) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
                    if (type == null)
                        return;
                    if (type.startsWith("client")) {
                        try {
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 1 other location - About 6 hrs to fix
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 208..254

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

            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

                private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
                    s.defaultWriteObject();
            
                    boolean written = false;
                    if (_sortAsc instanceof TreeitemComparator) {
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 1 other location - About 4 hrs to fix
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 788..832

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

            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

                private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                    s.defaultReadObject();
            
                    boolean b = s.readBoolean();
                    if (b) {
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 1 other location - About 2 hrs to fix
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 834..856

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

            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 setSortDirection(String sortDir) throws WrongValueException {
                    if (sortDir == null
                            || (!"ascending".equals(sortDir) && !"descending".equals(sortDir) && !"natural".equals(sortDir)))
                        throw new WrongValueException("Unknown sort direction: " + sortDir);
                    if (!Objects.equals(_sortDir, sortDir)) {
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 2 other locations - About 2 hrs to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 127..141
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 149..163

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

            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

                protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
                    super.renderProperties(renderer);
            
                    if (!"none".equals(_sortDscNm))
                        render(renderer, "sortDescending", _sortDscNm);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 748..764

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

            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

                private void fixClone() {
                    if (_sortAsc instanceof TreeitemComparator) {
                        final TreeitemComparator c = (TreeitemComparator) _sortAsc;
                        if (c.getTreecol() == this && c.isAscending())
                            _sortAsc = new TreeitemComparator(this, true, c.shallIgnoreCase());
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 1 other location - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 773..784

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

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

                private Comparator<?> toComparator(String clsnm)
                        throws ClassNotFoundException, InstantiationException, IllegalAccessException {
                    if (clsnm == null || clsnm.length() == 0)
                        return null;
            
            
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 2 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 321..333
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 342..354

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

            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 setSortDescending(Comparator<?> sorter) {
                    if (!Objects.equals(_sortDsc, sorter)) {
                        _sortDsc = sorter;
                        _isCustomDscComparator = _sortDsc != null;
                        String nm = _isCustomDscComparator ? "fromServer" : "none";
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 5 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 254..264
            zul/src/main/java/org/zkoss/zul/Column.java on lines 297..307
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 275..285
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 318..328
            zul/src/main/java/org/zkoss/zul/Treecol.java on lines 233..243

            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

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

                public void setSortAscending(Comparator<?> sorter) {
                    if (!Objects.equals(_sortAsc, sorter)) {
                        _sortAsc = sorter;
                        _isCustomAscComparator = _sortAsc != null;
                        String nm = _isCustomAscComparator ? "fromServer" : "none";
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 5 other locations - About 1 hr to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 254..264
            zul/src/main/java/org/zkoss/zul/Column.java on lines 297..307
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 275..285
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 318..328
            zul/src/main/java/org/zkoss/zul/Treecol.java on lines 271..281

            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

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

                public void setSortAscending(String clsnm)
                        throws ClassNotFoundException, InstantiationException, IllegalAccessException {
                    if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortAscNm.equals(clsnm)) {
                        _sortAscNm = clsnm;
                        smartUpdate("sortAscending", clsnm);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 5 other locations - About 50 mins to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 269..276
            zul/src/main/java/org/zkoss/zul/Column.java on lines 312..319
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 333..340
            zul/src/main/java/org/zkoss/zul/Treecol.java on lines 287..294

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

            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 setSortDescending(String clsnm)
                        throws ClassNotFoundException, InstantiationException, IllegalAccessException {
                    if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortDscNm.equals(clsnm)) {
                        _sortDscNm = clsnm;
                        smartUpdate("sortDescending", clsnm);
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 5 other locations - About 50 mins to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 269..276
            zul/src/main/java/org/zkoss/zul/Column.java on lines 312..319
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 333..340
            zul/src/main/java/org/zkoss/zul/Treecol.java on lines 249..256

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

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

                public boolean sort(boolean ascending) {
                    final String dir = getSortDirection();
                    if (ascending) {
                        if ("ascending".equals(dir))
                            return false;
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 2 other locations - About 40 mins to fix
            zul/src/main/java/org/zkoss/zul/Column.java on lines 362..373
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 414..424

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

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

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

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

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

            Refactorings

            Further Reading

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

                public int getColumnIndex() {
                    int j = 0;
                    for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j)
                        if (it.next() == this)
                            break;
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 6 other locations - About 35 mins to fix
            zul/src/main/java/org/zkoss/zul/Footer.java on lines 57..63
            zul/src/main/java/org/zkoss/zul/Listcell.java on lines 86..92
            zul/src/main/java/org/zkoss/zul/Listfooter.java on lines 58..64
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 379..385
            zul/src/main/java/org/zkoss/zul/Treecell.java on lines 77..83
            zul/src/main/java/org/zkoss/zul/Treefooter.java on lines 58..64

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 47.

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

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

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

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

            Refactorings

            Further Reading

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

                public void setMaxlength(int maxlength) {
                    if (maxlength < 0)
                        maxlength = 0;
                    if (_maxlength != maxlength) {
                        _maxlength = maxlength;
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 6 other locations - About 35 mins to fix
            zul/src/main/java/org/zkoss/zul/Listbox.java on lines 789..796
            zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
            zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
            zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
            zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
            zul/src/main/java/org/zkoss/zul/Window.java on lines 322..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 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