Showing 4,841 of 7,782 total issues

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

    public void setValue(ELContext context, Object base, Object property,
            Object value) {
        if (context == null) {
            throw new NullPointerException();
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/ListELResolver.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 (jj_3_8()) {
    jj_scanpos = xsp;
    if (jj_3R_88()) {
    jj_scanpos = xsp;
    if (jj_3R_89()) return true;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

        if (jj_3R_84()) return true;
    Severity: Major
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 45 mins to fix

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

          public static Class<?> forName(String name) throws ClassNotFoundException {
              if (null == name || "".equals(name)) {
                  return null;
              }
              Class<?> c = forNamePrimitive(name);
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 add_escapes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        static String add_escapes(String str) {
            StringBuffer retval = new StringBuffer();
            char ch;
            for (int i = 0; i < str.length(); i++) {
              switch (str.charAt(i))
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/ParseException.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 addEscapes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        protected static final String addEscapes(String str) {
          StringBuffer retval = new StringBuffer();
          char ch;
          for (int i = 0; i < str.length(); i++) {
            switch (str.charAt(i))
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/TokenMgrError.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 getOutputStream has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              @Override
              public ServletOutputStream getOutputStream() throws IOException {
                  if (writer != null) {
                      throw new IllegalStateException(
                              "getWriter() has already been called on this response.");
      Severity: Minor
      Found in zktest/src/main/java/org/zkoss/zktest/util/ZkCspFilterStrictDynamic.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 coerceToBoolean has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static final Boolean coerceToBoolean(final Object obj,
                  boolean primitive) throws ELException {
      
              if (!COERCE_TO_ZERO && !primitive) {
                  if (obj == null) {
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.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 (mergedPRMPs == null) {
                                  // Lazy initialization
                                  mergedPRMPs = new LinkedHashMap<String, Object>();
                              }
      Severity: Major
      Found in zel/src/main/java/org/zkoss/zel/ClassIntrospector.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (paramTypes.length == 0) {
                                    mergeInPropertyReaderMethod(mergedPRMPs, propName, method);
                                } else { // It's an indexed property reader method
                                    mergeInPropertyReaderMethodPair(mergedPRMPs, propName,
                                            new PropertyReaderMethodPair(null, method));
        Severity: Major
        Found in zel/src/main/java/org/zkoss/zel/ClassIntrospector.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if (!typeName.equals(types[i].getName())) {
                                                  match = false;
                                              }
          Severity: Major
          Found in zel/src/main/java/org/zkoss/zel/ELProcessor.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

                    @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

            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

            Avoid deeply nested control flow statements.
            Open

                                    if (ptns[j].trim().length() > 1 && vals[k].trim().length() > 1) {
                                        if (vals[k].trim().toLowerCase(java.util.Locale.ENGLISH).indexOf(ptns[j].trim().toLowerCase(java.util.Locale.ENGLISH)) > -1) {
                                            m = true;
                                            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)

              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

                      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

              Severity
              Category
              Status
              Source
              Language