Showing 2,934 of 7,758 total issues

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

    public B00690ClusterEnv() {
        items = new ArrayList<Item>();
        items.add(selected = new Item("A"));
        items.add(new Item("B"));
        items.add(new Item("C"));
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00869Serialization.java on lines 50..57

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

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

                if (e.get() == null) {
                    this.modCount.incrementAndGet();
                    if (prev != null) {
                        prev.next = e.next;
                    } else {
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 215..224
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 196..205
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 248..257
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 279..288
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 372..381
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 418..427

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/collection/C1.java on lines 66..80
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 39..53
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va07.java on lines 34..48
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 68..82

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

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

            if (entryKey == null) {
                // Clean up after a cleared Reference.
                this.modCount.incrementAndGet();
                if (prev != null) {
                    prev.next = e.next;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 215..224
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 196..205
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 248..257
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 308..316
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 372..381
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 418..427

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

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

            if (entryKey == null) {
                // Clean up after a cleared Reference.
                this.modCount.incrementAndGet();
                if (prev != null) {
                    prev.next = e.next;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 215..224
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 196..205
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 248..257
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 279..288
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 308..316
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 372..381

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/collection/C1.java on lines 66..80
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 39..53
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va07.java on lines 34..48
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 101..115

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/collection/C1.java on lines 66..80
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 39..53
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va07.java on lines 34..48
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 101..115
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 68..82

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

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

                    if (e.get() == null) {
                        // Clean up after a cleared Reference.
                        this.modCount.incrementAndGet();
                        if (prev != null) {
                            prev.next = e.next;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 196..205
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 248..257
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 279..288
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 308..316
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 372..381
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 418..427

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

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

            if (entryKey == null) {
                // Clean up after a cleared Reference.
                this.modCount.incrementAndGet();
                if (prev != null) {
                    prev.next = e.next;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 215..224
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 196..205
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 279..288
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 308..316
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 372..381
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 418..427

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 39..53
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va07.java on lines 34..48
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 101..115
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 68..82

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

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

                    if (e.get() == null) {
                        // Clean up after a cleared Reference.
                        this.modCount.incrementAndGet();
                        if (prev != null) {
                            prev.next = e.next;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 215..224
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 248..257
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 279..288
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 308..316
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 372..381
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 418..427

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

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

            if (entryKey == null) {
                // Clean up after a cleared Reference.
                this.modCount.incrementAndGet();
                if (prev != null) {
                    prev.next = e.next;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java and 6 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 215..224
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 196..205
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 248..257
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 279..288
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 308..316
zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java on lines 418..427

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/collection/C1.java on lines 66..80
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va07.java on lines 34..48
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 101..115
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 68..82

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/collection/C1.java on lines 66..80
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 39..53
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va07.java on lines 34..48
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 101..115
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 68..82

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

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 class NonNegativeValidator implements Validator {

        public void validate(ValidationContext ctx) {
            
            if (ctx.getProperty().getValue() instanceof Integer){
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/collection/C1.java on lines 66..80
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 39..53
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va05.java on lines 38..52
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 101..115
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 68..82

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

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

        if (cls == null) {
            _sesscache = new SimpleSessionCache();
        } else {
            try {
                _sesscache = (SessionCache) cls.newInstance();
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 3 other locations - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 138..146
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 149..157
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 160..168

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

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

        if (cls == null) {
            _factory = new SimpleUiFactory();
        } else {
            try {
                _factory = (UiFactory) cls.newInstance();
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 3 other locations - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 138..146
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 149..157
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 188..196

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

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

        if (cls == null) {
            _engine = new UiEngineImpl();
        } else {
            try {
                _engine = (UiEngine) cls.newInstance();
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 3 other locations - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 149..157
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 160..168
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 188..196

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

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

        if (cls == null) {
            _provider = new SessionDesktopCacheProvider();
        } else {
            try {
                _provider = (DesktopCacheProvider) cls.newInstance();
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 3 other locations - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 138..146
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 160..168
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 188..196

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

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

        return _sessScope = new AttributesMap() {
            @SuppressWarnings("unchecked")
            protected Enumeration<String> getKeys() {
                return sess.getAttributeNames();
            }
zweb/src/main/java/org/zkoss/web/servlet/xel/RequestXelResolver.java on lines 276..293

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

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

Severity
Category
Status
Source
Language