Showing 4,841 of 7,782 total issues

File PropertyBindingHandler.java has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* PropertyBindingHelper.java

    Purpose:

    Description:
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/PropertyBindingHandler.java - About 2 hrs to fix

    Method renderProperties has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
            super.renderProperties(renderer);
    
            // ZK-4970: reset invalidateListitems here.
            Executions.getCurrent().removeAttribute("zkoss.Listbox.invalidateListitems" + getUuid());
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 2 hrs to fix

      Function typescript_build has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function typescript_build(src, dest, force, since, isSrcOnly/*fix gulp v5 issue*/) {
          const webpackConfig = require('./webpack.config.js');
          /** @type {import('vinyl-fs').SrcOptions} */
          const defaultSrcOptions = {
              root: src,
      Severity: Major
      Found in gulpfile.js - About 2 hrs to fix

        File AstValue.java has 289 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/impl/parser/AstValue.java - About 2 hrs to fix

          Method Math has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            final public void Math() throws ParseException {
              Multiplication();
              label_12:
              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 2 hrs to fix

            Method render has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void render(final Listitem item, final Object data, final int index) throws Exception {
                    final Listbox listbox = (Listbox) item.getParent();
                    final int size = listbox.getModel().getSize();
                    //B70-ZK-2555: in order to handle dynamic template name
                    final String subtype = item instanceof Listgroup ? "group" : item instanceof Listgroupfoot ? "groupfoot" : null;
            Severity: Major
            Found in zkbind/src/main/java/org/zkoss/bind/impl/BindListitemRenderer.java - About 2 hrs to fix

              Method group has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public boolean group(boolean ascending) {
                      final String dir = getSortDirection();
                      if (ascending) {
                          if ("ascending".equals(dir))
                              return false;
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Listheader.java - About 2 hrs to fix

                Function init has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    init: function(a, b, c) {
                        a = unescape(encodeURIComponent(a));
                        b = b || -1;
                        c = c || 2;
                        this.barcode_array = {};
                Severity: Major
                Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 2 hrs to fix

                  Function configFromStringAndFormat has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function configFromStringAndFormat(config) {
                          // TODO: Move this to another part of the creation flow to prevent circular deps
                          if (config._f === hooks.ISO_8601) {
                              configFromISO(config);
                              return;
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 2 hrs to fix

                    Method next has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static final Token
                        next(String src, String delimiters, int j, boolean whitespaceAware,
                        boolean parenthesis) {
                            final StringBuffer tksb = new StringBuffer(64);
                            final int len = src.length();
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/util/Maps.java - About 2 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 subtract has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static final long
                        subtract(Date date2, TimeZone tz, int field, Date date1) {
                            if (tz == null)
                                tz = TimeZones.getCurrent();
                    
                    
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/util/Dates.java - About 2 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 checkCharacterData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static final void checkCharacterData(String text, Locator loc) {
                            if (text == null)
                                throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
                                    "A null is not a legal XML value", loc);
                    
                    
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/idom/Verifier.java - About 2 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 match has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected static boolean match
                        (Namespaceable vtx, String namespace, String name, Pattern ptn, int mode) {
                            if (name != null) {
                                String val = (mode & FIND_BY_TAGNAME) != 0 ?
                                    vtx.getTagName(): vtx.getLocalName();
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractItem.java - About 2 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 formatStackTrace has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static final StringBuffer
                        formatStackTrace(StringBuffer sb, Throwable t, String prefix, int maxcnt) {
                            final StringWriter sw = new StringWriter();
                            t.printStackTrace(new PrintWriter(sw));
                            final StringBuffer trace = sw.getBuffer();
                    Severity: Minor
                    Found in zcommon/src/main/java/org/zkoss/lang/Exceptions.java - About 2 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 findShadowChildTemplate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static Template findShadowChildTemplate(HtmlShadowElement shadow, Component compBase, String name) {
                            List<ShadowElement> children = cast(shadow.getChildren());
                            if (!children.isEmpty()) {
                                Template t;
                                for (ShadowElement child : children) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/Templates.java - About 2 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 parseTemplate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static TemplateInfo parseTemplate(NodeInfo parent, Element el, AnnotationHelper annHelper)
                                throws Exception {
                            if (annHelper.clear())
                                log.warn(message("Annotations are ignored since <template> doesn't support them", el));
                            if (el.getAttributeItem("forEach") != null)
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 2 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 parseCustomAttributes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static void parseCustomAttributes(LanguageDefinition langdef, NodeInfo parent, Element el,
                                AnnotationHelper annHelper) throws Exception {
                            //if (!el.getElements().isEmpty())
                            //    throw new UiException(message("Child elements are not allowed for <custom-attributes>", el));
                    
                    
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 2 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 inRange has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static Direction inRange(HtmlShadowElement se, Component target) {
                            Component hostIfAny = se.getShadowHostIfAny();
                            Map<Component, Integer> oldCacheMap = se.getIndexCacheMap(hostIfAny);
                            final boolean destroyCacheMap = oldCacheMap == null;
                            try {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 2 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 fixAttrValues has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private Map<String, String[]> fixAttrValues(Map<?, ?> attrs) {
                            if (attrs == null)
                                return null;
                    
                            for (Map.Entry<?, ?> m0 : attrs.entrySet()) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 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 checkPageRemoved has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private void checkPageRemoved(Set<Component> removed) {
                            //1. scan once
                            final Desktop desktop = _exec.getDesktop();
                            Set<Page> pages = null;
                            for (Page page : desktop.getPages()) {
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 2 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

                    Severity
                    Category
                    Status
                    Source
                    Language