Showing 4,841 of 7,782 total issues

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

    public JSONArray finishUpdate(Object ctx, List<Throwable> errs) throws IOException {
        final UpdateInfo ui = (UpdateInfo) ctx;
        final Execution exec = ui.uv.getExecution();
        final Desktop desktop = exec.getDesktop();

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 getLastModified has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected long getLastModified(HttpServletRequest request) {
        final String pi = Https.getThisPathInfo(request);
        if (pi != null && pi.startsWith(ClassWebResource.PATH_PREFIX) && pi.indexOf('*') < 0 //language independent
                && !Servlets.isIncluded(request)) {
            //If a resource extension is registered for the extension, we assume the content is dynamic
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlResourceServlet.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 getLastModified has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected long getLastModified(HttpServletRequest request) {
        final String pi = Https.getThisPathInfo(request);
        if (pi != null && pi.startsWith(ClassWebResource.PATH_PREFIX) && pi.indexOf('*') < 0 //language independent
                && !Servlets.isIncluded(request)) {
            //If a resource extension is registered for the extension,
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.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 (value instanceof FormProxyObject) {
                                ((FormProxyObject) value).submitToOrigin((BindContext) args[0]);
                            }
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/proxy/BeanProxyHandler.java - About 45 mins to fix

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

        public List<Object> getEncodedData() {
            if (_data == null)
                return null;
    
            final JSONArray encdata = new JSONArray();
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/au/AuResponse.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 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 getValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            public Object getValue(ELContext context, Object property, int numOfKids) {
                String[] msgs = null;
                if (property instanceof Component) {
                    context.setPropertyResolved(true);
                    if (numOfKids == 0) { //case vmsgs.texts[tb1]

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

        /* package */static void cacheSavePropertyBinding(ProxyNode node, String property, SavePropertyBinding savePropertyBinding) {
            while (node != null) {
                ProxyNode parent = node.getParent();
                if (parent == null) {
                    node.getCachedSavePropertyBinding().add(new Pair<>(property, savePropertyBinding));
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/proxy/ProxyHelper.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 coerce has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static final Integer coerce(Object property) {
            //should only handle a property that is possible a number
            if (property instanceof Number) {
                return ((Number) property).intValue();
            }
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/ListModelELResolver.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 (_dirtyFieldNames != null && _dirtyFieldNames.contains(me.getKey())) {
                                    final String setter = ProxyHelper.toSetter(me.getKey());
                                    try {
                                        final Method m = Classes.getMethodByObject(_origin.getClass(), setter,
                                                new Object[] { value });
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/proxy/BeanProxyHandler.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

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

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

            public String toString() {
                //Don't call getCommand and getData since it causes
                //AuSetDeferredAttribute to evaluate the deferred value
                final StringBuffer sb = new StringBuffer(60).append("[cmd=").append(_cmd);
                if (_data != null && _data.length > 0) {
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/au/AuResponse.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 (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

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

                public static final String add(String zslang, String ipcls) {
                    if (zslang == null || zslang.length() == 0 || ipcls == null || ipcls.length() == 0)
                        throw new IllegalArgumentException("emty or null");
            
                    for (int j = zslang.length(); --j >= 0;) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/scripting/Interpreters.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 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 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 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
                Severity
                Category
                Status
                Source
                Language