Showing 4,841 of 7,782 total issues

Method doGet has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        final String pi = Https.getThisPathInfo(request);
        final ServletContext ctx = getServletContext();
        if (DHtmlResourceServlet.doGet0(request, response, ctx, getClassWebResource()))
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 2 hrs to fix

    Method load has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @SuppressWarnings("unchecked")
        public void load(BindContext ctx) {
            final Component comp = getComponent(); //ctx.getComponent();
            final BindEvaluatorX eval = getBinder().getEvaluatorX();
            final BindingExecutionInfoCollector collector = ((BinderCtrl) getBinder()).getBindingExecutionInfoCollector();
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/impl/LoadChildrenBindingImpl.java - About 2 hrs to fix

      Method parseCst has 61 lines of code (exceeds 25 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: Major
      Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 2 hrs to fix

        Method doListDataChange has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void doListDataChange(ListDataEvent event) {
                if (INVALIDATE_THRESHOLD == -1) {
                    INVALIDATE_THRESHOLD = Utils.getIntAttribute(this.getOwner(), "org.zkoss.zul.invalidateThreshold", 10,
                            true);
                }
        Severity: Major
        Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java - About 2 hrs to fix

          Method getNormalPath has 61 lines of code (exceeds 25 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: Major
          Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 2 hrs to fix

            Function createDuration has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function createDuration(input, key) {
                    var duration = input,
                        // matching against regexp is expensive, do it on demand
                        match = null,
                        sign,
            Severity: Major
            Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 2 hrs to fix

              Function grid$mold$ has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function grid$mold$(out) {
                  let uuid = this.uuid,
                      innerWidth = zUtl.encodeXML(this.getInnerWidth()),
                      wdAttr = innerWidth === '100%' ? ' width="100%"' : '', //bug#3183182
                      wdStyle = innerWidth !== '100%' ? 'width:' + innerWidth : '',
              Severity: Major
              Found in zul/src/main/resources/web/js/zul/grid/mold/grid.js - About 2 hrs to fix

                Function configFromArray has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function configFromArray(config) {
                        var i,
                            date,
                            input = [],
                            currentDate,
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 2 hrs to fix

                  Function zkInitCrashTimer has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  window.zkInitCrashTimer = setTimeout(function () {
                      var zkErrorCode,
                          z_runonce = document.querySelectorAll('.z-runonce')[0],
                          zk_proc = document.getElementById('zk_proc'),
                          ztemp = document.querySelectorAll('.z-temp')[0],
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/crashmsg.ts - About 2 hrs to fix

                    Function create has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        create(context) {
                            function checkTypeSyntax(node: TSESTree.TSTypeAnnotation | TSESTree.TSTypeAssertion | TSESTree.TSAsExpression) {
                                if (node.typeAnnotation.type === AST_NODE_TYPES.TSNullKeyword) {
                                    context.report({
                                        node: node,
                    Severity: Major
                    Found in eslint-plugin-zk/src/rules/noNull.ts - About 2 hrs to fix

                      File LayoutRegion.java has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

                        Method toStringBuffer has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static final StringBuffer
                            toStringBuffer(StringBuffer sb, Map<? super String, ? super String> map, char quote, char separator, char pairSeparator) {
                                if (separator == (char)0)
                                    throw new IllegalArgumentException("Separator cannot be 0");
                                if (map.isEmpty())
                        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 setup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void setup(String name, String format, String ctype) {
                                if (ctype != null && !Boolean.parseBoolean(Library.getProperty("org.zkoss.zul.Filedownload.contentTypeAsIs"))) {
                                    int j = ctype.indexOf(';');
                                    if (j >= 0) ctype = ctype.substring(0, j);
                                }
                        Severity: Minor
                        Found in zcommon/src/main/java/org/zkoss/util/media/AMedia.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 run has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                                public void run() {
                                    boolean disconnect=false;
                                    while (!disconnect) {
                                        try {
                                            if(updating) {
                        Severity: Minor
                        Found in zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1739_Composer.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 parseLibProperty has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static void parseLibProperty(Element el) {
                                final String nm = IDOMs.getRequiredElementValue(el, "name");
                                Element valueElmn = el.getElement("value");
                                Element appendableElmn = el.getElement("appendable");
                                boolean appendable = appendableElmn != null ? "true".equals(appendableElmn.getText(true)) : false;
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.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 writeAppInfo has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void writeAppInfo(RequestContext reqctx, OutputStream out, WebApp wapp) throws IOException, ServletException {
                                final String verInfoEnabled = Library.getProperty("org.zkoss.zk.ui.versionInfo.enabled", "true");
                                final boolean exposeVer = "true".equals(verInfoEnabled);
                                final StringBuffer sb = new StringBuffer(256);
                                if (exposeVer)
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.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 preInit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public void preInit(Page page) {
                                page.addClassResolver(_clsresolver);
                        
                                page.addFunctionMapper(getTaglibMapper());
                        
                        
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.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 evalProperties has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public Map<String, Object> evalProperties(Map<String, Object> propmap, Page owner, Component parent,
                                    boolean defIncluded) {
                                if (defIncluded)
                                    propmap = _compdef.evalProperties(propmap, owner, parent);
                                else if (propmap == null)
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.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 setDefinition has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public void setDefinition(String name) {
                                final Execution exec = Executions.getCurrent();
                                if (exec != null) {
                                    final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
                                    final PageDefinition pgdef = execCtrl.getCurrentPageDefinition();
                        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 hasAttributeOrFellow has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public boolean hasAttributeOrFellow(String name, boolean recurse) {
                                if (hasAttribute(name) || (this instanceof IdSpace && hasFellow(name)))
                                    return true;
                        
                                if (recurse) {
                        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

                        Severity
                        Category
                        Status
                        Source
                        Language