Showing 4,835 of 7,777 total issues

Method renderValue has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderValue(Object value) {
        if (value == null || value instanceof String) {
            renderValue((String) value);
            return;
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.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

Exec has 100 methods (exceeds 20 allowed). Consider refactoring.
Open

    private static class Exec implements Execution {
        private static final Execution exec() {
            return Executions.getCurrent();
        }

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 day to fix

    Method unescape has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
    Open

        static void unescape(final char[] text, final int offset, final int len, final Writer writer)
                             throws IOException {
    
            if (text == null) {
                return;
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.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 Equality has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
    Open

      final public void Equality() throws ParseException {
        Compare();
        label_9:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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

    File AnnotateBinderHelper.java has 778 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* AnnotateBinderHelper.java
    
        Purpose:
            
        Description:
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.java - About 1 day to fix

      HtmlBasedComponent has 96 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public abstract class HtmlBasedComponent extends AbstractComponent {
          /** The ZK CSS class. */
          protected String _zclass;
          /** The prolog content that shall be generated before real content. */
          private String _prolog;
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 day to fix

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

            public final static void load(Map<? super String, ? super String> map, InputStream sm, String charset,
            boolean caseInsensitive) throws IOException {
                final PushbackInputStream pis = new PushbackInputStream(sm, 3);
                if (charset == null || charset.startsWith("UTF")) {
                    final byte[] ahead = new byte[3];
        Severity: Minor
        Found in zcommon/src/main/java/org/zkoss/util/Maps.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 addByRawValueInV6 has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
        Open

            private void addByRawValueInV6(String annotName, String rval,
                    Location loc) {
                final Map<String, String[]> attrs = new LinkedHashMap<String, String[]>(
                        4);
                final int len = rval.length();
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.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 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

        File Servlets.java has 771 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* Servlets.java
        
            Purpose:
            Description:
            History:
        Severity: Major
        Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java - About 1 day to fix

          Method equals has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final boolean equals(Object a, Object b) {
                  if (a == b || (a != null && b != null && a.equals(b)))
                      return true;
                  if ((a instanceof BigDecimal) && (b instanceof BigDecimal))
                      return ((BigDecimal)a).compareTo((BigDecimal) b) == 0;
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/lang/Objects.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 indexOf has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final int indexOf(Object o, Object element) {
                  if (o instanceof String) {
                      return element instanceof String ?
                          ((String)o).indexOf((String)element): -1;
                  } else if (o instanceof Collection) {
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.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

          Function create has 350 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              create(context) {
                  const tsdocConfig = getTsdocConfig();
                  if (!tsdocConfig) {
                      return {};
                  }
          Severity: Major
          Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 1 day to fix

            File TrackerImpl.java has 749 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* TrackerImpl.java
            
                Purpose:
                    
                Description:
            Severity: Major
            Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/TrackerImpl.java - About 1 day to fix

              Method lastIndexOf has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static final int lastIndexOf(Object o, Object element) {
                      if (o instanceof String) {
                          return element instanceof String ?
                              ((String)o).lastIndexOf((String)element): -1;
                      } else if (o instanceof List) {
              Severity: Minor
              Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.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

              Combobox has 91 methods (exceeds 20 allowed). Consider refactoring.
              Open

              @SuppressWarnings("serial")
              public class Combobox extends Textbox {
                  public static final String ICON_SCLASS = "z-icon-caret-down";
              
                  private static final Logger log = LoggerFactory.getLogger(Combobox.class);
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 1 day to fix

                File Components.java has 743 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* Components.java
                
                    Purpose:
                        
                    Description:
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/Components.java - About 1 day to fix

                  File mount.ts has 742 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* mount.js
                  
                      Purpose:
                  
                      Description:
                  Severity: Major
                  Found in zk/src/main/resources/web/js/zk/mount.ts - About 1 day to fix

                    Method Unary has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
                    Open

                      final public void Unary() throws ParseException {
                        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
                        case MINUS:
                          jj_consume_token(MINUS);
                                      AstNegative jjtn001 = new AstNegative(JJTNEGATIVE);
                    Severity: Minor
                    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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

                    Execution has 90 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public interface Execution extends Scope {
                        /** Returns the desktop associated with this execution.
                         * Each execution is against exactly one desktop.
                         */
                        public Desktop getDesktop();
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/Execution.java - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language