zel/src/main/java/org/zkoss/zel/Util.java

Summary

Maintainability
F
1 wk
Test Coverage

Method findWrapper has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("null")
    private static Wrapper findWrapper(Class<?> clazz, List<Wrapper> wrappers,
            String name, Class<?>[] paramTypes, Object[] paramValues) {

        Map<Wrapper,MatchResult> candidates = new HashMap<Wrapper,MatchResult>();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 day 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

File Util.java has 580 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 day to fix

    Method findWrapper has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @SuppressWarnings("null")
        private static Wrapper findWrapper(Class<?> clazz, List<Wrapper> wrappers,
                String name, Class<?>[] paramTypes, Object[] paramValues) {
    
            Map<Wrapper,MatchResult> candidates = new HashMap<Wrapper,MatchResult>();
    Severity: Major
    Found in zel/src/main/java/org/zkoss/zel/Util.java - About 4 hrs to fix

      Method resolveAmbiguousWrapper has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          private static Wrapper resolveAmbiguousWrapper(Set<Wrapper> candidates,
                  Class<?>[] paramTypes) {
              // Identify which parameter isn't an exact match
              Wrapper w = candidates.iterator().next();
      
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/Util.java - About 3 hrs 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 getMethod has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          static Method getMethod(Class<?> type, Method m) {
              if (m == null || Modifier.isPublic(type.getModifiers())) {
                  return m;
              }
              Class<?>[] inf = type.getInterfaces();
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/Util.java - About 2 hrs 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 resolveAmbiguousWrapper has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static Wrapper resolveAmbiguousWrapper(Set<Wrapper> candidates,
                  Class<?>[] paramTypes) {
              // Identify which parameter isn't an exact match
              Wrapper w = candidates.iterator().next();
      
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr to fix

        Method buildParameters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            static Object[] buildParameters(Class<?>[] parameterTypes,
                    boolean isVarArgs,Object[] params) {
                ExpressionFactory factory = getExpressionFactory();
                Object[] parameters = null;
                if (parameterTypes.length > 0) {
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr 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 isAssignableFrom has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                // src will always be an object
                // Short-cut. null is always assignable to an object and in EL null
                // can always be coerced to a valid value for a primitive
                if (src == null) {
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr 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 getExpressionFactory has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static ExpressionFactory getExpressionFactory() {
        
                ClassLoader tccl = ClassUtil.getContextClassLoader(Util.class);
                CacheValue cacheValue = null;
                ExpressionFactory factory = null;
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr to fix

          Method getExpressionFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              static ExpressionFactory getExpressionFactory() {
          
                  ClassLoader tccl = ClassUtil.getContextClassLoader(Util.class);
                  CacheValue cacheValue = null;
                  ExpressionFactory factory = null;
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr 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 buildParameters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static Object[] buildParameters(Class<?>[] parameterTypes,
                      boolean isVarArgs,Object[] params) {
                  ExpressionFactory factory = getExpressionFactory();
                  Object[] parameters = null;
                  if (parameterTypes.length > 0) {
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr to fix

            Method getMethod has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static Method getMethod(Class<?> type, Method m) {
                    if (m == null || Modifier.isPublic(type.getModifiers())) {
                        return m;
                    }
                    Class<?>[] inf = type.getInterfaces();
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr to fix

              Method isAssignableFrom has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                      // src will always be an object
                      // Short-cut. null is always assignable to an object and in EL null
                      // can always be coerced to a valid value for a primitive
                      if (src == null) {
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/Util.java - About 1 hr to fix

                Method paramString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static final String paramString(Class<?>[] types) {
                        if (types != null) {
                            StringBuilder sb = new StringBuilder();
                            for (int i = 0; i < types.length; i++) {
                                if (types[i] == null) {
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/Util.java - About 55 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 getConstructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    static Constructor<?> getConstructor(Class<?> type, Constructor<?> c) {
                        if (c == null || Modifier.isPublic(type.getModifiers())) {
                            return c;
                        }
                        Constructor<?> cp = null;
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/Util.java - About 55 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 findWrapper has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private static Wrapper findWrapper(Class<?> clazz, List<Wrapper> wrappers,
                            String name, Class<?>[] paramTypes, Object[] paramValues) {
                Severity: Minor
                Found in zel/src/main/java/org/zkoss/zel/Util.java - About 35 mins to fix

                  Method message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      static String message(ELContext context, String name, Object... props) {
                          Locale locale = null;
                          if (context != null) {
                              locale = context.getLocale();
                          }
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/Util.java - About 25 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 compareTo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public int compareTo(MatchResult o) {
                              int cmp = compare(this.getExact(), o.getExact());
                              if (cmp == 0) {
                                  cmp = compare(this.getAssignable(), o.getAssignable());
                                  if (cmp == 0) {
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/Util.java - About 25 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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      private static Wrapper resolveAmbiguousWrapper(Set<Wrapper> candidates,
                              Class<?>[] paramTypes) {
                          // Identify which parameter isn't an exact match
                          Wrapper w = candidates.iterator().next();
                  
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 4 hrs to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 297..358

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 297.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      private static class MatchResult implements Comparable<MatchResult> {
                  
                          private final int exact;
                          private final int assignable;
                          private final int coercible;
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 4 hrs to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 474..527

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 265.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              for (int i = 0; i < mParamCount; i++) {
                                  // Can't be null
                                  if (mParamTypes[i].equals(paramTypes[i])) {
                                      exactMatch++;
                                  } else if (i == (mParamCount - 1) && w.isVarArgs()) {
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 4 hrs to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 194..235

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 260.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      static Method getMethod(Class<?> type, Method m) {
                          if (m == null || Modifier.isPublic(type.getModifiers())) {
                              return m;
                          }
                          Class<?>[] inf = type.getInterfaces();
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 3 hrs to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 419..449

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 205.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      static boolean isAssignableFrom(Class<?> src, Class<?> target) {
                          // src will always be an object
                          // Short-cut. null is always assignable to an object and in EL null
                          // can always be coerced to a valid value for a primitive
                          if (src == null) {
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 3 hrs to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 365..396

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 201.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (isVarArgs) {
                                  int varArgIndex = parameterTypes.length - 1;
                                  // First argCount-1 parameters are standard
                                  for (int i = 0; (i < varArgIndex); i++) {
                                      parameters[i] = factory.coerceToType(params[i],
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 2 hrs to fix
                  zel/src/main/java/org/zkoss/zel/BeanELResolver.java on lines 215..234

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 158.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      private static final String paramString(Class<?>[] types) {
                          if (types != null) {
                              StringBuilder sb = new StringBuilder();
                              for (int i = 0; i < types.length; i++) {
                                  if (types[i] == null) {
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 1 hr to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 452..468

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 122.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      private static class CacheKey {
                          private final int hash;
                          private final WeakReference<ClassLoader> ref;
                  
                          public CacheKey(ClassLoader key) {
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 1 hr to fix
                  zel/src/main/java/org/zkoss/zel/ExpressionFactory.java on lines 240..268

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 117.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      private static Class<?>[] getTypesFromValues(Object[] values) {
                          if (values == null) {
                              return null;
                          }
                  
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 1 hr to fix
                  zel/src/main/java/org/zkoss/zel/impl/parser/AstValue.java on lines 344..358

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 104.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          if (tccl == null) {
                              cacheValue = nullTcclFactory;
                          } else {
                              CacheKey key = new CacheKey(tccl);
                              cacheValue = factoryCache.get(key);
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 1 hr to fix
                  zel/src/main/java/org/zkoss/zel/ExpressionFactory.java on lines 70..82

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 92.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          for (Map.Entry<Wrapper, MatchResult> entry : candidates.entrySet()) {
                              int cmp = entry.getValue().compareTo(bestMatch);
                              if (cmp > 0 || match == null) {
                                  bestMatch = entry.getValue();
                                  match = entry.getKey();
                  Severity: Major
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 1 hr to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 255..264

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 90.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  for (int i = 0; i < parameterTypes.length; i++) {
                                      parameters[i] = factory.coerceToType(params[i],
                                              parameterTypes[i]);
                                  }
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 40 mins to fix
                  zel/src/main/java/org/zkoss/zel/BeanELResolver.java on lines 237..240

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 48.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (bestMatch.getExact() == paramCount - 1) {
                                  // Only one parameter is not an exact match - try using the
                                  // super class
                                  match = resolveAmbiguousWrapper(candidates.keySet(), paramTypes);
                              } else {
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/Util.java and 1 other location - About 30 mins to fix
                  zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 266..272

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 40.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status