Showing 7,775 of 7,775 total issues

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

package org.zkoss.zktest.test2;

public class B70_ZK_2463_Head {
    private String title;
    private int colspan;
zktest/src/main/java/org/zkoss/zktest/bind/advance/MyObject.java on lines 1..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 80.

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

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

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

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

Refactorings

Further Reading

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

/* MyObject.java

        Purpose:
        
        Description:
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2463_Head.java on lines 1..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

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

        } else if (child instanceof Tabs) {
            if (_tabs != null && _tabs != child)
                throw new UiException("Only one tabs is allowed: " + this);
        } else if (child instanceof Tabpanels) {
            if (_tabpanels != null && _tabpanels != child)
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 490..498

Duplicated Code

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

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

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

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

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

        } else if (child instanceof Tabpanels) {
            if (super.insertBefore(child, refChild)) {
                _tabpanels = (Tabpanels) child;
                return true;
            }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 503..516

Duplicated Code

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

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

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

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

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

    public void redraw(java.io.Writer out) throws java.io.IOException {
        final StringWriter bufout = new StringWriter();
        super.redraw(bufout);

        final StringBuffer buf = bufout.getBuffer();
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Body.java and 1 other location - About 1 hr to fix
zhtml/src/main/java/org/zkoss/zhtml/Head.java on lines 46..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 80.

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

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

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

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

Refactorings

Further Reading

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

        if (child instanceof Treerow) {
            if (super.insertBefore(child, refChild)) {
                _treerow = (Treerow) child;
                return true;
            }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 653..666

Duplicated Code

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

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

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

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

Method checkCompDenpendency has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static void checkCompDenpendency(XMLResource xr, Map<String, XMLResource> rcmap, String elName) {
        if (xr.depends.size() > 0) {
            return;
        }

Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/resource/ClassLocator.java - About 1 hr to fix

    Method toContents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @SuppressWarnings("unchecked")
        public static final Object toContents(Object obj) {
            if (obj instanceof Collection) {
                Collection c = (Collection)obj;
                boolean cvted = false;
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/idom/util/IDOMs.java - About 1 hr to fix

      Method isIdentifier has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static boolean isIdentifier(String key) {
      
              if (SKIP_IDENTIFIER_CHECK) {
                  return true;
              }
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/util/Validation.java - About 1 hr to fix

        Method removeRichlet0 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private Object removeRichlet0(String name) {
                if (name == null) {
                    throw new IllegalArgumentException("Name is required");
                }
                Object o;
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr to fix

          Method process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void process(Session sess, HttpServletRequest request, HttpServletResponse response, PageDefinition pagedef,
                      String path) throws ServletException, IOException {
                  final WebApp wapp = sess.getWebApp();
                  final WebAppCtrl wappc = (WebAppCtrl) wapp;
          
          
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/http/ZumlExtendlet.java - About 1 hr to fix

            Method parseContent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static final ZScript parseContent(String content, int lineno) {
                    String prefix = null, zslang = null;
                    final int len = content != null ? content.length() : 0;
                    if (len > 0) {
                        //Don't generate prefix if content is empty (i.e., keep empty)
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ZScript.java - About 1 hr to fix

              Method getCache has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @SuppressWarnings("unchecked")
                  private static final ResourceCache<PageDefinition> getCache(WebApp wapp) {
                      ResourceCache<PageDefinition> cache = (ResourceCache<PageDefinition>) wapp.getAttribute(ATTR_PAGE_CACHE);
                      if (cache == null) {
                          synchronized (PageDefinitions.class) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinitions.java - About 1 hr to fix

                Method getIndex has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static int getIndex(ShadowElement owner, Component insertion, Map<Component, Integer> cacheMap) {
                        if (insertion == null)
                            return -1;
                        if (insertion.getParent() == null) {
                            if (owner == null) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 1 hr to fix

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

                      private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
                          s.defaultWriteObject();
                  
                          s.writeObject(_langdef != null ? _langdef.getName() : null);
                          s.writeObject(_owner != null ? _owner.getUuid() : null);
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 1 hr to fix

                    Method setBindingArgs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public void setBindingArgs(final Map<String, Object> bindingArgs) {
                            this._bindingArgs = bindingArgs;
                            _paramResolvers.put(BindingParam.class, new ParamResolver<Annotation>() {
                                public Object resolveParameter(Annotation anno, Class<?> returnType, Supplier<String> parameterName) {
                                    Object val = bindingArgs.get(getAnnotatedParameterName(BindingParam.class, ((BindingParam) anno).value(), parameterName));
                    Severity: Minor
                    Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.java - About 1 hr to fix

                      Method parseTemplate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private ExpressionAnnoInfo parseTemplate(Component comp, String propName) {
                              final Collection<Annotation> annos = ((ComponentCtrl) comp).getAnnotations(propName, TEMPLATE_ANNO);
                              if (annos.size() == 0)
                                  return null;
                              if (annos.size() > 1) {
                      Severity: Minor
                      Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.java - About 1 hr to fix

                        Method parseValidator has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private ExpressionAnnoInfo parseValidator(Component comp, String propName) {
                                final Collection<Annotation> annos = ((ComponentCtrl) comp).getAnnotations(propName, VALIDATOR_ANNO);
                                if (annos.size() == 0)
                                    return null;
                                if (annos.size() > 1) {
                        Severity: Minor
                        Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.java - About 1 hr to fix

                          Method removeBindings0 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void removeBindings0(Component comp) {
                                  checkInit();
                                  if (_rootComp == comp) {
                                      //the binder component was detached, unregister queue
                                      unsubscribeQueue(_quename, _quescope, _queueListener);
                          Severity: Minor
                          Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

                            Method parseConverter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private ExpressionAnnoInfo parseConverter(Component comp, String propName) {
                                    final Collection<Annotation> annos = ((ComponentCtrl) comp).getAnnotations(propName, CONVERTER_ANNO);
                                    if (annos.size() == 0)
                                        return null;
                                    if (annos.size() > 1) {
                            Severity: Minor
                            Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.java - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language