Showing 4,835 of 7,777 total issues

Method getMethod has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("null")
    public static Method getMethod(Object base, Object property,
            Class<?>[] paramTypes, Object[] paramValues)
            throws MethodNotFoundException {
        if (base == null || property == null) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 AbstractTreeModel.java has 684 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* AbstractTreeModel.java

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

    PageDefinition has 82 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class PageDefinition implements NodeInfo {
        /** A list of a children ({@link NodeInfo}). */
        private final List<NodeInfo> _children = new LinkedList<NodeInfo>();
        private final LanguageDefinition _langdef;
        private final Locator _locator;
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java - About 1 day to fix

      JQZK has 82 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class JQZK {
          /**
           * The associated instance of {@link JQZK.jq}, the object returned by `jq(...)`.
           */
          declare jq: JQuery;
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 day to fix

        File ConfigParser.java has 675 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          RenderHttpServletRequest has 81 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class RenderHttpServletRequest implements HttpServletRequest {
              private final RenderRequest _req;
              private final HttpServletRequest _hreq;
              private String _enc = "UTF-8";
              private final Map<String, String> _attrs = new HashMap<String, String>(8);

            ResourceHttpServletRequest has 81 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class ResourceHttpServletRequest implements HttpServletRequest {
                private final ResourceRequest _req;
                private final HttpServletRequest _hreq;
                private String _enc = "UTF-8";
                private final Map<String, String> _attrs = new HashMap<String, String>(8);

              Method assign0 has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void assign0(Component comp) throws Exception {
                      if (comp instanceof ComponentCtrl) {
                          ComponentCtrl ctrl = ((ComponentCtrl) comp);
                          PropertyAccess propertyAccess = ctrl.getPropertyAccess(_name);
                          if (propertyAccess != null) {
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.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 parseCst has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void parseCst(String constraint) {
                      String regex = null, errmsg = null, regexFlags = "";
                      l_out:
                      for (int j = 0, k = 0, len = constraint.length(); k >= 0; j = k + 1) {
                          for (; ; ++j) {
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.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

              Function applyCSSFlex has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
              Open

                      applyCSSFlex(this: zk.Widget): void {
                          const wgt = this;
                          if (!wgt._nvflex && !wgt._nhflex)
                              return;
              
              Severity: Minor
              Found in zk/src/main/resources/web/js/zk/flex.ts - 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 service has 295 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();
                      if (cmd.equals(Events.ON_DATA_LOADING)) {
                          if (_rod) {
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 day to fix

                Method parseShadowElement has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static NodeInfo parseShadowElement(PageDefinition pgdef, NodeInfo parent, Element el,
                            AnnotationHelper annHelper) throws Exception {
                        String ifc = null, unless = null, name = el.getLocalName();
                        AnnotationHelper attrAnnHelper = null;
                        final LanguageDefinition lookup = LanguageDefinition.lookup("xul/html");
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.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 execNewPage0 has a Cognitive Complexity of 73 (exceeds 5 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: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 ListModelMap.java has 642 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  File datefmt.ts has 642 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* datefmt.ts
                  
                      Purpose:
                  
                      Description:
                  Severity: Major
                  Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 1 day to fix

                    File drag.ts has 636 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* drag.ts
                    
                        Purpose:
                    
                        Description:
                    Severity: Major
                    Found in zk/src/main/resources/web/js/zk/drag.ts - About 1 day to fix

                      Method findWrapper has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @SuppressWarnings("null")
                          private static Wrapper findWrapper(Class<?> clazz, List<Wrapper> wrappers,
                                  String name, Class<?>[] paramTypes, Object[] paramValues) {
                      
                              Map<Wrapper,MatchResult> candidates = new HashMap<Wrapper,MatchResult>();
                      Severity: Minor
                      Found in zel/src/main/java/org/zkoss/zel/Util.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 outLangJavaScripts has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static final String outLangJavaScripts(Execution exec, WebApp wapp, String deviceType) {
                              if (exec.isAsyncUpdate(null) || exec.getAttribute(ATTR_LANG_JS_GENED) != null)
                                  return ""; //nothing to generate
                              exec.setAttribute(ATTR_LANG_JS_GENED, Boolean.TRUE);
                      
                      
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 onChange has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                      Open

                                      public void onChange(ListDataEvent event) {
                                          int type = event.getType();
                                          if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null
                                                  && (type == ListDataEvent.INTERVAL_ADDED || type == ListDataEvent.INTERVAL_REMOVED))
                                              return;
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Combobox.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 ELSupport.java has 631 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/impl/lang/ELSupport.java - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language