Showing 7,775 of 7,775 total issues

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

    public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
        final String cmd = request.getCommand();
        if (cmd.equals(Events.ON_OPEN)) {
            OpenEvent evt = OpenEvent.getOpenEvent(request);
            _open = evt.isOpen();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Panel.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 (_open)
                            gmodel.addOpenGroup(gindex);
                        else
                            gmodel.removeOpenGroup(gindex);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Group.java - About 45 mins to fix

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

        public void close() {
            if (_selected) {
                final Tab tab = selectNextTab();
                if (tab != null) {
                    final Set<Tab> selItems = new HashSet<Tab>(2);
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Tab.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 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

    Avoid deeply nested control flow statements.
    Open

                                if (matcher.find()) {
                                    regexFlags = matcher.group(0).trim();
                                }
    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 == '\\')
                                      ++k; //skip one
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.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

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

              public void setLocalized(boolean localized) {
                  if (_localized != localized) {
                      if (localized && "instant".equals(_mode))
                          throw new UnsupportedOperationException("localized not supported in instant mode yet");
          
          
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Include.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

            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

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

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

                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

                  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

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language