Showing 4,841 of 7,782 total issues

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

    @Override
    public void onChildAdded(Component child) {
        super.onChildAdded(child);
        if (_disabled) {
            if (child instanceof Radio) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 (k >= len) { //no ending /
                                k = -1;
                                break;
                            }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (cc == '/') {
                                    hasEndingSlash = true;
                                    break; //ending / found
                                }
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 45 mins to fix

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

          public void setPageSize(int size) throws WrongValueException {
              if (size < 0) {
                  throw new WrongValueException("page size should >= 0");
              }
              
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/AbstractListModel.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 doSelectionChanged has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private void doSelectionChanged() {
              final Selectable<Object> smodel = getSelectableModel();
              if (smodel.isSelectionEmpty()) {
                  if (_jsel >= 0)
                      setSelectedItem(null);
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 newScale has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public DialModelScale newScale(double lowerBound, double upperBound, double startAngle, double extent,
                  double majorTickInterval, int minorTickCount) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/DialModel.java - About 45 mins to fix

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

            public boolean retainAll(Collection<?> c) {
                if (_set == c || this == c) { //special case
                    return false;
                }
                //bug #1819318 Problem while using SortedSet with Databinding
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/ListModelSet.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 setScale has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public void setScale(double lowerBound, double upperBound, double startAngle, double extent,
                    double majorTickInterval, int minorTickCount) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (offset > 0) {
                                      List groupsInfos = groupsListModel.getGroupsInfos();
                                      gindex += getGroupIndex(groupsInfos, offset) + 1;
                                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Group.java - About 45 mins to fix

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

                public static Button show(String message, String title, Button[] buttons, String icon, Button focus,
                        EventListener<ClickEvent> 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 (cc == '\\')
                                              ++k; //skip one
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 45 mins to fix

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

                    public void setSelectedIndex(int jsel) {
                        if (jsel < 0)
                            jsel = -1;
                        if (_jsel != jsel) {
                            if (jsel < 0) {
                Severity: Minor
                Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 isGroup) {
                        for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext();) {
                            int[] g = it.next();
                            if (isGroup) {
                                if (index == g[0])
                Severity: Minor
                Found in zul/src/main/java/org/zkoss/zul/Rows.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(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 (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

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

                        public boolean setVisible(boolean visible) {
                            if (isVisible() == visible)
                                return visible;
                    
                            final boolean result = super.setVisible(visible);
                    Severity: Minor
                    Found in zul/src/main/java/org/zkoss/zul/Listitem.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 (actpg > maxPageIndex) {
                                                p.setActivePage(maxPageIndex);
                                            }
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/Rows.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, 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
                          Severity
                          Category
                          Status
                          Source
                          Language