Showing 4,841 of 7,782 total issues

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

      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

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

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

                public static Map<String, Object> evalArgs(BindEvaluatorX eval, Component comp, Map<String, Object> args,
                        Map<String, Object> implicit) {
                    if (args == null) {
                        return null;
                    }
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/BindEvaluatorXUtil.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

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

                  private boolean validateSavePropertyBinding(Component comp, SavePropertyBinding binding, String command,
                          Map<String, Property[]> validates, boolean valid, Set<Property> notifys) {
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.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

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

                    private void processFormInit(Component comp, String formId, Annotation ann) {
                        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

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

                        private void remove(Entry toRemove) {
                            Entry[] tab = this.table;
                            int index = (toRemove.hash & 0x7fffffff) % tab.length;
                
                            for (Entry e = tab[index], prev = null; e != null; e = e.next) {
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/WeakIdentityMap.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 equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    static boolean equals(Object[] a, Object[] b) {
                        if (a == b) {
                            return true;
                        }
                        if (a == null || b == 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 (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 validateSaveFormBinding has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private boolean validateSaveFormBinding(Component comp, SaveFormBinding binding, String command,
                              Map<String, Property[]> validates, boolean valid, Set<Property> notifys) {
                          //validate tracked savebinding
                          Set<SaveBinding> savebindings = ((BinderCtrl) binding.getBinder())
                                  .getFormAssociatedSaveBindings(binding.getComponent());
                  Severity: Minor
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.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 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