Showing 4,841 of 7,782 total issues

File LabelLoaderImpl.java has 341 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* LabelLoader.java

    Purpose:

    Description:

    StateCtx has 33 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class StateCtx<E, C, IN> {
        
        protected StateMachine<E, C, IN> _machine;
        
        // local properties //
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/fsm/StateCtx.java - About 4 hrs to fix

      F0011 has 33 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class F0011 extends BindComposer {
          private Date bday1;
          private Date bday2;
          private String value1;
          private String value2;
      Severity: Minor
      Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/F0011.java - About 4 hrs to fix

        ComponentIterator has 33 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class ComponentIterator implements Iterator<Component> {
        
            private final Page _page;
            private final Component _root;
            private final List<Selector> _selectorList;
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 4 hrs to fix

          Components has 33 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class Components {
              private static final Logger _zklog = LoggerFactory.getLogger("org.zkoss.zk.log");
          
              protected Components() {
              }
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 4 hrs to fix

            KeyFactory has 33 methods (exceeds 20 allowed). Consider refactoring.
            Open

            @SuppressWarnings("unchecked")
            class KeyFactory {
                static final Object NULL = new Comparable() {
                    public int compareTo(Object obj) {
                        return obj == this || obj == null ? 0 : 1;
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.java - About 4 hrs to fix

              AbstractListModel has 33 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public abstract class AbstractListModel<E>
                      implements ListModel<E>, Selectable<E>, java.io.Serializable, PageableModel {
              
                  private static final Logger log = LoggerFactory.getLogger(AbstractListModel.class);
              
              
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/AbstractListModel.java - About 4 hrs to fix

                Function matcherFromGroupMatchers has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                    var bySet = setMatchers.length > 0,
                        byElement = elementMatchers.length > 0,
                        superMatcher = function( seed, context, xml, results, outermost ) {
                            var elem, j, matcher,
                Severity: Major
                Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 4 hrs to fix

                  Method redraw has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void redraw(Writer out) throws java.io.IOException {
                          //Note: _tag == null can NOT be handled specially
                          final Execution exec = Executions.getCurrent();
                          final boolean root = getParent() == null && (getPage().isComplete()
                                  || (exec != null && "complete".equals(ExecutionsCtrl.getPageRedrawControl(exec))));
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java - About 4 hrs to fix

                    File ForEach.java has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      Method newElement has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private Element newElement(String nsURI, String tname)
                          throws SAXException {
                              if (nsURI == null) nsURI = "";
                      
                              final int j = tname.indexOf(':');
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 4 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 checkAdd has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                              private void checkAdd(Item newVal, Item other, boolean replace) {
                                  //allowed type?
                                  if (!(newVal instanceof Element) && !(newVal instanceof Text)
                                  && !(newVal instanceof CData) && !(newVal instanceof Comment)
                                  && !(newVal instanceof EntityReference) && !(newVal instanceof Binary)
                      Severity: Minor
                      Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractGroup.java - About 4 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 newInstance has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static ExpressionFactory newInstance(Properties properties) {
                              ExpressionFactory result = null;
                      
                              ClassLoader tccl = ClassUtil.getContextClassLoader(ExpressionFactory.class);
                      
                      Severity: Minor
                      Found in zel/src/main/java/org/zkoss/zel/ExpressionFactory.java - About 4 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 jj_3R_77 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private boolean jj_3R_77() {
                          Token xsp;
                          xsp = jj_scanpos;
                          if (jj_3_6()) {
                          jj_scanpos = xsp;
                      Severity: Minor
                      Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 4 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 parseConfigXml has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void parseConfigXml(Configuration config) {
                              boolean syscfgLoaded;
                              boolean syscfgLoadedConfig;
                              synchronized (ConfigParser.class) {
                                  syscfgLoaded = _syscfgLoaded;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 4 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 addPrologChild has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void addPrologChild(NodeInfo child) {
                              if (_prokids == null)
                                  _prokids = new LinkedList<NodeInfo>();
                      
                              // fix ZK-2622
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/NativeInfo.java - About 4 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 beforeChildAdded has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void beforeChildAdded(Component child, Component refChild) {
                              if (!(child instanceof ShadowElement))
                                  throw new UiException("Unsupported child for shadow element: " + child);
                              if (refChild != null && !(refChild instanceof ShadowElement))
                                  throw new UiException("Unsupported refChild for shadow element: " + refChild);
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 4 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 readObject has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
                              s.defaultReadObject();
                      
                              //read definition
                              Object def = s.readObject();
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 4 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 redraw has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public void redraw(Writer out) throws IOException {
                              String ctl;
                              final Execution exec = getExecution();
                              final boolean au = exec.isAsyncUpdate(null);
                              if (!au && !exec.isIncluded()
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 4 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 activate has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public boolean activate(long timeout) throws InterruptedException, DesktopUnavailableException {
                              final Thread curr = Thread.currentThread();
                              if (_active != null && _active.thread.equals(curr)) { //re-activate
                                  ++_active.nActive;
                                  return true;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/PollingServerPush.java - About 4 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