Showing 4,841 of 7,782 total issues

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

    public Object resolveVariable(String name) throws XelException {
        final RequestContext jc = RequestContexts.getCurrent();
        if (jc != null) {
            final VariableResolver parent = jc.getVariableResolver();
            if (parent != null)

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

        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 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 (m.getPageSize() > 0) { //min page size is 1
                                      pgi.setPageSize(m.getPageSize());
                                  } else {
                                      m.setPageSize(pgi.getPageSize());
                                  }
          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 (!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 remove has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      public boolean remove(Object o) {
                          //bug #1819318 Problem while using SortedSet with Databinding
                          if (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                              int index = indexOfAndRemove(o);
                              if (index < 0) {
              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

              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

                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

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

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

                          public String modifyPath(String path) throws UnsupportedEncodingException {
                              if (path.startsWith(ZVER)) {
                                  final int j = path.indexOf('/', ZVER.length());
                                  if (j >= 0)
                                      path = path.substring(j);
                      Severity: Minor
                      Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.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 (--depth < 0) {
                                                  nestedTo = j;
                                                  j = l;
                                                  break; //done
                                              }
                      Severity: Major
                      Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language