Showing 4,841 of 7,782 total issues

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

    private void addAttribute(ComponentInfo compInfo, Namespace attrns, String name, String value, ConditionImpl cond,
            org.zkoss.xml.Locator xl) throws Exception {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (cc == ',') {
                                sb.append(cc);
                                modifiedCommandPropertySb.append(modifyAttrValueIfSimplified0(nm, sb.toString().trim(), paramIndex, isNamedParam));
                                if (paramIndex != 0 && !isNamedParam && nm != null) { // named param and un-named parameters together
                                    throwCommandSimplifiedErrorUsage();
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

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

          @Override
          protected void updateSubBindingAnnotationCount(int diff) {
              for (AbstractComponent node = this; node != null;) {
                  setSubBindingAnnotationCount(diff, node);
                  AbstractComponent p = (AbstractComponent) node.getParent();
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 isShadowElement has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private static final boolean isShadowElement(LanguageDefinition langdef, PageDefinition pgdef, String nm,
                  String pref, String uri, boolean bNativeContent) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (langnm.substring(0, j).equals(name))
                                        return me.getValue();
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                          if (nsParser.isMatched(attURI)) {
                                              if (nsParser.parse(attr, compInfo, pgdef)) {
                                                  handled = true;
                                                  break;
                                              }
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

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

                public static Composer getComposer(Component comp) {
                    if (comp != null) {
                        Object onm = comp.getAttribute("composerName");
                        if (onm instanceof String && ((String) onm).length() > 0) {
                            return (Composer) comp.getAttribute((String) onm);
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/Components.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 applyAttrAnnot has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private static void applyAttrAnnot(AnnotationHelper attrAnnHelper, ComponentInfo compInfo, String nm, String val,
                        boolean selfAllowed, org.zkoss.util.resource.Location loc) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (tis.isEmpty()) { //no more event
                                          _auxinf.forwards.remove(orgEvent);
                                          removeEventListener(orgEvent, info.listener);
                                      }
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (val == null)
                                                continue; //don't use it in clone
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (shadowHost.getParent() != null) {
                                                  return ((AbstractComponent) shadowHost.getParent()).getShadowVariable0(shadowHost, name,
                                                          recurse);
                                              }
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

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

                        public void setMold(String mold) {
                            if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0))
                                mold = null;
                            if (!Objects.equals(_auxinf != null ? _auxinf.mold : DEFAULT, mold)) {
                                if (!_def.hasMold(mold != null ? mold : DEFAULT))
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 (desktop != null) {
                                                onListenerChange(desktop, false);
                    
                                                if (getClientEvents().containsKey(evtnm)) {
                                                    if (lis.isEmpty() && !Events.isListened(this, evtnm, false))
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

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

                          private static void checkIdSpacesDown(Component comp, IdSpace owner) {
                              final String compId = comp.getId();
                              if (!(comp instanceof NonFellow) && !isAutoId(compId)
                                      && (owner instanceof Component
                                              ? ((AbstractComponent) owner)._auxinf.spaceInfo.fellows.containsKey(compId)
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 setWidgetListener has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public String setWidgetListener(String evtnm, String script) {
                              if (evtnm == null)
                                  throw new IllegalArgumentException();
                      
                              final String old;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 service has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          /*package*/ void service(Event event, Scope scope, final List<EventListenerInfo> listeners,
                                  final EventHandler evthd, final Method mtd, boolean skipPageListener) throws Exception {
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (lis.isEmpty())
                                                    _auxinf.listeners.remove(evtnm);
                        Severity: Major
                        Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

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

                              public String setWidgetOverride(String name, String script) {
                                  if (name == null)
                                      throw new IllegalArgumentException();
                          
                                  final String old;
                          Severity: Minor
                          Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 (li.priority == priority)
                                                      return false; //nothing to do
                          Severity: Major
                          Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (!keyWritten) {
                                                        keyWritten = true;
                                                        s.writeObject(me.getKey());
                                                    }
                            Severity: Major
                            Found in zk/src/main/java/org/zkoss/zk/ui/EventListenerInfo.java - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language