ilscipio/scipio-erp

View on GitHub
framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

Summary

Maintainability
F
4 days
Test Coverage

UtilCache has 127 methods (exceeds 20 allowed). Consider refactoring.
Open

@SuppressWarnings("serial")
public class UtilCache<K, V> implements Serializable, EvictionListener<Object, CacheLine<V>> {

    public static final String SEPARATOR = "::";    // cache key separator
    public static final Pattern SEPARATOR_PAT = Pattern.compile(SEPARATOR); // SCIPIO: 2.1.0: Added
Severity: Major
Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 2 days to fix

    Builder has 42 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public static class Builder<K, V> {
            String baseName;
            String resource;
            Boolean autoScope;
            List<String> propNames;
    Severity: Minor
    Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 5 hrs to fix

      Method getOrCreateUtilCache has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static <K, V> UtilCache<K, V> getOrCreateUtilCache(String name, int sizeLimit, int maxInMemory, long expireDelay, boolean useSoftReference, String keyFormat, Map<String, ?> indexDefs, String... propNames) {
      Severity: Major
      Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 1 hr to fix

        Method getOrCreateUtilCache has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static <K, V> UtilCache<K, V> getOrCreateUtilCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore, String... names) {
        Severity: Major
        Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 50 mins to fix

          Method createUtilCache has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static <K, V> UtilCache<K, V> createUtilCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore, String... propNames) {
          Severity: Major
          Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 50 mins to fix

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

                public static <K, V> UtilCache<K, V> createOnlyUtilCache(String name, int sizeLimit, int maxInMemory, long expireDelay, boolean useSoftReference, String... propNames) {
            Severity: Minor
            Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 45 mins to fix

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

                  public static <K, V> UtilCache<K, V> createUtilCache(String name, int sizeLimit, int maxInMemory, long expireTime, boolean useSoftReference, boolean useFileSystemStore) {
              Severity: Minor
              Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 45 mins to fix

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

                    public static <K, V> UtilCache<K, V> createUtilCache(String name, int sizeLimit, int maxInMemory, long expireDelay, boolean useSoftReference, String... propNames) {
                Severity: Minor
                Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (ikfValueOld == null) {
                                                  ikfNew.put(entry.getKey(), entry.getValue());
                                              } else if (ikfValueOld instanceof Map) {
                                                  Map<String, Object> newMap = new LinkedHashMap<>(UtilGenerics.cast(ikfValueOld));
                                                  newMap.putAll(UtilGenerics.cast(entry.getValue()));
                  Severity: Major
                  Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 45 mins to fix

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

                        public static <K, V> UtilCache<K, V> getOrCreateUtilCache(String name, int sizeLimit, int maxInMemory, long expireDelay, boolean useSoftReference, String... propNames) {
                    Severity: Minor
                    Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 45 mins to fix

                      Method createUtilCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public static <K, V> UtilCache<K, V> createUtilCache(String name, int sizeLimit, int maxInMemory, long expireDelay, boolean useSoftReference) {
                      Severity: Minor
                      Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 35 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return true;
                        Severity: Major
                        Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return 0;
                          Severity: Major
                          Found in framework/base/src/org/ofbiz/base/util/cache/UtilCache.java - About 30 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status