Showing 4,841 of 7,782 total issues

Avoid deeply nested control flow statements.
Open

                            if (!cit.hasNext()) // draw the rest
                                sit.previous();

    Avoid deeply nested control flow statements.
    Open

                                while (sit.hasNext()) {
                                    childrenArray.add(fillShadowElement(sit.next()));
                                }

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

              @Override
              public boolean equals(Object obj) {
                  if (this == obj)
                      return true;
                  if (obj == null)

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

          public String nextComponentUuid(Desktop desktop, Component comp,
                  ComponentInfo compInfo) {
      
              String id = null;
              if(compInfo != null){
      Severity: Minor
      Found in zktest/src/main/java/org/zkoss/zktest/test2/F60_882_IDGenerator.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 equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              @Override
              public boolean equals(Object obj) {
                  if (this == obj)
                      return true;
                  if (obj == null)

      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 init has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public void init(@QueryParam String name1, @QueryParam("name1") String name2,
                           @ExecutionParam String param1, @ExecutionParam("param1") String param2,
                           @ExecutionArgParam String arg1, @ExecutionArgParam("arg1") String arg2) {
      Severity: Minor
      Found in zktest/src/main/java/org/zkoss/zktest/test2/F95_ZK_4508VM.java - About 45 mins to fix

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

                @Override
                public boolean equals(Object obj) {
                    if (this == obj)
                        return true;
                    if (obj == null)

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

            public Validator getValidator2(){
                return new Validator(){
                    public void validate(ValidationContext ctx) {
                        if(!ctx.isValid()) return;
                        Property p = ctx.getProperty();
        Severity: Minor
        Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/B0004.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 equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            public boolean equals(Object obj) {
                if (this == obj)
                    return true;
                if (obj == null)
        Severity: Minor
        Found in zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3010Tag.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 (ptns[j].trim().length() > 1 && (vals[k].trim().length()-1 > 1)) {
                                    if (vals[k].trim().toLowerCase(java.util.Locale.ENGLISH).indexOf(ptns[j].trim().toLowerCase(java.util.Locale.ENGLISH).substring(1)) > -1) {
                                        m = false;
                                        break;
                                    }
        Severity: Major
        Found in zktest/src/main/java/org/zkoss/zktest/test2/MainLayout.java - About 45 mins to fix

          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

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

              public VariableResolver getVariableResolver(Object ref) {
                  final Execution exec = Executions.getCurrent();
                  VariableResolver resolver = exec.getVariableResolver();
                  if (resolver == null) {
                      final RequestContext rc = RequestContexts.getCurrent();
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/xel/impl/SimpleEvaluator.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 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 isValid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static final boolean isValid(String name) {
                  if (isReserved(name))
                      return false;
          
                  for (int j = name.length(); --j >= 0;) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/Names.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

          Avoid deeply nested control flow statements.
          Open

                                  if (desktopCtrl != null)
                                      desktopCtrl.mapComponent(uuid, this);
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.java - About 45 mins to fix

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

                public static final void setContentType(Execution exec, Page page) {
                    String contentType = ((PageCtrl) page).getContentType();
                    if (contentType == null) {
                        contentType = page.getDesktop().getDevice().getContentType();
                        if (contentType == 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

            Severity
            Category
            Status
            Source
            Language