Showing 4,841 of 7,782 total issues

Method getComponent0 has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    private static final Component getComponent0(IdSpace is, String path) {
        Component found = null;
        for (int j = 0, k;; j = k + 1) {
            k = path.indexOf('/', j);

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Path.java - About 7 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 getNormalPath has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    public static String getNormalPath(String path) {
        final StringBuffer sb = new StringBuffer(path);
        final IntStack slashes = new IntStack(32); //most 32 slash in a path
        slashes.push(-1);
        int j = 0, colon = -100, dot1 = -100, dot2 = -100;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 7 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 BeanELResolver.java has 482 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: Minor
Found in zel/src/main/java/org/zkoss/zel/BeanELResolver.java - About 7 hrs to fix

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

        @SuppressWarnings({ "rawtypes", "unchecked" })
        public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
            final String cmd = request.getCommand();
            boolean isSelModel = _model instanceof Selectable;
            if (cmd.equals(Events.ON_SELECT)) {
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 7 hrs to fix

      PortletServletContext has 53 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class PortletServletContext implements ServletContext {
          private final PortletContext _ctx;
      
          /** Returns an instance of ServletContext that representing
           * the specified portlet context.
      Severity: Major
      Found in zweb/src/main/java/org/zkoss/web/portlet/PortletServletContext.java - About 7 hrs to fix

        File ListboxDataLoader.java has 477 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* ListboxDataLoader.java
        {{IS_NOTE
            Purpose:
        
            Description:
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 7 hrs to fix

          File Tabbox.java has 476 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Method getNativeContent has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

                private static final void getNativeContent(CreateInfo ci, StringBuffer sb, Component comp, List<NodeInfo> children,
                        Native.Helper helper) {
                    for (NodeInfo meta : children) {
                        if (meta instanceof NativeInfo) {
                            final NativeInfo childInfo = (NativeInfo) meta;
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 7 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

            AbstractTag has 52 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class AbstractTag extends AbstractComponent implements DynamicPropertied, RawId {
                static {
                    addClientEvent(AbstractTag.class, Events.ON_CLICK, 0);
                }
            
            
            Severity: Major
            Found in zhtml/src/main/java/org/zkoss/zhtml/impl/AbstractTag.java - About 7 hrs to fix

              ListModelArrayProxy has 52 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class ListModelArrayProxy<E> extends ListModelArray<E> implements Proxy, FormProxyObject, Serializable {
                  private static final Logger log = LoggerFactory.getLogger(ListModelArrayProxy.class);
                  private static final long serialVersionUID = 20210608113022L;
                  private ListModelArray<E> _cache;
                  private ListModelArray<E> _origin;
              Severity: Major
              Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelArrayProxy.java - About 7 hrs to fix

                Method toJSONString has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static String toJSONString(Object value){
                        if(value == null)
                            return "null";
                        
                        if(value instanceof String)
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/json/JSONValue.java - About 7 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 getMethod0 has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static Method getMethod0(Class<?> clazz, String methodName, Class<?>[] paramTypes, Object[] params) {
                        Method matchingMethod = null;
                        if (paramTypes != null) {
                            try {
                                matchingMethod = Util.getMethod(clazz, clazz.getMethod(methodName, paramTypes));
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/BeanELResolver.java - About 7 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 outPageContent has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static final void outPageContent(Execution exec, Page page, Writer out, boolean au) throws IOException {
                        final Desktop desktop = page.getDesktop();
                        final PageCtrl pageCtrl = (PageCtrl) page;
                        final Component owner = pageCtrl.getOwner();
                        boolean contained = owner == null && exec.isIncluded();
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 7 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 service has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    /*package*/ void service(Event event, Scope scope, final List<EventListenerInfo> listeners,
                            final EventHandler evthd, final Method mtd, boolean skipPageListener) throws Exception {
                        final Execution exec = Executions.getCurrent();
                        final Desktop desktop = exec.getDesktop();
                        final Page page = _page != null ? _page : desktop.getFirstPage();
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 7 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 entrySet has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    public Set<Map.Entry<K, V>> entrySet() {
                        if (this.entrySet == null) {
                            this.entrySet = new AbstractSet<Map.Entry<K, V>>() {
                                public Iterator<Map.Entry<K, V>> iterator() {
                                    return createHashIterator(ENTRIES);
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java - About 7 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 parseAction has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static int parseAction(Context ctx, Node parent, String prefix, int from, int to)
                            throws DspException, IOException, XelException {
                        //1: which action
                        int j = skipWhitespaces(ctx, from + 1, to);
                        int k = nextSeparator(ctx, j, to);
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 7 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 Compare has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  final public void Compare() throws ParseException {
                    Concatenation();
                    label_10:
                    while (true) {
                      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
                Severity: Major
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 7 hrs to fix

                  Method execNewPage0 has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void execNewPage0(final Execution exec, final PageDefinition pagedef, final Richlet richlet,
                              final Page page, final Writer out) throws IOException {
                          //Update the device type first. If this is the second page and not
                          //belonging to the same device type, an exception is thrown
                          final Desktop desktop = exec.getDesktop();
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 7 hrs to fix

                    File Maps.java has 468 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* Maps.java
                    
                    
                        Purpose: Utilities for Map
                        Description: 
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/util/Maps.java - About 7 hrs to fix

                      SAXHandler has 51 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class SAXHandler extends DefaultHandler
                      implements LexicalHandler, DeclHandler {
                          private static final Logger log = LoggerFactory.getLogger(SAXHandler.class);
                      
                          /** The iDOM factory. */
                      Severity: Major
                      Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 7 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language