Showing 4,841 of 7,782 total issues

Method compare has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public int compare(Object o1, Object o2) {
        final int index = _index < 0 && _treecol != null ? _treecol.getColumnIndex() : _index;

        Object v1, v2;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/TreeitemComparator.java - About 3 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 a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public int compare(Object o1, Object o2) {
        final int index = _index < 0 && _header != null ? _header.getColumnIndex() : _index;

        Object v1, v2;
        if (o1 instanceof Listitem) { //not live data
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListitemComparator.java - About 3 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 removeChild has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeChild(Component child) {
        if (_paging == child && _pgi == child && inPagingMold())
            throw new IllegalStateException(
                    "The paging component cannot be removed manually. It is removed automatically when changing the mold");
        // Feature 1906110: prevent developers from removing it accidently
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 3 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 include has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public void include(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException {
        try {
            // B60-ZK-1337: issues with RenderHttpServletRequest/RenderHttpServletResponse Wrapper
            //   will cause ServletException: Original SevletRequest or wrapped original ServletRequest
            //       not passed to RequestDispatcher in violation of SRV.8.2 and SRV.14.2.5.1

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 parseControl has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private static int parseControl(Context ctx, Node parent, int from, int to)
            throws DspException, IOException, XelException {
        int j = from + 2;
        if (j + 1 >= to)
            throw new DspException(MWeb.DSP_ACTION_NOT_TERMINATED, new Object[] { null, new Integer(ctx.nLines) });
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 3 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 getInputSequences has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    getInputSequences: function(a) {
        var b = [],
            c = [],
            c = a.match(/([0-9]{13,44})/g);
        if (null == c) c = [];
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 3 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 _respFailure has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

        export function _respFailure(response: Response, reqInf: AuRequestInfo, rstatus: number): boolean {
            var eru = zAu._errURIs['' + rstatus];
            if (typeof eru == 'string') {
                zUtl.go(eru);
                return true;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 3 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 filterTextStyle has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    filterTextStyle(style: Record<string, string> | string, plus?: string[]): Record<string, string> | string {
        if (typeof style == 'string') {
            let ts = '';
            if (style)
                for (var j = 0, k = 0; k >= 0; j = k + 1) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 3 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 _cmOffset has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function _cmOffset(el: HTMLElement): zk.Offset {
    var t = 0, l = 0, operaBug;
    //Fix gecko difference, the offset of gecko excludes its border-width when its CSS position is relative or absolute
    if (zk.gecko) {
        var p = el.parentElement;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 3 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 outLocaleJavaScript has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static final String outLocaleJavaScript() {
        final StringBuffer sb = new StringBuffer(1024).append("zk.$default(msgzul, {");

        addLocaleJS(sb, "VALUE_NOT_MATCHED", MZul.VALUE_NOT_MATCHED);
        addLocaleJS(sb, "EMPTY_NOT_ALLOWED", MZul.EMPTY_NOT_ALLOWED);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/Utils.java - About 3 hrs to fix

    Function addCombinator has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function addCombinator( matcher, combinator, base, selector/* Jumper Chen, Potix, 20130509*/) {
        var dir = combinator.dir,
            skip = combinator.next,
            key = skip || dir,
            checkNonElements = base && key === "parentNode",
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 3 hrs to fix

      Function transit has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        $.fn.transition = $.fn.transit = function(properties, duration, easing, callback) {
          var self  = this;
          var delay = 0;
          var queue = true;
      
      
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/ext/jquery.transit.js - About 3 hrs to fix

        Function starteffect has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function starteffect(dg: zk.Draggable): void {
            var ctrl = dg.control as unknown as zul.WScroll,
                opts = ctrl.opts;
        
            dg._steps = opts.startStep;
        Severity: Major
        Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 3 hrs to fix

          File Devices.java has 314 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* Devices.java
          
              Purpose:
                  
              Description:
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/device/Devices.java - About 3 hrs to fix

            Method process has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void process(Session sess, HttpServletRequest request, HttpServletResponse response, boolean compress)
                        throws ServletException, IOException {
                    final String errClient = request.getHeader("ZK-Error-Report");
                    if (errClient != null)
                        if (log.isDebugEnabled())
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 3 hrs to fix

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

                  @SuppressWarnings("unchecked")
                  public void render(final Component owner, final Object data, final int index, final int size,
                          final boolean isListModel) {
                      final Template tm = resolveTemplate(owner, owner, data, index, size, "children");
                      if (tm == null) {
              Severity: Major
              Found in zkbind/src/main/java/org/zkoss/bind/impl/BindChildRenderer.java - About 3 hrs to fix

                File anima.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* anima.ts
                
                    Purpose:
                
                    Description:
                Severity: Minor
                Found in zk/src/main/resources/web/js/zk/anima.ts - About 3 hrs to fix

                  PageCtrl has 29 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public interface PageCtrl {
                      /** Pre-initializes this page.
                       * It initializes {@link org.zkoss.zk.ui.Page#getDesktop},
                       * but it doesn't add this page to the desktop yet
                       * (which is done by {@link #init}).
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/sys/PageCtrl.java - About 3 hrs to fix

                    BindELContext has 29 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class BindELContext extends XelELContext {
                        public BindELContext(XelContext xelc) {
                            super(xelc);
                        }
                    
                    
                    Severity: Minor
                    Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.java - About 3 hrs to fix

                      DialModel has 29 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class DialModel extends AbstractChartModel {
                          private static final long serialVersionUID = 20091008183229L;
                      
                          private List<DialModelScale> _series = new ArrayList<DialModelScale>(4);
                      
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/DialModel.java - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language