Showing 2,934 of 7,758 total issues

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

    @Init
    public void init() {
        books = new LinkedList<Book>();
        for (String[] book : BOOKS) {
            books.add(initBook(book[0], book[1], book[2]));
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/FormVM.java and 1 other location - About 50 mins to fix
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormProxyDirtyVM.java on lines 44..51

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

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

    public Object clone() {
        SimpleXYModel clone = (SimpleXYModel) super.clone();
        if (_seriesMap != null)
            clone._seriesMap = new HashMap<Comparable<?>, List<XYPair>>(_seriesMap);
        if (_seriesList != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleXYModel.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/SimpleSingleValueCategoryModel.java on lines 87..94

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

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

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

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

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

Refactorings

Further Reading

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

    @Init
    public void init() {
        list = new ArrayList<>();
        list.add("a");
        list.add("b");
zktest/src/main/java/org/zkoss/zktest/test2/F95_ZK_4552NestedMVVM.java on lines 32..41
zktest/src/main/java/org/zkoss/zktest/test2/F95_ZK_4552SyntaxVM.java on lines 31..40
zktest/src/main/java/org/zkoss/zktest/test2/F95_ZK_4624FocusVM.java on lines 30..39
zktest/src/main/java/org/zkoss/zktest/test2/F95_ZK_4624ScrollVM.java on lines 31..40

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

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

    public Object removeAttribute(String name, boolean recurse) {
        if (recurse && !hasAttribute(name)) {
            if (_wapp != null) {
                if (_wapp.hasAttribute(name, true))
                    return _wapp.removeAttribute(name, true);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 516..525

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

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

    @Init
    public void init() {
        books = new LinkedList<Book>();
        for (String[] book : BOOKS) {
            books.add(initBook(book[0], book[1], book[2]));
zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/FormVM.java on lines 29..36

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

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

    public Object clone() {
        SimpleSingleValueCategoryModel clone = (SimpleSingleValueCategoryModel) super.clone();
        if (_categoryList != null)
            clone._categoryList = new ArrayList<Comparable<?>>(_categoryList);
        if (_categoryMap != null)
zul/src/main/java/org/zkoss/zul/SimpleXYModel.java on lines 166..173

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

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

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

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

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

Refactorings

Further Reading

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

    public static <T extends Annotation> T getAnnotation(Class clazz, Class<T> annotationClass) {
        T anno = null;
        List<ViewModelAnnotationResolver> resolvers = getResolvers();
        for (ViewModelAnnotationResolver resolver : resolvers) {
            anno = resolver.getAnnotation(clazz, annotationClass);
zkbind/src/main/java/org/zkoss/bind/init/ViewModelAnnotationResolvers.java on lines 70..79

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

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

    @Listen("onClick=#addBeforeLast")
    public void addBeforeLast() {
        List<ShadowElement> roots = getSelf().getShadowRoots();
        HtmlShadowElement se = (HtmlShadowElement)roots.get(0);
        Label label = new Label();
zktest/src/main/java/org/zkoss/zktest/zats/zuti/composer/ShadowComposer.java on lines 120..127

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

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

    @SuppressWarnings("unchecked")
    public static <T> List<T> smartRead(ObjectInputStream s, List<T> col)
    throws IOException, ClassNotFoundException {
        for (;;) {
            final Object val = s.readObject();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/Serializables.java and 1 other location - About 50 mins to fix
zcommon/src/main/java/org/zkoss/io/Serializables.java on lines 120..131

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

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

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

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

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

Refactorings

Further Reading

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

    public int getGroupfootIndex() {
        final Rows rows = (Rows) getParent();
        if (rows != null) {
            int[] g = rows.getGroupsInfoAt(getIndex(), true);
            if (g != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Group.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Listgroup.java on lines 134..142

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

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

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

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

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

Refactorings

Further Reading

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

    public boolean isEffective(Evaluator eval, Page page) {
        return (_if == null || ((Boolean) _if.getValue(eval, page)).booleanValue())
                && (_unless == null || !((Boolean) _unless.getValue(eval, page)).booleanValue());
    }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/ConditionImpl.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/ConditionImpl.java on lines 78..81

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

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

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

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

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

Refactorings

Further Reading

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

    public static <T extends Annotation> T getAnnotation(Method method, Class<T> annotationClass) {
        T anno = null;
        List<ViewModelAnnotationResolver> resolvers = getResolvers();
        for (ViewModelAnnotationResolver resolver : resolvers) {
            anno = resolver.getAnnotation(method, annotationClass);
zkbind/src/main/java/org/zkoss/bind/init/ViewModelAnnotationResolvers.java on lines 89..98

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

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

    @SuppressWarnings("unchecked")
    public static <T> Collection<T> smartRead(ObjectInputStream s, Collection<T> col)
    throws IOException, ClassNotFoundException {
        for (;;) {
            final Object val = s.readObject();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/Serializables.java and 1 other location - About 50 mins to fix
zcommon/src/main/java/org/zkoss/io/Serializables.java on lines 139..150

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

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

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

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

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

Refactorings

Further Reading

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

    public boolean isEffective(Evaluator eval, Component comp) {
        return (_if == null || ((Boolean) _if.getValue(eval, comp)).booleanValue())
                && (_unless == null || !((Boolean) _unless.getValue(eval, comp)).booleanValue());
    }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/ConditionImpl.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/ConditionImpl.java on lines 89..92

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

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

    @Listen("onClick=#addBeforeFirst")
    public void addBeforeFirst() {
        List<ShadowElement> roots = getSelf().getShadowRoots();
        HtmlShadowElement se = (HtmlShadowElement)roots.get(0);
        Label label = new Label();
zktest/src/main/java/org/zkoss/zktest/zats/zuti/composer/ShadowComposer.java on lines 138..145

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

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

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

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

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

Refactorings

Further Reading

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

    public int getListgroupfootIndex() {
        final Listbox lb = (Listbox) getParent();
        if (lb != null) {
            int[] g = lb.getGroupsInfoAt(getIndex(), true);
            if (g != null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listgroup.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Group.java on lines 145..153

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

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

/* Ins.java

    Purpose:
        
    Description:
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Ins.java and 5 other locations - About 50 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/Base.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Canvas.java on lines 1..72
zhtml/src/main/java/org/zkoss/zhtml/Del.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Menu.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Progress.java on lines 1..71

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 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/Listheader.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 333..340
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 249..256
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

/* Canvas.java

    Purpose:
        
    Description:
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Canvas.java and 5 other locations - About 50 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/Base.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Del.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Ins.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Menu.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Progress.java on lines 1..71

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

/* Del.java

    Purpose:
        
    Description:
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Del.java and 5 other locations - About 50 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/Base.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Canvas.java on lines 1..72
zhtml/src/main/java/org/zkoss/zhtml/Ins.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Menu.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Progress.java on lines 1..71

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

Severity
Category
Status
Source
Language