Showing 7,775 of 7,775 total issues

Avoid deeply nested control flow statements.
Open

                        if (allownotify) {
                            //ZK-905 Save into a Form should fire NotifyChange
                            if (isForm) {
                                //collect notify property, kept in BindContext

Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 45 mins to fix

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

        public void tieValue(Object comp, Object base, Object script, Object propName, Object value, Object basePath);
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/sys/tracker/Tracker.java - About 45 mins to fix

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

          @SuppressWarnings("rawtypes")
          public Object coerceToBean(Object val, C comp, BindContext ctx) {
              if (val == null) {
                  throw new NullPointerException("value");
              }

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

          public Object coerceToBean(Object val, Component comp, BindContext ctx) {
              //since there is always a model, we get the selected by item by model directly
              if (val != null) {
                  Selectbox sbox = (Selectbox) comp;
                  final ListModel<?> model = sbox.getModel();

      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 addFormLoadBindings has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void addFormLoadBindings(Component comp, String id, String loadExpr, String[] beforeCmds, String[] afterCmds,
                  Map<String, Object> bindingArgs);
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/Binder.java - About 45 mins to fix

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

            public boolean isFormDirty() {
                if (_dirty)
                    return true;
                Iterator<?> e = iterator();
                while (e.hasNext()) {
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelListProxy.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 newXelContext has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected XelContext newXelContext(BindContext ctx, final Component comp) {
                final FunctionMapper mapper = getFunctionMapper(comp);
                //ZK-1795MVVM nested template may cause exception
                //Dennis: Shouldn't get the real variable-resolver and keep it, it will set ref as evaluator's self, 
                //When nested MVVM templates, if there are a ref-binding, it will newXelContext multiple time to do new evaluation in this evaluation,
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/BindEvaluatorXImpl.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 isFormDirty has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public boolean isFormDirty() {
                if (_dirty)
                    return true;
                int size = getSize();
                ListModelArray<E> cache = getCache();
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelArrayProxy.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 isFormDirty has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public boolean isFormDirty() {
                if (_dirty)
                    return true;
                Iterator<?> e = iterator();
                while (e.hasNext()) {
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/proxy/ListModelSetProxy.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 (log.isDebugEnabled()) {
                                    log.debug(
                                            "value reference not found by expression [{}], check if you are trying to save to a variable only expression",
                                            expr.getExpressionString());
                                }
        Severity: Major
        Found in zkbind/src/main/java/org/zkoss/bind/impl/SaveFormBindingImpl.java - About 45 mins to fix

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

              public boolean isFormDirty() {
                  if (_dirty)
                      return true;
                  Iterator<?> e = iterator();
                  while (e.hasNext()) {
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/proxy/AbstractCollectionProxy.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 resolveTemplate has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected Template resolveTemplate(Component templateComp, Component comp, Object data, int index, int size,
                      String defaultName) {
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/impl/AbstractRenderer.java - About 45 mins to fix

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

                public void addPropertyInitBinding(Component comp, String attr, String initExpr, Map<String, Object> initArgs,
                        String converterExpr, Map<String, Object> converterArgs);
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/Binder.java - About 45 mins to fix

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

                  public ValueReference getValueReference(BindContext ctx, Component comp, ExpressionX expression)
                          throws XelException {
                      try {
                          ValueReference ref = expression.getValueReference(newXelContext(ctx, comp));
                          //bug 1129-ref NPE, no value reference if it is a SimpleNode
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/impl/BindEvaluatorXImpl.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 (args != null) {
                                          if (args.size() == 1) {
                                              Object data = new JavaScriptValue(String.valueOf(binder.getConverter("jsonBindingParam")
                                                      .coerceToUi(args.values().iterator().next(), ctx.getComponent(), ctx)));
                                              Clients.response(new AuInvoke(ctx.getBinder().getView(), "$afterCommand",
              Severity: Major
              Found in zkbind/src/main/java/org/zkoss/bind/impl/ClientBinderPhaseListener.java - About 45 mins to fix

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

                    public static BindContext newBindContext(Binder binder, Binding binding, boolean save, String command,
                            Component comp, Event event) {
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/BindContextUtil.java - About 45 mins to fix

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

                      static int compare(Object[] a, Object[] b) {
                          if (a == b) {
                              return 0;
                          }
                          if (a == null) {
                  Severity: Minor
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 (!activating) { //don't load to form if activating
                                              //ZK-911. Save into Form bean via expression(so will use form's AccessFieldName)
                                              final ExpressionX formExpr = getFormExpression(eval, field);
                                              eval.setValue(null, comp, formExpr, value); //formExprform.setField(field, value);
                                          }
                  Severity: Major
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/LoadFormBindingImpl.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (prev != null) {
                                                prev.next = e.next;
                                            } else {
                                                tab[i] = e.next;
                                            }
                    Severity: Major
                    Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.java - About 45 mins to fix

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

                          private void processChildrenInit(Component comp, Annotation ann, ExpressionAnnoInfo converterInfo) {
                              String initExpr = null;
                      
                              Map<String, String[]> args = null;
                              for (final Iterator<Entry<String, String[]>> it = ann.getAttributes().entrySet().iterator(); it.hasNext();) {
                      Severity: Minor
                      Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.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

                      Severity
                      Category
                      Status
                      Source
                      Language