Showing 7,775 of 7,775 total issues

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

/* RowLabelComparator.java

{{IS_NOTE
    Purpose:
        
zksandbox/src/main/java/org/zkoss/zksandbox/RowLabelComparator.java on lines 1..42
zktest/src/main/java/org/zkoss/zktest/util/RowLabelComparator.java on lines 1..42

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

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

    Node createNode(String name,int children,int nested){
        Node n = new Node(name);
        if(nested>0){
            for(int i=0;i<children;i++){
                n.addChild(createNode(name+"_"+i,i==children-1?0:children,nested-1));
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenMenuVM.java on lines 27..35

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

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 (!shadowRoots.isEmpty()) {
            Map<Component, Integer> indexCacheMap = getIndexCacheMap(this);
            try {
                if (indexCacheMap == null) {
                    initIndexCacheMap(this);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 4079..4095

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

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 class B80_ZK_3104Object {
    private String name;

    public B80_ZK_3104Object() {
    }
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3104VM.java on lines 81..109

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

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 (!shadowRoots.isEmpty()) {
            Map<Component, Integer> indexCacheMap = getIndexCacheMap(this);
            try {
                if (indexCacheMap == null) {
                    initIndexCacheMap(this);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 4123..4139

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

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 Object convertToType(ELContext context, Object obj, Class<?> type) {
        context.setPropertyResolved(false);
        int sz = this.size;
        Object result = null;
        for (int i = 0; i < sz; i++) {
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/CompositeELResolver.java and 1 other location - About 1 hr to fix
zel/src/main/java/org/zkoss/zel/CompositeELResolver.java on lines 61..72

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

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 (comp.getPage() == null) {
            final Map<?, ?> currentArg = Executions.getCurrent().getArg();
            ((ComponentCtrl) comp).addCallback(ComponentCtrl.AFTER_PAGE_ATTACHED, new Callback() {
                public void call(Object data) {
                    try {
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.java and 1 other location - About 1 hr to fix
zkbind/src/main/java/org/zkoss/bind/BindComposer.java on lines 223..238

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

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 class Pojo {
        private String name;

        public Pojo() {
        }
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3104Object.java on lines 3..31

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

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 load has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static final boolean load(String flnm) {
        final InputStream strm = ContentTypes.class.getResourceAsStream(flnm);
        if (strm == null)
            return false;

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

    Method getDefaultTLDs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static final Map<String, URL> getDefaultTLDs() {
            Map<String, URL> defURLs = _defURLsRef.get();
            if (defURLs != null) {
                return defURLs;
            }
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/xel/taglib/Taglibs.java - About 1 hr to fix

      Method defaultResolveEntity has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected InputSource defaultResolveEntity(String publicId, String systemId)
          throws SAXException {
              if (systemId == null)
                  return null;
      
      
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 1 hr to fix

        Method nextToken has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static final Result nextToken(String src, int from,
            char[] separators, boolean escBackslash, boolean quotAsToken,
            boolean parenthesis)
            throws IllegalSyntaxException {
                final int len = src.length();
        Severity: Minor
        Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 1 hr to fix

          Method invoke has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @SuppressWarnings("null") // args[i] can't be null due to earlier checks
              public Object invoke(ELContext context, Object... args)
                      throws ELException {
          
                  if (context == null) {
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/LambdaExpression.java - About 1 hr to fix

            Method UpdateLineColumn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              protected void UpdateLineColumn(char c)
              {
                column++;
            
                if (prevCharIsLF)
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 1 hr to fix

              Method generateParseException has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public ParseException generateParseException() {
                  jj_expentries.clear();
                  boolean[] la1tokens = new boolean[62];
                  if (jj_kind >= 0) {
                    la1tokens[jj_kind] = true;
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr to fix

                Method getValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public Object getValue(ELContext context, Object base, Object property) {
                
                        if (context == null) {
                            throw new NullPointerException();
                        }
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/StaticFieldELResolver.java - About 1 hr to fix

                  Method treeSelect has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Command
                      public void treeSelect(
                              @ContextParam(ContextType.TRIGGER_EVENT) SelectEvent event) {
                  //        Clients.log("selection count before select "
                  //                + treeModel.getSelectionCount());

                    Method doAfterCompose has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @Override
                        public void doAfterCompose(final Component comp) throws Exception {
                            super.doAfterCompose(comp);
                    
                            button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {

                      Method serveResource has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException {
                              final WebManager webman = getWebManager();
                              final WebApp wapp = webman.getWebApp();
                      
                              final HttpServletRequest httpreq = ResourceHttpServletRequest.getInstance(request);
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.java - About 1 hr to fix

                        Method service has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public void service(AuRequest request, boolean everError) {
                                final String cmd = request.getCommand();
                                if (cmd.equals(Events.ON_CLICK) || cmd.equals(Events.ON_DOUBLE_CLICK) || cmd.equals(Events.ON_RIGHT_CLICK)
                                        || cmd.equals(Events.ON_MOUSE_OVER) || cmd.equals(Events.ON_MOUSE_OUT)) {
                                    Events.postEvent(MouseEvent.getMouseEvent(request));
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language