Showing 4,841 of 7,782 total issues

Method insertBefore has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component newChild, Component refChild) {
        if (newChild instanceof Rows) {
            if (super.insertBefore(newChild, refChild)) {
                _rows = (Rows) newChild;
                return true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 writeObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        s.defaultWriteObject();

        boolean written = false;
        if (_sortAsc instanceof ListitemComparator) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listheader.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 insertBefore has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component newChild, Component refChild) {
        if (newChild instanceof Treecols) {
            if (super.insertBefore(newChild, refChild)) {
                _treecols = (Treecols) newChild;
                return true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 writeObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        s.defaultWriteObject();

        boolean written = false;
        if (_sortAsc instanceof TreeitemComparator) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Treecol.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 beforeChildAdded has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public void beforeChildAdded(Component child, Component refChild) {
        if (!(child instanceof LayoutRegion))
            throw new UiException("Unsupported child for Borderlayout: " + child);
        if (child instanceof North) {
            if (_north != null && child != _north)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Borderlayout.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 addItemToSelection has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public void addItemToSelection(Listitem item) {
        if (item.getParent() != this)
            throw new UiException("Not a child: " + item);

        if (!item.isSelected()) {
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

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

function window$mold$(out, skipper) {
    var uuid = this.uuid,
        title = this.getTitle(),
        caption = this.caption,
        contentStyleHTML = zUtl.encodeXML(this.getContentStyle()),
Severity: Minor
Found in zul/src/main/resources/web/js/zul/wnd/mold/window.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 constructor has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

        constructor(opts: EffectFullMaskOptions) {
            super();
            opts = eff._skuOpts(opts);
            var mask = this.mask = jq(opts.mask || [], zk)[0];
            if (this.mask) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/effect.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 _startDrag has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    _startDrag(evt: zk.Event): void {
        zWatch.fire('onStartDrag', this, evt as unknown as zk.FireOptions);

        //disable selection
        zk(document.body).disableSelection(); // Bug #1820433
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.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 _draw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    _draw(point: zk.Offset, evt?: zk.Event): void {
        var node = this.node!,
            $node = zk(node),
            pos = $node.cmOffset(),
            opts = this.opts;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/drag.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 parse0 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static final Map
    parse0(Map map, String src, char pairSeparator, char separator, char quote, boolean asValue,
    boolean parenthesis, boolean multiple)
    throws IllegalSyntaxException {
        if (separator == (char)0)
Severity: Major
Found in zcommon/src/main/java/org/zkoss/util/Maps.java - About 3 hrs to fix

    Method lastIndexOf has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static final int lastIndexOf(Object o, Object element) {
            if (o instanceof String) {
                return element instanceof String ?
                    ((String)o).lastIndexOf((String)element): -1;
            } else if (o instanceof List) {
    Severity: Major
    Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java - About 3 hrs to fix

      Method jjMoveStringLiteralDfa0_1 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      private int jjMoveStringLiteralDfa0_1()
      {
         switch(curChar)
         {
            case 33:
      Severity: Major
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 3 hrs to fix

        Method jjMoveStringLiteralDfa0_2 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        private int jjMoveStringLiteralDfa0_2()
        {
           switch(curChar)
           {
              case 33:
        Severity: Major
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 3 hrs to fix

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

                  public void render(final Listitem item, final Object data, final int index) {
                      final Listbox listbox = (Listbox) item.getParent();
                      Template tm = listbox.getTemplate("model");
                      GroupingInfo info = null;
                      if (item instanceof Listgroup) {
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 3 hrs to fix

            File LabelImageElement.java has 295 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Method parseAction has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private static int parseAction(Context ctx, Node parent, String prefix, int from, int to)
                          throws DspException, IOException, XelException {
                      //1: which action
                      int j = skipWhitespaces(ctx, from + 1, to);
                      int k = nextSeparator(ctx, j, to);
              Severity: Major
              Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 3 hrs to fix

                Function d3_layout_packCircle has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function d3_layout_packCircle(nodes) {
                  var xMin = Infinity,
                      xMax = -Infinity,
                      yMin = Infinity,
                      yMax = -Infinity,
                Severity: Major
                Found in zktest/src/main/webapp/js/d3.layout.js - About 3 hrs to fix

                  Function send has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              send: function( headers, complete ) {
                                  var i,
                                      xhr = options.xhr();
                  
                                  xhr.open(
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 3 hrs to fix

                    Function syncSize has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        syncSize(opts?: Record<string, unknown>): void {
                            if (opts) {
                                this.opts = zk.copy(this.opts, opts);
                            }
                            this.edrag.style.display = '';
                    Severity: Major
                    Found in zul/src/main/resources/web/js/zul/WScroll.ts - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language