Showing 4,841 of 7,782 total issues

Method afterCompose has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public void afterCompose() {
        _afterComposed = true;
        fixModeOnly();
        if (_instantMode) {
            final Execution exec = getExecution();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Include.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 insertBefore has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component child, Component refChild) {
        final Grid grid = getGrid();
        final boolean isReorder = child.getParent() == this;
        //bug #3051305: Active Page not update when drag & drop item to the end
        if (isReorder) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.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 beforeChildAdded has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeChildAdded(Component child, Component refChild) {
        if (child instanceof Toolbar) {
            if (_toolbar != null && _toolbar != child)
                throw new UiException("Only one Toolbar is allowed: " + this);
            if (this.isVertical()) //ZK-4270: meaningful message to the developer indicating incorrect usage
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tabbox.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 addSelectionPaths has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean addSelectionPaths(int[][] paths) {
        boolean added = false;
        final int len = paths != null ? paths.length : 0;
        final boolean multiple = isMultiple();
        for (int j = 0; j < len; ++j)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.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 renderProperties has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
        super.renderProperties(renderer);

        render(renderer, "_value", marshall(_value));
        //ZK-658: we have to render the value before constraint
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.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 renderProperties has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
        super.renderProperties(renderer);
        if (!_btnVisible)
            renderer.render("buttonVisible", false);
        if (!_lenient)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Datebox.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 getValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        public Object getValue() {
            if (popupString != null) {
                return popupString;
            } else if (popup != null) {
                String uuidString = "uuid(" + popup.getUuid() + ")";
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.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 getItems has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public Collection<Treeitem> getItems() {
        return new AbstractCollection<Treeitem>() {
            public int size() {
                return getItemCount();
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treechildren.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 putAll has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public void putAll(Map<? extends K, ? extends V> c) {
        if (c == _map) //special case
            return;

        if (_map instanceof LinkedHashMap) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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 removeFromQueryString has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static final StringBuffer removeFromQueryString(StringBuffer sb, String name)
            throws UnsupportedEncodingException {
        name = encodeURIComponent(name);

        if (name == null || name.isEmpty())
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Encodes.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

Function _preg_split has a Cognitive Complexity of 16 (exceeds 5 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 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

Function _respSuccess has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        export function _respSuccess(response: Response, reqInf: AuRequestInfo, sid: string | number): boolean {
            if (sid && sid != zAu.seqId) {
                zAu._errCode = 'ZK-SID ' + (sid ? 'mismatch' : 'required');
                zAu.afterResponse(); //continue the pending request if any
                return true;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts - 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

Function rating$mold$ has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function rating$mold$(out) {

    var sclass = this.getIconSclass(),
        isVert = 'vertical' == this._orient;

Severity: Minor
Found in zul/src/main/resources/web/js/zul/wgt/mold/rating.js - 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

Function _getPkgs0 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function _getPkgs0(e: HTMLElement, pkgmap: Record<string, unknown>): void {
    var tn = e.tagName;
    if ('zk' != tn && 'attribute' != tn) {
        if (!zk.Widget.getClass(tn)) { //not register?
            var clsnm = zk.wgt.WidgetInfo.getClassName(tn);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/zuml/Parser.ts - 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

Function center has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    center(flags?: string): this {
        var el = this.jq[0],
            wdgap = this.offsetWidth(),
            hghgap = this.offsetHeight();

Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - 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

Function constructor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(control: zk.Object & {node?: HTMLElement} | undefined, node: HTMLElement | undefined, opts: DraggableOptions) {
        super();
        if (!_stackup) {
        //IE: if we don't insert stackup at beginning, dragging is slow
            _stackup = jq.newStackup(undefined, 'z_ddstkup');
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.ts - 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 Function has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  final public void Function() throws ParseException {
 /*@bgen(jjtree) Function */
    AstFunction jjtn000 = new AstFunction(JJTFUNCTION);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);Token t0 = null;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 hrs to fix

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

            @SuppressWarnings({ "rawtypes", "unchecked" })
            public void render(Treeitem treeItem, DefaultTreeNode<TestObject> treeNode, int id) throws Exception {
                treeItem.setValue(treeNode);
                Treerow tr;
                if (treeItem.getTreerow() == null) {
    Severity: Major
    Found in zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1766_Composer.java - About 2 hrs to fix

      Method addEventListener has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean addEventListener(int priority, String evtnm, EventListener<? extends Event> listener) {
              if (evtnm == null || listener == null)
                  throw new IllegalArgumentException("null");
              if (!Events.isValid(evtnm))
                  throw new IllegalArgumentException("Invalid event name: " + evtnm);
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 hrs to fix

        Method accept has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private void accept(final TypeCollector classVisitor) {
                    char[] c = new char[maxStringLength]; // buffer used to read strings
                    int i, j, k; // loop variables
                    int u, v, w; // indexes in b
        
        
          Severity
          Category
          Status
          Source
          Language