Showing 4,841 of 7,782 total issues

Method fixGroupsInfoAfterRemove has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixGroupsInfoAfterRemove(Row child, int index) {
        if (!_isReplacingRow) { //@see Grid.Renderer#render 
            //called by #removeChild, handling GroupInfo if !isReplcingRow
            if (child instanceof Group) {
                int[] prev = null, remove = null;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 6 hrs 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 doListDataChange has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    public void doListDataChange(ListDataEvent event) {
        if (INVALIDATE_THRESHOLD == -1) {
            INVALIDATE_THRESHOLD = Utils.getIntAttribute(this.getOwner(), "org.zkoss.zul.invalidateThreshold", 10,
                    true);
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 6 hrs 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 encodeURL0 has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    private static final String encodeURL0(ServletContext ctx, ServletRequest request, ServletResponse response,
            String uri) throws Exception {
        if (uri == null || uri.length() == 0)
            return uri; //keep as it is

Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Encodes.java - About 6 hrs 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

AbstractItem has 49 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class AbstractItem
implements Item, Node, Serializable, Cloneable {
    private static final long serialVersionUID = 20060622L;

    /** The parent. */
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractItem.java - About 6 hrs to fix

    Panel has 49 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Panel extends XulElement implements Framable {
        private Toolbar _tbar, _bbar, _fbar;
        private Panelchildren _panelchildren;
        private Caption _caption;
    
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Panel.java - About 6 hrs to fix

      ListModelList has 49 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class ListModelList<E> extends AbstractListModel<E> implements Sortable<E>, List<E>, java.io.Serializable {
          private static final long serialVersionUID = 20120206122641L;
      
          protected List<E> _list;
      
      
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/ListModelList.java - About 6 hrs to fix

        DateImpl has 49 functions (exceeds 20 allowed). Consider refactoring.
        Open

            export class DateImpl {
                /** @internal */
                _moment: Moment;
                /** @internal */
                _timezone: string;
        Severity: Minor
        Found in zk/src/main/resources/web/js/zk/dateImpl.ts - About 6 hrs to fix

          Method modifyAttrValueIfSimplified has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
          Open

              private static String modifyAttrValueIfSimplified(String attrName, String attrValue) {
                  boolean isCommand = attrValue.matches("@(global-)?command\\(.*\\)");
                  if (attrValue.matches("@\\(.*\\)") || isCommand) {
                      if (Events.isValid(attrName) || isCommand) {
                          int attrValueIndex = attrValue.indexOf("(") + 1;
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 6 hrs 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 addEventListener has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
          Open

              public boolean addEventListener(int priority, String evtnm, EventListener<? extends Event> listener) {
                  if (evtnm == null || listener == null)
                      throw new IllegalArgumentException("null");
                  if (!Events.isValid(evtnm))
                      throw new IllegalArgumentException("Invalid event name: " + evtnm);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 6 hrs 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 afterUnmarshal has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
          Open

              private void afterUnmarshal(int cnt, int cntSel) {
                  if (cnt != 0) {
                      for (Component child : getChildren()) {
                          if (child instanceof Treecols) {
                              _treecols = (Treecols) child;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 6 hrs 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 fixGroupsInfoAfterRemove has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
          Open

              private void fixGroupsInfoAfterRemove(Component child, int index) {
                  if (!_isReplacingItem) { //@see Renderer#render
                      //called by #removeChild(), handling GroupInfo if !isReplcingItem
                      if (child instanceof Listgroup) {
                          int[] prev = null, remove = null;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 6 hrs 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

          File ModelProvider.java has 446 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* ModelProvider.java
          
              Purpose:
                  
              Description:
          Severity: Minor
          Found in zktest/src/main/java/org/zkoss/zktest/util/ModelProvider.java - About 6 hrs to fix

            File ModelProvider.java has 446 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* ModelProvider.java
            
                Purpose:
                    
                Description:
            Severity: Minor
            Found in zksandbox/src/main/java/org/zkoss/zksandbox/ModelProvider.java - About 6 hrs to fix

              File Parser.java has 445 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* Parser.java
              
                  Purpose:
                      
                  Description:
              Severity: Minor
              Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 6 hrs to fix

                ELParserTokenManager has 48 methods (exceeds 20 allowed). Consider refactoring.
                Open

                @SuppressWarnings("all") // Ignore warnings in generated code
                public class ELParserTokenManager implements ELParserConstants
                {
                java.util.Deque<Integer> deque = new java.util.ArrayDeque<Integer>();
                
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 6 hrs to fix

                  ComponentInfo has 48 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class ComponentInfo extends ForEachBranchInfo {
                      private transient ComponentDefinition _compdef;
                      /** The implementation class/component (use). */
                      private ExValue _impl;
                      /** A list of {@link Property}, or null if no property at all. */
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/ComponentInfo.java - About 6 hrs to fix

                    TrackerImpl has 48 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class TrackerImpl implements Tracker, Serializable {
                        private static final long serialVersionUID = 1463169907348730644L;
                        protected Map<Component, Map<Object, TrackerNode>> _compMap; //comp -> path -> head TrackerNode
                        protected Map<Object, Set<TrackerNode>> _nullMap = new LinkedHashMap<Object, Set<TrackerNode>>(); //property -> Set of head TrackerNode that eval to null
                        protected transient Map<Object, Set<TrackerNode>> _beanMap = new WeakIdentityMap<Object, Set<TrackerNode>>(); //bean -> Set of TrackerNode
                    Severity: Minor
                    Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 6 hrs to fix

                      File Yylex.java has 444 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /* The following code was generated by JFlex 1.4.2 */
                      
                      package org.zkoss.json.parser;
                      
                      class Yylex {
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/json/parser/Yylex.java - About 6 hrs to fix

                        Method renderValue has 166 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private void renderValue(Object value) {
                                if (value == null || value instanceof String) {
                                    renderValue((String) value);
                                    return;
                                }
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java - About 6 hrs to fix

                          Method getPropertyDescriptors has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public PropertyDescriptor[] getPropertyDescriptors(BeanInfo beanInfo, Class<?> clazz) throws IntrospectionException {
                                  PropertyDescriptor[] introspectorPDsArray = beanInfo.getPropertyDescriptors();
                                  List<PropertyDescriptor> introspectorPDs = introspectorPDsArray != null ? Arrays.asList(introspectorPDsArray)
                                          : Collections.<PropertyDescriptor>emptyList();
                          
                          
                          Severity: Minor
                          Found in zel/src/main/java/org/zkoss/zel/ClassIntrospector.java - About 6 hrs 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