Showing 4,841 of 7,782 total issues

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

    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) child)) {
                                    all.add((E) child);
                                }
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.java - About 45 mins to fix

      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

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

              public void setText(String value) throws WrongValueException {
                  if (_auxinf != null && _auxinf.maxlength > 0 && value != null && value.length() > _auxinf.maxlength)
                      throw new WrongValueException(this, MZul.STRING_TOO_LONG, new Integer(_auxinf.maxlength));
          
                  final Object val = coerceFromString(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 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 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 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

            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 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 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

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

                  protected void validate(Object value) throws WrongValueException {
                      final Constraint constr = getConstraint();
                      if (constr != null) { //then _auxinf must be non-null
                          //Bug 1698190: constructor might be zscript
                          Scopes.beforeInterpret(this);
              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 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

              Avoid deeply nested control flow statements.
              Open

                                      if (m.getActivePage() >= 0) { //min page index is 0
                                          pgi.setActivePage(m.getActivePage());
                                      } else {
                                          m.setActivePage(pgi.getActivePage());
                                      }
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

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

                  Avoid deeply nested control flow statements.
                  Open

                                          if (hds != null) {
                                              for (Component listheader : hds.getChildren()) {
                                                  ((Listheader) listheader).setSortDirection("natural");
                                              }
                                          }
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

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

                            public boolean removeAll(Collection<?> c) {
                                if (_set == c || this == c) { //special case
                                    clear();
                                    return true;
                                }
                    Severity: Minor
                    Found in zul/src/main/java/org/zkoss/zul/ListModelMap.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