Showing 4,841 of 7,782 total issues

Executions has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Executions {
    /** Stores the current {@link Execution}. */
    protected static final ThreadLocal<Execution> _exec = new ThreadLocal<Execution>();

    /** Returns the current execution.
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java - About 5 hrs to fix

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

        public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Exception {
            try {
                final String mname = method.getName();
                if (mname.equals("hashCode")) {
                    int a = (_origin != null) ? (Integer) method.invoke(_origin, args) : 0;
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/proxy/BeanProxyHandler.java - About 5 hrs to fix

      WeakIdentityMap has 38 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @SuppressWarnings("unchecked")
      public class WeakIdentityMap<K, V> extends AbstractMap<K, V> implements Map<K, V> {
          // Types of Iterators
          static final int KEYS = 0;
          static final int VALUES = 1;
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java - About 5 hrs to fix

        ListboxDataLoader has 38 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class ListboxDataLoader implements DataLoader, Cropper { //no need to serialize since Listbox assumes it
            private Listbox _listbox;
        
            //--DataLoader--//
            public void init(Component owner, int offset, int limit) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 5 hrs to fix

          File AbstractGroup.java has 373 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* AbstractGroup.java
          
          
              Purpose:
              Description:
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractGroup.java - About 4 hrs to fix

            File MainLayout.java has 373 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* MainLayout.java
            
            {{IS_NOTE
                Purpose:
                    
            Severity: Minor
            Found in zktest/src/main/java/org/zkoss/zktest/test2/MainLayout.java - About 4 hrs to fix

              File Selectbox.java has 372 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* Selectbox.java
              
                  Purpose:
                      
                  Description:
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Selectbox.java - About 4 hrs to fix

                Method renderBegin has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void renderBegin(Component comp, Map clientEvents, String specialRendererOutput,
                            boolean lookup) {
                        if (_2ndChild.isEmpty())
                            _jsout.append("zkx(");
                        else if (_2ndChild.get(0) == Boolean.TRUE)
                Severity: Minor
                Found in zhtml/src/main/java/org/zkoss/zhtml/impl/TagRenderContext.java - About 4 hrs 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 SetData has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void SetData() throws ParseException {
                                          /*@bgen(jjtree) SetData */
                  AstSetData jjtn000 = new AstSetData(JJTSETDATA);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 ListData has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void ListData() throws ParseException {
                                            /*@bgen(jjtree) ListData */
                  AstListData jjtn000 = new AstListData(JJTLISTDATA);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 LambdaExpressionOrInvocation has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void LambdaExpressionOrInvocation() throws ParseException {
                                                                         /*@bgen(jjtree) LambdaExpression */
                  AstLambdaExpression jjtn000 = new AstLambdaExpression(JJTLAMBDAEXPRESSION);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 MethodParameters has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void MethodParameters() throws ParseException {
                                                             /*@bgen(jjtree) MethodParameters */
                  AstMethodParameters jjtn000 = new AstMethodParameters(JJTMETHODPARAMETERS);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 MapData has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                  final public void MapData() throws ParseException {
                                          /*@bgen(jjtree) MapData */
                  AstMapData jjtn000 = new AstMapData(JJTMAPDATA);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 hrs 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 fillShadowHost has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    private JSONObject fillShadowHost(Component host) {
                        JSONObject rootData = fillComponentOnly(host);
                        JSONArray childrenArray = new JSONArray();
                        rootData.put("children", childrenArray);
                        List<AbstractComponent> children = host.getChildren();

                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 afterProcessEvent has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void afterProcessEvent(Event event) throws Exception {
                        _eis.afterProcessEvent(event);
                        _wapp.getConfiguration().afterProcessEvent(event);
                
                        if (Events.ON_DESKTOP_RECYCLE.equals(event.getName())) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 4 hrs 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 doFinally has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                        public void doFinally() {
                            Throwable t = null;
                            if (_sysinitEx)
                                for (int j = 0; j < _sysinits.length; ++j) {
                                    final Initiator init = _sysinits[j];
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java - About 4 hrs 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 getFromNamespace has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected Object getFromNamespace(String name) {
                        final Scope scope = getCurrent();
                        if (scope != null) { //null means no scope allowed!
                            final Execution exec = Executions.getCurrent();
                            if (exec != null && exec != scope) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/scripting/util/GenericInterpreter.java - About 4 hrs 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 locate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                Open

                    @SuppressWarnings("unchecked")
                    public static final String locate(ServletContext ctx, ServletRequest request, String pgpath, Locator locator)
                            throws ServletException {
                        if (pgpath == null)
                            return pgpath;
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 4 hrs 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 AbstractTag.java has 371 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* AbstractTag.java
                
                    Purpose:
                
                    Description:
                Severity: Minor
                Found in zhtml/src/main/java/org/zkoss/zhtml/impl/AbstractTag.java - About 4 hrs to fix

                  File CommonFns.java has 370 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* CommonFns.java
                  
                      Purpose:
                  
                      Description:
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language