Showing 2,934 of 7,758 total issues

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

  private boolean jj_3R_69() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(51)) {
    jj_scanpos = xsp;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 9 other locations - About 35 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2088..2096
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2144..2152
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2559..2567
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2721..2729
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2731..2739
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2741..2749
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2767..2775
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2800..2808
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2820..2828

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

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

    @Init
    public void init() {
        loadCurrentItem();
        bunchTags = new LinkedHashSet<Tag>(3);
        bunchTags.add(new Tag("addAll1"));
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithList.java on lines 52..59
zktest/src/main/java/org/zkoss/zktest/test2/F96_ZK_4394_ListModelListVM.java on lines 31..38
zktest/src/main/java/org/zkoss/zktest/test2/F96_ZK_4394_ListModelSetVM.java on lines 36..43

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

  private boolean jj_3R_50() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(35)) {
    jj_scanpos = xsp;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 9 other locations - About 35 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2088..2096
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2144..2152
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2544..2552
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2559..2567
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2721..2729
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2731..2739
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2741..2749
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2767..2775
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2820..2828

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

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

    @Init
    public void init() {
        loadCurrentItem();
        bunchTags = new ListModelSet<Tag>(3);
        bunchTags.add(new Tag("addAll1"));
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithList.java on lines 52..59
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithSet.java on lines 55..62
zktest/src/main/java/org/zkoss/zktest/test2/F96_ZK_4394_ListModelListVM.java on lines 31..38

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

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

    @Init
    public void init() {
        loadCurrentItem();
        bunchTags = new ListModelList<Tag>(3);
        bunchTags.add(new Tag("addAll1"));
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithList.java on lines 52..59
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithSet.java on lines 55..62
zktest/src/main/java/org/zkoss/zktest/test2/F96_ZK_4394_ListModelSetVM.java on lines 36..43

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

  private boolean jj_3R_56() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(29)) {
    jj_scanpos = xsp;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 9 other locations - About 35 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2088..2096
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2144..2152
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2544..2552
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2559..2567
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2731..2739
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2741..2749
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2767..2775
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2800..2808
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2820..2828

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

  private boolean jj_3R_41() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(39)) {
    jj_scanpos = xsp;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 9 other locations - About 35 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2144..2152
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2544..2552
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2559..2567
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2721..2729
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2731..2739
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2741..2749
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2767..2775
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2800..2808
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2820..2828

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

  private boolean jj_3R_55() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(31)) {
    jj_scanpos = xsp;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 9 other locations - About 35 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2088..2096
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2144..2152
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2544..2552
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2559..2567
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2721..2729
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2741..2749
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2767..2775
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2800..2808
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2820..2828

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

  private boolean jj_3R_54() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(25)) {
    jj_scanpos = xsp;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 9 other locations - About 35 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2088..2096
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2144..2152
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2544..2552
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2559..2567
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2721..2729
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2731..2739
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2767..2775
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2800..2808
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2820..2828

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

    void doLoadAfter(Component comp, String command) {
        final List<LoadFormBinding> bindings = _loadFormAfterBindings.get(command);
        if (bindings != null) {
            for (LoadFormBinding binding : bindings) {
                doLoadBinding(comp, binding, command);
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 115..122
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 124..131
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 163..170

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

    public static final void setPreferredTimeZone(HttpSession hsess, TimeZone timezone) {
        if (timezone != null) {
            hsess.setAttribute(Attributes.PREFERRED_TIME_ZONE, timezone);
        } else {
            hsess.removeAttribute(Attributes.PREFERRED_TIME_ZONE);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java and 3 other locations - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java on lines 251..258
zweb/src/main/java/org/zkoss/web/servlet/Charsets.java on lines 242..249
zweb/src/main/java/org/zkoss/web/servlet/Charsets.java on lines 258..265

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

    void doInit(Component comp, BindingKey bkey) {
        final List<InitFormBinding> initBindings = _initFormBindings.get(bkey);
        if (initBindings != null) {
            for (InitFormBinding binding : initBindings) {
                doLoadBinding(comp, binding, null);
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 155..162
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 164..171
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 206..213

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

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

    private void postOnPagingInitRender() {
        if (getAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED) == null
                && getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) { // B50-ZK-345
            setAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED, Boolean.TRUE);
            Events.postEvent("onPagingInitRender", this, null);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2604..2610

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

    public static final void setPreferredTimeZone(ServletContext ctx, TimeZone timezone) {
        if (timezone != null) {
            ctx.setAttribute(Attributes.PREFERRED_TIME_ZONE, timezone);
        } else {
            ctx.removeAttribute(Attributes.PREFERRED_TIME_ZONE);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java and 3 other locations - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java on lines 235..242
zweb/src/main/java/org/zkoss/web/servlet/Charsets.java on lines 242..249
zweb/src/main/java/org/zkoss/web/servlet/Charsets.java on lines 258..265

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

    public static final void setPreferredLocale(HttpSession hsess, Locale locale) {
        if (locale != null) {
            hsess.setAttribute(Attributes.PREFERRED_LOCALE, locale);
        } else {
            hsess.removeAttribute(Attributes.PREFERRED_LOCALE);
Severity: Major
Found in zweb/src/main/java/org/zkoss/web/servlet/Charsets.java and 3 other locations - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java on lines 235..242
zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java on lines 251..258
zweb/src/main/java/org/zkoss/web/servlet/Charsets.java on lines 258..265

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

    void doLoadBefore(Component comp, String command) {
        final List<LoadFormBinding> bindings = _loadFormBeforeBindings.get(command);
        if (bindings != null) {
            for (LoadFormBinding binding : bindings) {
                doLoadBinding(comp, binding, command);
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 115..122
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 124..131
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 172..179

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

    void doInit(Component comp, BindingKey bkey) {
        final List<InitChildrenBinding> initBindings = _initBindings.get(bkey);
        if (initBindings != null) {
            for (InitChildrenBinding binding : initBindings) {
                doLoadBinding(comp, binding, null);
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 155..162
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 206..213
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 215..222

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

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

    private void postOnPagingInitRender() {
        if (getAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED) == null
                && getAttribute(ATTR_ON_INIT_RENDER_POSTED) == null) { // B50-ZK-345
            setAttribute(ATTR_ON_PAGING_INIT_RENDERER_POSTED, Boolean.TRUE);
            Events.postEvent("onPagingInitRender", this, null);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1098..1104

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

    void doLoadBefore(Component comp, String command) {
        final List<LoadChildrenBinding> bindings = _loadBeforeBindings.get(command);
        if (bindings != null) {
            for (LoadChildrenBinding binding : bindings) {
                doLoadBinding(comp, binding, command);
zkbind/src/main/java/org/zkoss/bind/impl/ChildrenBindingHandler.java on lines 124..131
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 163..170
zkbind/src/main/java/org/zkoss/bind/impl/FormBindingHandler.java on lines 172..179

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

    public static final void setPreferredLocale(ServletContext ctx, Locale locale) {
        if (locale != null) {
            ctx.setAttribute(Attributes.PREFERRED_LOCALE, locale);
        } else {
            ctx.removeAttribute(Attributes.PREFERRED_LOCALE);
Severity: Major
Found in zweb/src/main/java/org/zkoss/web/servlet/Charsets.java and 3 other locations - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java on lines 235..242
zk/src/main/java/org/zkoss/zk/ui/http/I18Ns.java on lines 251..258
zweb/src/main/java/org/zkoss/web/servlet/Charsets.java on lines 242..249

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

Severity
Category
Status
Source
Language