Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                        if (controller != null && comp.getAttribute((String) ctrlnm) == null) {
                            comp.setAttribute((String) ctrlnm, controller);
                        }
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AttributesInfo.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (sb != null)
                                sb.append(cc);
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/NativeInfo.java - About 45 mins to fix

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

          private static Method findNullable(final Method[] mtds, final Object val) {
              if (val == null) {
                  //Look for the most 'extended' class
                  Method m = null;
                  Class<?> t = null;
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Property.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 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 applyAttrAnnot has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private static void applyAttrAnnot(AnnotationHelper attrAnnHelper, ShadowInfo 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 (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 parseAsProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private void parseAsProperty(PageDefinition pgdef, ComponentInfo compInfo, String name, Collection items,
                      AnnotationHelper annHelper, ConditionImpl cond) 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 (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

              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

                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

                                          for (Annotation anno : annotationMap.getAnnotations(propName)) {
                                              compInfo.addAnnotation(propName, anno.getName(), anno.getAttributes(), anno.getLocation());
                                          }
                  Severity: Major
                  Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 45 mins to fix

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

                        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 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 (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 (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
                                Severity
                                Category
                                Status
                                Source
                                Language