Showing 7,775 of 7,775 total issues

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

    protected void compose() {
        final Execution exec = Executions.getCurrent();
        if (exec == null)
            throw new IllegalStateException("No execution available");

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

    public static final String outInitCrashScript(Execution exec, WebApp wapp) {
        if (exec.isAsyncUpdate(null))
            return ""; //nothing to generate

        if (wapp == null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 evaluateComposite has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static Object evaluateComposite(Evaluator eval, Page page, Object expr) {
        if (expr == null) {
            return null;
        } else if (expr instanceof ExValue) {
            return ((ExValue) expr).getValue(eval, page);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/xel/impl/Utils.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 evaluateComposite has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static Object evaluateComposite(Evaluator eval, Component comp, Object expr) {
        if (expr == null) {
            return null;
        } else if (expr instanceof ExValue) {
            return ((ExValue) expr).getValue(eval, comp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/xel/impl/Utils.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

                        for (Object[] evtinf : kidevts)
                            evtmap.add(evtinf);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.java - About 45 mins to fix

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

        public void setParent(Component parent) {
            if (isInline()) {
                if (_inlines == null)
                    compose(); //autocreate
    
    
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlMacroComponent.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 setPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public void setPage(Page page) {
            if (isInline()) {
                if (_inlines == null)
                    compose(); //autocreate
    
    
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlMacroComponent.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 showNotification has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static final void showNotification(String msg, String type, Component ref, String position, int duration,
                boolean closable) {
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/util/Clients.java - About 45 mins to fix

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

          public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end,
                  ExValue step) {
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ("div".equals(tn) || "span".equals(tn)) {
                                    l_loop: for (int j = 0, len = sb.length(); j < len; ++j)
                                        switch (sb.charAt(j)) {
                                        case '>':
                                            disableUnavailable = true; //make output cleaner
        Severity: Major
        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlNativeComponent.java - About 45 mins to fix

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

              public void removeListener(final Class<?> klass) {
                  if (_monitor != null && _monitor.getClass().equals(klass))
                      _monitor = null;
                  if (_pfmeter != null && _pfmeter.getClass().equals(klass))
                      _pfmeter = null;
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.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 loadUtilityHandler has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private static final void loadUtilityHandler() {
                  if (_handler != null)
                      return;
                  synchronized (SelectorComposer.class) {
                      if (_handler != null)
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/select/SelectorComposer.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 getInstance has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end,
                      ExValue step) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 45 mins to fix

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

                public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName,
                        int sizeThreshold, File repository);
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/DiskFileItemFactory.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (srccomp == null || !(srccomp instanceof Component)) {
                                              if (log.isDebugEnabled())
                                                  log.debug(
                                                          "Cannot find the associated component to forward event: {}",
                                                          mdname);
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWires.java - About 45 mins to fix

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

                    public static final void showNotification(String msg, String type, Component ref, int x, int y, int duration) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/util/Clients.java - About 45 mins to fix

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

                      public static void show(String msg, String type, Component ref, int x, int y, int duration) {
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/util/Notification.java - About 45 mins to fix

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

                        private boolean containsVariable(Object x, String fdname) {
                            //#feature 2770471 GenericAutowireComposer shall support wiring ZScript varible
                            if (x instanceof Page) {
                                final Page page = (Page) x;
                                return (!_ignoreZScript && page.getZScriptVariable(fdname) != null)
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.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 (srccomp == null) {
                                                    Page page = xcomp.getPage();
                                                    if (page != null)
                                                        srccomp = page.getXelVariable(null, null, srccompid, true);
                                                }
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWires.java - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (arg2 != arg && arg2 != null)
                                                  injectField(arg2, arg2.getClass(), fd);
                      Severity: Major
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language