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

Summary

Maintainability
D
1 day
Test Coverage

Method addTracking has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
Open

    protected void addTracking(List<String> series) {
        final Binding binding = _ctx.getBinding();
        final boolean dotracker = !_ctx.ignoreTracker();

        if (binding != null && series != null && !series.isEmpty()) {

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 addTracking has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected void addTracking(List<String> series) {
        final Binding binding = _ctx.getBinding();
        final boolean dotracker = !_ctx.ignoreTracker();

        if (binding != null && series != null && !series.isEmpty()) {

    Avoid deeply nested control flow statements.
    Open

                            if (_log.isDebugEnabled()) {
                                _log.debug("add save-field '%s' to form '%s'", fieldName, formLegacyBean);
                            }
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindExpressionBuilder.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (formLegacyBean instanceof FormLegacyExt) {
                                  ((FormLegacyExt) formLegacyBean).addSaveFieldName(fieldName);
                              }
      Severity: Major
      Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindExpressionBuilder.java - About 45 mins to fix

        Method visitNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected void visitNode(Node node) {
                if (_ctx.getBinding() == null)
                    return; //no need to build tracker, we are not in binding expression
        
                final List<String> path = new ArrayList<String>();
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindExpressionBuilder.java - About 35 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