Showing 4,841 of 7,782 total issues

Function bc_divide has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    bc_divide: function(a, b, c) {
        var d, e, g, f, h, k, l, m, n, q, s, p, r, t;
        if (libbcmath.bc_is_zero(b)) return -1;
        if (libbcmath.bc_is_zero(a)) return libbcmath.bc_new_num(1, c);
        0 === b.n_scale && 1 === b.n_len && 1 === b.n_value[0] && (d = libbcmath.bc_new_num(
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - 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 Column.java has 509 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Column.java

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

    File ComponentIterator.java has 507 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * 
     */
    package org.zkoss.zk.ui.select.impl;
    
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 1 day to fix

      Tabbox has 57 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class Tabbox extends XulElement {
          private transient Tabs _tabs;
          private transient Toolbar _toolbar;
          private transient Tabpanels _tabpanels;
          private transient Tab _seltab;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 1 day to fix

        File BindComposer.java has 506 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* BindComposer.java
        
            Purpose:
                
            Description:
        Severity: Major
        Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.java - About 1 day to fix

          Treeitem has 56 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class Treeitem extends XulElement implements org.zkoss.zk.ui.ext.Disable {
              private transient Treerow _treerow;
              private transient Treechildren _treechildren;
              private Object _value;
              private boolean _open = true;
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 1 day to fix

            Method init has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public void init(Component comp, Object viewModel, Map<String, Object> initArgs) {
                    if (_init)
                        throw new UiException("binder is already initialized");
                    _init = true;
            
            
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
                    final String cmd = request.getCommand();
                    if (cmd.equals(Events.ON_DATA_LOADING)) {
                        Events.postEvent(DataLoadingEvent.getDataLoadingEvent(request, preloadSize()));
                    } else if (inPagingMold() && cmd.equals(ZulEvents.ON_PAGE_SIZE)) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Grid.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 onTreeDataChange has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                private void onTreeDataChange(TreeDataEvent event) {
                    final int type = event.getType();
                    final int[] path = event.getPath();
                    final Component target = path != null ? getChildByPath(path) : null;
                    switch (type) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Tree.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 DHtmlUpdateServlet.java has 496 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* DHtmlUpdateServlet.java
            
                Purpose:
            
                Description:
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 7 hrs to fix

              File JavaScriptEscapeUtil.java has 494 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * =============================================================================
               * 
               *   Copyright (c) 2014, The UNBESCAPE team (http://www.unbescape.org)
               * 
              Severity: Minor
              Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java - About 7 hrs to fix

                PhantomExecution has 55 methods (exceeds 20 allowed). Consider refactoring.
                Open

                /*package*/ class PhantomExecution extends AbstractExecution {
                    private final SimpleScope _scope = new SimpleScope(this);
                    private boolean _voided;
                
                    public PhantomExecution(Desktop desktop) {
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/PhantomExecution.java - About 7 hrs to fix

                  File Https.java has 493 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* Https.java
                  
                      Purpose:
                      Description:
                      History:
                  Severity: Minor
                  Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java - About 7 hrs to fix

                    Method adjustInsertionForRemove has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private boolean adjustInsertionForRemove(HtmlShadowElement se, Component removed) {
                            Component old = null;
                            Direction direction = inRange(se, removed);
                            switch (direction) {
                            case PREVIOUS:
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 addPropertySaveBindings0 has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private void addPropertySaveBindings0(Component comp, String attr, String saveExpr, String[] beforeCmds,
                                String[] afterCmds, Map<String, Object> bindingArgs, String converterExpr,
                                Map<String, Object> converterArgs, String validatorExpr, Map<String, Object> validatorArgs) {
                            final boolean prompt = isPrompt(beforeCmds, afterCmds);
                            final BindingExecutionInfoCollector collector = getBindingExecutionInfoCollector();
                    Severity: Minor
                    Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 web0 has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private void web0(HttpServletRequest request, HttpServletResponse response, String pi, String ext)
                                throws ServletException, IOException {
                            if (ext != null) {
                                //Invoke the resource processor (Extendlet)
                                final Extendlet extlet = getExtendlet(ext);
                    Severity: Minor
                    Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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

                    Function _bc_do_compare has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _bc_do_compare: function(a, b, c, d) {
                            var e, g, f;
                            if (c && a.n_sign != b.n_sign) return a.n_sign == libbcmath.PLUS ? 1 : -1;
                            if (a.n_len != b.n_len) return a.n_len > b.n_len ? c && a.n_sign !=
                                libbcmath.PLUS ? -1 : 1 : c && a.n_sign != libbcmath.PLUS ? 1 : -1;
                    Severity: Minor
                    Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - 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 AbstractExecution.java has 487 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* AbstractExecution.java
                    
                        Purpose:
                            
                        Description:
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.java - About 7 hrs to fix

                      ComponentsCtrl has 54 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class ComponentsCtrl {
                          private static final ThreadLocal<Object> _compdef = new ThreadLocal<>();
                          private static final ThreadLocal<Component> _rootParent = new ThreadLocal<>();
                      
                          /** Returns the automatically generate component's UUID/ID.
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.java - About 7 hrs to fix

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

                            public boolean setVisible(boolean visible) {
                                final boolean old = super.setVisible(visible);
                                if (old != visible) {
                                    final String style = getStyle();
                                    if (visible) {
                        Severity: Minor
                        Found in zhtml/src/main/java/org/zkoss/zhtml/impl/AbstractTag.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

                        Severity
                        Category
                        Status
                        Source
                        Language