Showing 4,841 of 7,782 total issues

Method checkInvalidateForMoved has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private void checkInvalidateForMoved(Component child, boolean bRemove) {
        //No need to invalidate if
        //1) act == last and child in act
        //2) act != last and child after act
        //Except removing last element which in act and act has only one element
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 1 hr 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 15 (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_OPEN)) {
            OpenEvent evt = OpenEvent.getOpenEvent(request);
            _open = evt.isOpen();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listgroup.java - About 1 hr 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 15 (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(ZulEvents.ON_COL_SIZE)) {
            disableClientUpdate(true); //ZK-4077
            try {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/HeadersElement.java - About 1 hr 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 render has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        /* package */@SuppressWarnings({ "unchecked", "rawtypes" })
        void render(Listitem item, int index) throws Throwable {
            if (item.isLoaded()) {
                return; // nothing to do
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 setMold has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMold(String mold) {
        final String old = getMold();
        if (!Objects.equals(old, mold)) {
            super.setMold(mold);
            // we have to change model before detaching paging,
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 init has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private void init() {
        _items = new AbstractSequentialList<Listitem>() {
            public ListIterator<Listitem> listIterator(int index) {
                return new ItemIter(index);
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr 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 setDisplayedTimeZones has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public void setDisplayedTimeZones(List<TimeZone> dtzones) {
        if (dtzones != null && dtzones.isEmpty())
            dtzones = null;
        if (_dtzones != dtzones) {
            _dtzones = dtzones;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.java - About 1 hr 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 getAvailableAtClient has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        public Set<? extends Component> getAvailableAtClient() {
            if (!isCropper())
                return null;

            final Tree tree = getTree();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treechildren.java - About 1 hr 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 _pfsend has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        export function _pfsend(dt: zk.Desktop, fetchOpts: RequestInit, completeOnly: boolean, forceAjax: boolean): void {
            var ws = !forceAjax && typeof zWs != 'undefined' && zWs.ready,
                fetchHeaders = fetchOpts.headers;
            if (!completeOnly) {
                var dtt = dt.id + '-' + pfIndex++ + '=' + Math.round(jq.now());
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - About 1 hr 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 vbox$mold$ has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function vbox$mold$(out) {
    let w;
    delete this._splitterKid;
    for (w = this.firstChild; w; w = w.nextSibling)
        if ((w instanceof zul.box.Splitter)) {
Severity: Minor
Found in zul/src/main/resources/web/js/zul/box/mold/vbox.js - About 1 hr 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 _posOffset has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function _posOffset(el: HTMLElement): zk.Offset {
    if (zk.webkit && el instanceof HTMLTableRowElement && el.cells.length)
        el = el.cells[0];

    var t = 0, l = 0;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - About 1 hr 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 format has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    format(msg: string, ...rest: (string|number)[]): string {
        var i = 0, sb = '';
        for (var j = 0, len = msg.length, cc, k: number; j < len; ++j) {
            cc = msg.charAt(j);
            if (cc == '\\') {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/fmt/msgfmt.ts - About 1 hr 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 setLoaded has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export function setLoaded(pkg: string, wait?: boolean): void { //internal
    _xloadings.$remove(pkg);
    _loading[pkg] = true;

    if (wait) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/pkg.ts - About 1 hr 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 getRichlet has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Richlet getRichlet(String name) {
        WaitLock lock = null;
        final Object[] info;
        for (;;) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 1 hr to fix

    Method doAfterCompose has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void doAfterCompose(final T comp) throws Exception {
            //ZK-3831
            if (comp.getPage() == null) {
                final Map<?, ?> currentArg = Executions.getCurrent().getArg();
                ((ComponentCtrl) comp).addCallback(ComponentCtrl.AFTER_PAGE_ATTACHED, new Callback() {
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.java - About 1 hr to fix

      Method addFormLoadBindings0 has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void addFormLoadBindings0(Component comp, String formId, String loadExpr, String[] beforeCmds,
                  String[] afterCmds, Map<String, Object> bindingArgs) {
              final boolean prompt = isPrompt(beforeCmds, afterCmds);
              final String attr = formId;
              final BindingExecutionInfoCollector collector = getBindingExecutionInfoCollector();
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

        Method doPropertyChange0 has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void doPropertyChange0(Object base, String prop, Set<LoadBinding> bindings) {
                Execution exec = Executions.getCurrent();
                Set<Component> skipCheckChildren = (Set<Component>) exec.getAttribute(HtmlShadowElement.SKIP_DISTRIBUTED_CHILDREN_PROPERTY_CHANGE);
                for (LoadBinding binding : bindings) {
                    //BUG 828, the sub-sequence binding might be removed after the previous loading.
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

          Function _preg_split has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _preg_split: function(a, b, c, d) {
                  c = c || 0;
                  d = d || "";
                  var e, g = [],
                      f = 0,
          Severity: Minor
          Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 1 hr to fix

            Function getFlexInfo has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    getFlexInfo(wgt: zk.Widget): { isFlexRow: boolean; flexContainerChildren: HTMLElement[]; childrenWidgets: zk.Widget[] } {
                        let pwgt = wgt.parent,
                            cwgt = pwgt!.firstChild,
                            fContainer = pwgt!.getFlexContainer_()!,
                            fcc = fContainer.firstElementChild as HTMLElement,
            Severity: Minor
            Found in zk/src/main/resources/web/js/zk/flex.ts - About 1 hr to fix

              Function running has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      running = function (orient: 'top' | 'left'): void {
                          var norient = zk.parseFloat(dg.node!.style[orient]),
                              diff = norient - zk.parseFloat(dg._epos!.style[orient]);
                          if (lastP == norient) {
                              lastS.push(dg._lastSteps);
              Severity: Minor
              Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language