Showing 7,775 of 7,775 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

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

    public boolean isReadOnly(ELContext context, Object base, Object property) {
        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 (kind > 56)
                        kind = 56;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

    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

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

        protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/impl/parser/TokenMgrError.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                             if (kind > 57)
                                kind = 57;
        Severity: Major
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                               if (kind > 10)
                                  kind = 10;
          Severity: Major
          Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 45 mins to fix

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

                private static final int coerce(Object property) {
                    if (property instanceof Number) {
                        return ((Number) property).intValue();
                    }
                    if (property instanceof Character) {
            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_3R_84()) 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 (c.gen < jj_gen) c.first = null;
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 45 mins to fix

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

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

                    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

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

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

                        Severity
                        Category
                        Status
                        Source
                        Language