Showing 7,767 of 7,767 total issues

ListModelListProxy has 70 methods (exceeds 20 allowed). Consider refactoring.
Open

public class ListModelListProxy<E> extends ListModelList<E> implements Proxy, FormProxyObject, Serializable {
    private static final long serialVersionUID = 20210608113022L;
    private ListModelList<E> _cache;
    private ListModelList<E> _origin;
    private boolean _dirty;
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelListProxy.java - About 1 day to fix

    Function ajax has 257 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ajax: function( url, options ) {
    
            // If url is an object, simulate pre-1.5 signature
            if ( typeof url === "object" ) {
                options = url;
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 day to fix

      File Chart.java has 592 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* Chart.java
      
          Purpose:
              
          Description:
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/Chart.java - About 1 day to fix

        ExecutionImpl has 69 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class ExecutionImpl extends AbstractExecution {
            private final ServletContext _ctx;
            private final HttpServletRequest _request;
            private final HttpServletResponse _response;
            private final RequestContext _xelctx;
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/http/ExecutionImpl.java - About 1 day to fix

          File KeyFactory.java has 589 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           *  Copyright 2004 Brian S O'Neill
           *
           *  Licensed under the Apache License, Version 2.0 (the "License");
           *  you may not use this file except in compliance with the License.
          Severity: Major
          Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 1 day to fix

            Method addTracking has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
            Open

                protected void addTracking(List<String> series) {
                    final Binding binding = _ctx.getBinding();
                    final boolean dotracker = !_ctx.ignoreTracker();
            
                    if (binding != null && series != null && !series.isEmpty()) {

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function parseDate has 252 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                parseDate(
                    txt: string,
                    fmt: string,
                    nonLenient?: boolean,
                    refval?: DateImpl,
            Severity: Major
            Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 1 day to fix

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

              function bcsub(a, b, c) {
                  "undefined" == typeof c && (c = libbcmath.scale);
                  c = 0 > c ? 0 : c;
                  libbcmath.bc_init_num();
                  libbcmath.bc_init_num();
              Severity: Major
              Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js and 2 other locations - About 1 day to fix
              zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 413..426
              zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 476..489

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

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

              function bcadd(a, b, c) {
                  "undefined" == typeof c && (c = libbcmath.scale);
                  c = 0 > c ? 0 : c;
                  libbcmath.bc_init_num();
                  libbcmath.bc_init_num();
              Severity: Major
              Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js and 2 other locations - About 1 day to fix
              zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 428..441
              zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 476..489

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

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

              function bcmul(a, b, c) {
                  "undefined" == typeof c && (c = libbcmath.scale);
                  c = 0 > c ? 0 : c;
                  libbcmath.bc_init_num();
                  libbcmath.bc_init_num();
              Severity: Major
              Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js and 2 other locations - About 1 day to fix
              zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 413..426
              zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 428..441

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

              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

              File Util.java has 580 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Licensed to the Apache Software Foundation (ASF) under one or more
               * contributor license agreements.  See the NOTICE file distributed with
               * this work for additional information regarding copyright ownership.
               * The ASF licenses this file to You under the Apache License, Version 2.0
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 day to fix

                Method wireOthers has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void wireOthers(Object x) {
                        //check methods
                        final Class cls = _controller.getClass();
                        Method[] mtds = cls.getMethods();
                        for (int j = 0; j < mtds.length; ++j) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 1 day to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method syncModel has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void syncModel(int offset, int limit) {
                        int min = offset;
                        int max = offset + limit - 1;
                
                        final ListModel model = _grid.getModel();
                Severity: Minor
                Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java - About 1 day to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                File HtmlBasedComponent.java has 575 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* HtmlBasedComponent.java
                
                    Purpose:
                
                    Description:
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 day to fix

                  Method Assignment has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                  Open

                    final public void Assignment() throws ParseException {
                      if (jj_2_2(4)) {
                        LambdaExpression();
                      } else {
                        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 day to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method fillShadowElement has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private JSONObject fillShadowElement(HtmlShadowElement se, AbstractComponent current, ListIterator<AbstractComponent> cit) {
                          String name = se.toString();
                          int index = name.lastIndexOf("->");
                          if (index > 0)
                              name = name.substring(index + 2);

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method getResponses has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public List<AuResponse> getResponses(Collection<Component> renderedComps) throws IOException {
                          _ending = true; //no more modifying UI (invalidate/addSmartUpdate...)
                  
                          /*        if (log.finerable())
                                      log.finer("ei: "+this+"\nInvalidated: "+_invalidated+"\nSmart Upd: "+_smartUpdated
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 1 day to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  File BSHInterpreter.java has 572 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* BSHInterpreter.java
                  
                      Purpose:
                          
                      Description:
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.java - About 1 day to fix

                    File Element.java has 569 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* Element.java
                    
                    
                        Purpose:
                        Description:
                    Severity: Major
                    Found in zcommon/src/main/java/org/zkoss/idom/Element.java - About 1 day to fix

                      Method parse has 240 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private Object parse(RequestContext reqctx, InputStream is, String path) throws Exception {
                              final Element root = new SAXBuilder(true, false, true).build(is).getRootElement();
                              final String name = IDOMs.getRequiredAttributeValue(root, "name");
                              if (name.length() == 0)
                                  throw new UiException("The name attribute must be specified, " + root.getLocator() + ", " + path);
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language