zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java

Summary

Maintainability
F
4 days
Test Coverage

Method tieValue has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
Open

    protected void tieValue(ELContext elCtx, Object base, Object property, Object value, boolean allownotify) {
        //in order to support more complex case, ex: .stream().filter(x -> x.contains(vm.value))
        final BindELContext ctx;
        ELContext ec = ((EvaluationContext) elCtx).getELContext();
        if (ec instanceof BindELContext)
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 1 day 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 getValue has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(ELContext ctx, Object base, Object property) throws PropertyNotFoundException, ELException {
        Object value = null;
        if (base == null) {
            if (_pathResolver == null) {
                _pathResolver = new PathELResolver(); // init
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 5 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 tieValue has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected void tieValue(ELContext elCtx, Object base, Object property, Object value, boolean allownotify) {
        //in order to support more complex case, ex: .stream().filter(x -> x.contains(vm.value))
        final BindELContext ctx;
        ELContext ec = ((EvaluationContext) elCtx).getELContext();
        if (ec instanceof BindELContext)
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 2 hrs to fix

    File BindELResolver.java has 269 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* BindELResolver.java
    
        Purpose:
            
        Description:
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 2 hrs to fix

      Method getValue has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public Object getValue(ELContext ctx, Object base, Object property) throws PropertyNotFoundException, ELException {
              Object value = null;
              if (base == null) {
                  if (_pathResolver == null) {
                      _pathResolver = new PathELResolver(); // init
      Severity: Minor
      Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 2 hrs to fix

        Method invoke has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public Object invoke(ELContext ctx, Object base, Object method, Class[] paramTypes, Object[] params)
                    throws MethodNotFoundException {
                Object value = super.invoke(ctx, base, method, paramTypes, params);
                // in order to support more complex case, ex: .stream().filter(x -> x.contains(vm.value))
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 1 hr to fix

          Method invoke has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public Object invoke(ELContext ctx, Object base, Object method, Class[] paramTypes, Object[] params)
                      throws MethodNotFoundException {
                  Object value = super.invoke(ctx, base, method, paramTypes, params);
                  // in order to support more complex case, ex: .stream().filter(x -> x.contains(vm.value))
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 1 hr 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 saveEqualBeans has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void saveEqualBeans(ELContext elCtx, Object base, String prop, Object value) {
                  final BindELContext ctx = (BindELContext) ((EvaluationContext) elCtx).getELContext();
          
                  final BindContext bctx = (BindContext) ctx.getAttribute(BinderImpl.BINDCTX);
          
          
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 1 hr to fix

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

                  private void saveEqualBeans(ELContext elCtx, Object base, String prop, Object value) {
                      final BindELContext ctx = (BindELContext) ((EvaluationContext) elCtx).getELContext();
              
                      final BindContext bctx = (BindContext) ctx.getAttribute(BinderImpl.BINDCTX);
              
              
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.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 tieValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected void tieValue(ELContext elCtx, Object base, Object property, Object value, boolean allownotify) {
              Severity: Minor
              Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 35 mins to fix

                Method invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public Object invoke(ELContext ctx, Object base, Object method, Class[] paramTypes, Object[] params)
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 35 mins to fix

                  Method setValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void setValue(ELContext ctx, Object base, Object property, Object value)
                              throws PropertyNotFoundException, PropertyNotWritableException, ELException {
                  
                          if (base == null) {
                              //ZK-1085 PropertyNotWritableException when using reference binding
                  Severity: Minor
                  Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELResolver.java - About 25 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

                  There are no issues that match your filters.

                  Category
                  Status