ilscipio/scipio-erp

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

Summary

Maintainability
F
4 days
Test Coverage

UtilHttp has 195 methods (exceeds 20 allowed). Consider refactoring.
Open

public final class UtilHttp {

    private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());

    public static final String MULTI_ROW_DELIMITER = "_o_"; // SCIPIO: 2018-08: keeping public for backward-compat
Severity: Major
Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 3 days to fix

    Avoid deeply nested control flow statements.
    Open

                            if (buf.length() > 0) {
                                if (useExpandedEntites) {
                                    buf.append("&");
                                } else {
                                    buf.append("&");
    Severity: Major
    Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (entry.getValue() instanceof ByteBuffer) {
                                  ByteBuffer value = (ByteBuffer) entry.getValue();
                                  paramMap.put(key, value);
                              } else {
                                  String value = (String) entry.getValue();
      Severity: Major
      Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (curValue instanceof List<?>) {
                                    paramList = UtilGenerics.checkList(curValue);
                                    paramList.add(value);
                                } else {
                                    String paramString = (String) curValue;
        Severity: Major
        Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (fieldName.startsWith(prefix)) {
                                      paramList.add(entry.getValue());
                                  }
          Severity: Major
          Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (fieldName.endsWith(suffix)) {
                                        String key = fieldName.substring(prefix.length(), fieldName.length() - (suffix.length() - 1));
                                        Object value = entry.getValue();
                                        paramMap.put(key, value);
            
            
            Severity: Major
            Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 45 mins to fix

              Consider simplifying this complex logical expression.
              Open

                          if (Boolean.TRUE.equals(include) || val instanceof String || val instanceof Number || val instanceof Map<?, ?> || val instanceof List<?> || val instanceof Boolean) {
                              if (Debug.verboseOn()) {
                                  Debug.logVerbose("Adding attribute to JSON output: " + key, module);
                              }
                              returnMap.put(key, val);
              Severity: Major
              Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 40 mins to fix

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

                    public static void streamContentToBrowser(HttpServletResponse response, InputStream in, int length, String contentType, String fileName) throws IOException {
                Severity: Minor
                Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 35 mins to fix

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

                      public static Map<String, Object> getParameterMap(HttpServletRequest request, Set<? extends String> nameSet, Boolean onlyIncludeOrSkip, Boolean readBody,
                                                                        Object paramFilter) {
                  Severity: Minor
                  Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 35 mins to fix

                    Avoid too many return statements within this method.
                    Open

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

                      Avoid too many return statements within this method.
                      Open

                                      return new Timestamp(cal.getTimeInMillis());
                      Severity: Major
                      Found in framework/base/src/org/ofbiz/base/util/UtilHttp.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

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

                          There are no issues that match your filters.

                          Category
                          Status