Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                        if (g[2] != -1)
                            g[2] += (infront ? 1 : -1);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 45 mins to fix

    Method validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public void validate(Component comp, Object value) throws WrongValueException {
            super.validate(comp, value);
            if (value instanceof Double) {
                final Double doubleValue = (Double) value;
    
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/SimpleDoubleSpinnerConstraint.java - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                                if (isSelectable((E) group)) {
                                    all.add((E) group);
                                }
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.java - About 45 mins to fix

      Method fixClone has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private void fixClone() {
              if (_sortAsc instanceof TreeitemComparator) {
                  final TreeitemComparator c = (TreeitemComparator) _sortAsc;
                  if (c.getTreecol() == this && c.isAscending())
                      _sortAsc = new TreeitemComparator(this, true, c.shallIgnoreCase());
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Treecol.java - About 45 mins 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 show has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static int show(int messageCode, int titleCode, int buttons, String icon, int focus,
                  EventListener<Event> listener) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Messagebox.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (isSelectable((E) child)) {
                                        all.add((E) child);
                                    }
        Severity: Major
        Found in zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.java - About 45 mins to fix

          Method show has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static int show(int messageCode, Object[] args, int titleCode, int buttons, String icon, int focus) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Messagebox.java - About 45 mins to fix

            Method show has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static int show(int messageCode, Object arg, int titleCode, int buttons, String icon, int focus) {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Messagebox.java - About 45 mins to fix

              Method show has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static int show(String message, String title, int buttons, String icon, int focus,
                          EventListener<Event> listener) {
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Messagebox.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (actpg > maxPageIndex) {
                                            p.setActivePage(maxPageIndex);
                                        }
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (realIndex >= 0 && realIndex < getChildren().size())
                                              removeChild(getChildren().get(realIndex));
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for (int j = 0, len = g.getItemCount(); j < len; j++)
                                                item = item.getNextSibling();
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 45 mins to fix

                      Method addValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public void addValue(Date date, Number open, Number high, Number low, Number close, Number volumn);
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/HiLoModel.java - About 45 mins to fix

                        Method invalidateListitems has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void invalidateListitems() {
                                //Bug 3147518: avoid memory leak
                                //Also better performance (outer better than remove a lot)
                                final Execution execution = Executions.getCurrent();
                                final String uuid = _listbox.getUuid();
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 45 mins 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 checkInvalidateForMoved has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void checkInvalidateForMoved(Listitem 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 elem which in act and act has only one elem
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins 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 onEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                                public void onEvent(Event event) {
                                    if (_model != null && inPagingMold()) {
                                        final Paginal pgi = getPaginal();
                                        int pgsz = pgi.getPageSize();
                                        int ofs = pgi.getActivePage() * pgsz;
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins 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 setValueByClient has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void setValueByClient(Object value, String valstr) {
                                if (_auxinf != null && _auxinf.maxlength > 0 && valstr != null && valstr.length() > _auxinf.maxlength)
                                    throw new WrongValueException(this, MZul.STRING_TOO_LONG, new Integer(_auxinf.maxlength));
                        
                                final boolean same = Objects.equals(_value, value);
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.java - About 45 mins 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 fixRefChildBeforeFoot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private Component fixRefChildBeforeFoot(Component refChild) {
                                if (refChild == null) {
                                    if (_listfoot != null)
                                        refChild = _listfoot;
                                    else if (_frozen != null)
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins 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 clone has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            @SuppressWarnings("unchecked")
                            public Object clone() {
                                GroupsModelArray clone = (GroupsModelArray) super.clone();
                                if (_nativedata != null)
                                    clone._nativedata = ArraysX.duplicate(_nativedata);
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/GroupsModelArray.java - About 45 mins 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 getGroupsInfoAt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            /* package */int[] getGroupsInfoAt(int index, boolean isListgroup) {
                                for (int[] g : _groupsInfo) {
                                    if (isListgroup) {
                                        if (index == g[0])
                                            return g;
                        Severity: Minor
                        Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins 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