Showing 7,775 of 7,775 total issues

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

    public void render(Treeitem treeitem, Object data, int index) throws Exception {
        Treerow row;
        if(treeitem.getTreerow()==null){// tree row not create yet.
            row = new Treerow();
            row.setParent(treeitem);

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

    Avoid deeply nested control flow statements.
    Open

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

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

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

        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/bind/issue/B02078.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

                                    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 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 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 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 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

          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 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

          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