Showing 7,775 of 7,775 total issues

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

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

    Avoid deeply nested control flow statements.
    Open

                                if (!item.isDisabled() && item.isSelectable())
                                    curSeldItems.add(item);
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

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

          public static final void include(PortletContext ctx, RenderRequest request, RenderResponse response, String uri,
                  Map params, int mode) throws IOException, PortletException {
      Severity: Minor
      Found in zweb/src/main/java/org/zkoss/web/portlet/Portlets.java - About 45 mins to fix

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

            protected void fireEvent(int type, Comparable<?> series, Comparable<?> category, int seriesIndex, int categoryIndex,
                    Object data) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/AbstractChartModel.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/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

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

                public void onAfterRender() {
                    if (inPagingMold() && _model instanceof Pageable) {
                        Pageable m = (Pageable) _model;
                        if (m.getPageSize() > 0) { //min page size is 1
                            _pgi.setPageSize(m.getPageSize());
            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

                                    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

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

                      public boolean removeAll(Collection<?> c) {
                          if (_col == c || this == c) { //special case
                              clearSelection();
                              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

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

                  public static final void render(ServletContext ctx, HttpServletRequest request, HttpServletResponse response,
                          Richlet richlet, String path, Writer out) throws ServletException, IOException {
              Severity: Minor
              Found in zkplus/src/main/java/org/zkoss/zkplus/embed/Renders.java - About 45 mins to fix

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

                    private void getThreadLocals() {
                        for (Entry<String, String[]> me : _fieldsMap.entrySet()) {
                            final String clsName = me.getKey();
                            try {
                                final Class cls = Classes.forNameByThread(clsName);
                Severity: Minor
                Found in zkplus/src/main/java/org/zkoss/zkplus/util/ThreadLocalListener.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 locate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public URL locate(Locale locale) throws IOException {
                        boolean fallback = false;
                        String path;
                        if (_path != null) {
                            path = _path;
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/util/resource/ServletLabelLocator.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 box3 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static String box3(String styleName, String styleValue, String styleName2, String styleValue2,
                            String styleName3, String styleValue3) {
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/fn/ThemeFns.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 (_col == 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/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

                  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 volume) {
                  Severity: Minor
                  Found in zul/src/main/java/org/zkoss/zul/SimpleHiLoModel.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (!group.isOpen()) {
                                                addVisibleItemCount(isRemove ? group.getVisibleItemCount() : -group.getVisibleItemCount());
                                            }
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 45 mins to fix

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

                          public static final void render(ServletContext ctx, HttpServletRequest request, HttpServletResponse response,
                                  Component comp, String path, Writer out) throws ServletException, IOException {
                      Severity: Minor
                      Found in zkplus/src/main/java/org/zkoss/zkplus/embed/Renders.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/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